Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMergeChecker ¶
func NewMergeChecker(params Params) mergechecker.MergeChecker
NewMergeChecker creates a new GitHub MergeChecker.
Types ¶
type PRInfo ¶
type PRInfo struct {
// Number is the pull request number.
Number int
// Mergeable is the mergeability state of the PR.
Mergeable PRMergeableState
// BaseRefName is the base branch the PR targets.
BaseRefName string
// HeadRefName is the head branch of the PR.
HeadRefName string
// HeadRefOid is the current head commit SHA of the PR.
HeadRefOid string
// State is the current state of the PR (OPEN, CLOSED, MERGED).
State PRState
}
PRInfo holds the relevant pull request information fetched from GitHub.
type PRMergeableState ¶
type PRMergeableState string
PRMergeableState represents the mergeability state of a pull request.
const ( // PRMergeableStateMergeable indicates the PR can be merged cleanly. PRMergeableStateMergeable PRMergeableState = "MERGEABLE" // PRMergeableStateConflicting indicates the PR has merge conflicts. PRMergeableStateConflicting PRMergeableState = "CONFLICTING" // PRMergeableStateUnknown indicates GitHub hasn't computed mergeability yet. // GitHub computes mergeability asynchronously after pushes. The GraphQL API // returns UNKNOWN when the computation hasn't finished, even though the API // call itself is synchronous. Callers should retry after a short delay. PRMergeableStateUnknown PRMergeableState = "UNKNOWN" )
type Params ¶
type Params struct {
// HTTPClient is a pre-configured HTTP client. The caller is responsible for
// configuring the base URL (via BaseURLTransport) and auth (via a transport layer).
HTTPClient *http.Client
// Logger is the structured logger.
Logger *zap.SugaredLogger
// MetricsScope is the metrics scope for instrumentation.
MetricsScope tally.Scope
}
Params holds the dependencies for the GitHub MergeChecker.
Click to show internal directories.
Click to hide internal directories.