This commit is contained in:
Julian Tölle 2024-08-31 10:20:16 +02:00
parent 8b3bd3ca27
commit 901b5977e6
5 changed files with 32 additions and 24 deletions

View file

@ -26,7 +26,7 @@ type Forge interface {
// EnsureLabelsExist verifies that all desired labels are available on the repository. If labels are missing, they
// are created them.
EnsureLabelsExist(context.Context, []rp.Label) error
EnsureLabelsExist(context.Context, []Label) error
// PullRequestForBranch returns the open pull request between the branch and Options.BaseBranch. If no open PR
// exists, it returns nil.
@ -41,7 +41,7 @@ type Forge interface {
// SetPullRequestLabels updates the pull/merge request identified through the ID of
// the ReleasePullRequest to the current labels.
SetPullRequestLabels(ctx context.Context, pr *rp.ReleasePullRequest, remove, add []rp.Label) error
SetPullRequestLabels(ctx context.Context, pr *rp.ReleasePullRequest, remove, add []Label) error
// ClosePullRequest closes the pull/merge request identified through the ID of
// the ReleasePullRequest, as it is no longer required.
@ -49,7 +49,7 @@ type Forge interface {
// PendingReleases returns a list of ReleasePullRequest. The list should contain all pull/merge requests that are
// merged and have the matching label.
PendingReleases(context.Context, rp.Label) ([]*rp.ReleasePullRequest, error)
PendingReleases(context.Context, Label) ([]*rp.ReleasePullRequest, error)
// CreateRelease creates a release on the Forge, pointing at the commit with the passed in details.
CreateRelease(ctx context.Context, commit git.Commit, title, changelog string, prerelease, latest bool) error
@ -59,3 +59,6 @@ type Options struct {
Repository string
BaseBranch string
}
// Label is the string identifier of a pull/merge request label on the forge.
type Label string