merge

package
v0.0.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Details string
	// contains filtered or unexported fields
}

Error and details from Push()

type Input

type Input struct {
	// Repo is the git Repo
	Repo lib.Repo
	// PRNumber of Github, e.g. for https://github.com/Clever/microplane/pull/123, the PRNumber is 123
	PRNumber int
	// CommitSHA for the commit which opened the above PR. Used to look up Commit status.
	CommitSHA string
	// RequireReviewApproval specifies if the PR must be approved before merging
	// - must have at least 1 reviewer
	// - all reviewers must have explicitly approved
	RequireReviewApproval bool
	// RequireBuildSuccess specifies if the PR must have a successful build before merging
	RequireBuildSuccess bool
	// Merge method to use. Possible values include: "merge", "squash", and "rebase"
	MergeMethod string
}

Input to Push()

type Output

type Output struct {
	Success        bool
	MergeCommitSHA string
}

Output from Push()

func GitHubMerge

func GitHubMerge(ctx context.Context, input Input, repoLimiter *time.Ticker, mergeLimiter *time.Ticker) (Output, error)

Merge an open PR in Github - repoLimiter rate limits the # of calls to Github - mergeLimiter rate limits # of merges, to prevent load when submitting builds to CI system

func GitlabMerge

func GitlabMerge(ctx context.Context, input Input, repoLimiter *time.Ticker, mergeLimiter *time.Ticker) (Output, error)

Merge an open MR in Gitlab - repoLimiter rate limits the # of calls to Github - mergeLimiter rate limits # of merges, to prevent load when submitting builds to CI system

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL