Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateMessage ¶
func UpdateMessage(ed editor.Editor, pr *github.PullRequest) error
UpdateMessage uses the given editor to edit the commit message of the given PR.
func Walk ¶ added in v0.5.0
func Walk(cfg WalkConfig, pulls []*github.PullRequest, v Visitor) error
Walk traverses a pull request tree by visiting the given pull requests and their children in an unspecified order. The only ordering guarantee is that parents are visited before their children.
Errors encountered while visiting pull requests are collatted and presented as one.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a PR service.
func NewService ¶ added in v0.5.0
func NewService(cfg ServiceConfig) *Service
NewService builds a new PR service with the given configuration.
func (*Service) Land ¶
func (s *Service) Land(ctx context.Context, req *service.LandRequest) (*service.LandResponse, error)
Land the given pull request.
func (*Service) Rebase ¶ added in v0.2.0
func (s *Service) Rebase(ctx context.Context, req *service.RebaseRequest) (_ *service.RebaseResponse, err error)
Rebase a pull request and its dependencies.
type ServiceConfig ¶ added in v0.5.0
ServiceConfig specifies the different parameters for a PR service.
type Visitor ¶ added in v0.5.0
type Visitor interface { // Visits the given pull request and returns a new visitor to visit its // children. // // If a visitor was not returned, the children of this PR will not be // visited. // // This function MAY be called concurrently. Implementations MUST be // thread-safe. Visit(*github.PullRequest) (Visitor, error) }
Visitor defines what to do at each pull request during a walk.
type WalkConfig ¶ added in v0.5.0
type WalkConfig struct { // Maximum number of pull requests to visit at the same time. // // Defaults to the number of CPUs available to this process. Concurrency int // Children retrieves the children of the given pull request. // // The definition of what constitutes a child of a PR is left up to the // implementation. // // This function MAY be called concurrently. Implementations MUST be // thread-safe. Children func(*github.PullRequest) ([]*github.PullRequest, error) }
WalkConfig configures a pull request traversal.