process

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTrustedAuthors = map[string]bool{
	"renovate[bot]":   true,
	"dependabot[bot]": true,
}

Functions

func DefaultSecurityCheckPatterns

func DefaultSecurityCheckPatterns() []string

DefaultSecurityCheckPatterns returns a fresh copy of the built-in security-check pattern list. Returning a copy guarantees that callers cannot accidentally mutate the package-level default.

func FingerprintPR

func FingerprintPR(ctx context.Context, client *github.Client, owner, repo string, pullReq *github.PullRequest) pr.Fingerprint

FingerprintPR computes the content fingerprint of a PR at its current head: the title-derived change ID always, plus the patch ID from the compare diff (base...head) when GitHub delivers it in full. Fetch errors and truncated diffs leave PatchID empty and never fail the caller -- a fingerprint is corroborating evidence, not a verdict, and pr.Fingerprint falls back to the change ID on its own.

Types

type Processor

type Processor struct {
	Client         *github.Client
	DryRun         bool
	MergeAutoMerge bool
	Login          string
	TrustedAuthors map[string]bool

	// SecurityCheckPatterns is the list of case-insensitive substrings used
	// to flag failing CI checks as security-related (e.g. govulncheck, Trivy,
	// CodeQL). A nil slice falls back to DefaultSecurityCheckPatterns; a
	// non-nil empty slice disables security classification entirely.
	SecurityCheckPatterns []string

	// MergeMaxRetries is the maximum number of merge attempts when the base
	// branch is modified between fetch and merge. Zero uses the default (3).
	MergeMaxRetries int
	// MergeRetryWait is the base wait duration between merge retries.
	// Zero uses the default (10s). Actual wait = base * attempt number.
	MergeRetryWait time.Duration

	// RefreshStale updates the branch of every stale PR from its base
	// (see classifyStale) so CI re-runs against current code. Without it a
	// stale PR is only reported as such. Ignored in dry-run mode.
	RefreshStale bool

	// CircleCI looks behind failing "ci/circleci: <job>" commit statuses to
	// tell an auto-cancelled build from a real failure (see
	// classifyCancelled). Nil disables the lookup and every CircleCI
	// failure is taken at face value.
	CircleCI *circleci.Client
	// RetryCancelled retries every auto-cancelled CircleCI build that ran on
	// a PR's current head so the same commit gets a real verdict. Without it
	// a cancelled PR is only reported as such. Ignored in dry-run mode.
	RetryCancelled bool
	// contains filtered or unexported fields
}

func NewProcessor

func NewProcessor(client *github.Client, dryRun bool, mergeAutoMerge bool, login string, trustedAuthors map[string]bool) *Processor

func (*Processor) ProcessPR

func (p *Processor) ProcessPR(ctx context.Context, info pr.PRInfo, status *pr.PRStatus, idx int)

Jump to

Keyboard shortcuts

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