github

package
v0.3.0-20260820034428-... Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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 bound to the queue named in params.Config.

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 PRState

type PRState string

PRState represents the state of a pull request.

const (
	// PRStateOpen indicates the PR is open.
	PRStateOpen PRState = "OPEN"
	// PRStateClosed indicates the PR is closed.
	PRStateClosed PRState = "CLOSED"
	// PRStateMerged indicates the PR has been merged.
	PRStateMerged PRState = "MERGED"
)

type Params

type Params struct {
	// Config is the per-queue identity handed to the Factory that built this
	// merge checker.
	Config mergechecker.Config
	// 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.

Jump to

Keyboard shortcuts

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