Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Closer ¶ added in v0.13.0
type Closer struct {
VersionController VersionController
FeatureBranch string
}
Closer closes pull requests
type ConflictStrategy ¶ added in v0.37.0
type ConflictStrategy int
ConflictStrategy define how a conflict of an already existing branch should be handled
const ( // ConflictStrategySkip will skip the run for if the branch does already exist ConflictStrategySkip ConflictStrategy = iota + 1 // ConflictStrategyReplace will ignore any existing branch and replace it with new changes ConflictStrategyReplace )
func ParseConflictStrategy ¶ added in v0.37.0
func ParseConflictStrategy(str string) (ConflictStrategy, error)
ParseConflictStrategy parses a conflict strategy from a string
type Git ¶ added in v0.28.0
type Git interface {
Clone(url string, baseName string) error
ChangeBranch(branchName string) error
Changes() (bool, error)
Commit(commitAuthor *git.CommitAuthor, commitMessage string) error
BranchExist(remoteName, branchName string) (bool, error)
Push(remoteName string, force bool) error
AddRemote(name, url string) error
}
Git is a git implementation
type Merger ¶
type Merger struct {
VersionController VersionController
FeatureBranch string
}
Merger merges pull requests in an organization
type Printer ¶ added in v0.12.0
type Printer struct {
VersionController VersionController
ScriptPath string // Must be absolute path
Arguments []string
Stdout io.Writer
Stderr io.Writer
Concurrent int
CreateGit func(dir string) Git
}
Printer contains fields to be able to do the print command
type Runner ¶
type Runner struct {
VersionController VersionController
ScriptPath string // Must be absolute path
Arguments []string
FeatureBranch string
Output io.Writer
CommitMessage string
PullRequestTitle string
PullRequestBody string
Reviewers []string
MaxReviewers int // If set to zero, all reviewers will be used
DryRun bool
CommitAuthor *git.CommitAuthor
BaseBranch string // The base branch of the PR, use default branch if not set
Assignees []string
Concurrent int
SkipPullRequest bool // If set, the script will run directly on the base-branch without creating any PR
SkipRepository []string // A list of repositories that run will skip
Fork bool // If set, create a fork and make the pull request from it
ForkOwner string // The owner of the new fork. If empty, the fork should happen on the logged in user
ConflictStrategy ConflictStrategy // Defines what will happen if a branch does already exist
Draft bool // If set, creates Pull Requests as draft
Interactive bool // If set, interactive mode is activated and the user will be asked to verify every change
CreateGit func(dir string) Git
}
Runner contains fields to be able to do the run
type Statuser ¶
type Statuser struct {
VersionController VersionController
Output io.Writer
FeatureBranch string
}
Statuser checks the statuses of pull requests
type VersionController ¶
type VersionController interface {
GetRepositories(ctx context.Context) ([]scm.Repository, error)
CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, newPR scm.NewPullRequest) (scm.PullRequest, error)
GetPullRequests(ctx context.Context, branchName string) ([]scm.PullRequest, error)
GetOpenPullRequest(ctx context.Context, repo scm.Repository, branchName string) (scm.PullRequest, error)
MergePullRequest(ctx context.Context, pr scm.PullRequest) error
ClosePullRequest(ctx context.Context, pr scm.PullRequest) error
ForkRepository(ctx context.Context, repo scm.Repository, newOwner string) (scm.Repository, error)
}
VersionController fetches repositories
Click to show internal directories.
Click to hide internal directories.