change

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package change holds the rules that decide what a change to a pull request calls for: a follow-up, a triage round, a board move.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Approved

func Approved(f pr.Facts) bool

Approved also covers repositories without required reviews, where reviewDecision is null.

func ChecksPass

func ChecksPass(f pr.Facts) bool

ChecksPass treats a repository without checks as passing.

func FailingChecks

func FailingChecks(f pr.Facts, handledHead string, ignore []string) []string

FailingChecks returns the checks that failed on the head of my pull request once every check has finished, unless a triage round already covered that head. Ignored checks neither fire a round nor hold it back.

func HeadMoved

func HeadMoved(commits []pr.Commit, headOid, reviewedOid string) bool

HeadMoved reports whether the head has commits after the reviewed one beyond merges from the base branch. When the reviewed commit is no longer in the listed history (force push, or more than the listed commits since), every listed commit counts.

func LastReview

func LastReview(reviews []pr.Review, viewer string) (pr.Review, bool)

LastReview is my newest submitted review. PENDING has no submittedAt. DISMISSED counts: repositories that dismiss stale reviews on push turn my last real review into DISMISSED exactly when the PR changed.

func ReviewsToAddress

func ReviewsToAddress(in AddressInput) (reviewers []string, fingerprint string)

ReviewsToAddress returns the reviewers whose reviews or open threads a triage round on my pull request should cover, and the fingerprint to record once it starts. Without a previous round, reviews count only on the current head (older ones predate a push, which is how I usually answer by hand), while an open thread whose last word is someone else's always counts.

func Untrusted

func Untrusted(f pr.Facts, owners, authors []string) string

Untrusted says why an automated round may not run on f, or "".

Types

type AddressInput

type AddressInput struct {
	PR     pr.Facts
	Viewer string
	// Handled is the submittedAt of the newest review a previous triage
	// round covered; zero when there was none.
	Handled time.Time
	// SkipReviewers are logins whose reviews never start a triage round.
	SkipReviewers []string
}

type RecordedReview

type RecordedReview struct {
	Head string
	At   time.Time
}

RecordedReview is the head a turn's record covered when it published a verdict, and when it was recorded. GitHub moves a review's commit to later pushes, so this head is the baseline for the review it recorded.

type ReviewerAction

type ReviewerAction int
const (
	ReviewerNothing ReviewerAction = iota
	ReviewerComplete
	ReviewerFollowup
)

type ReviewerDecision

type ReviewerDecision struct {
	Action ReviewerAction
	Reason string
	// Fingerprint identifies what a follow-up covers: the submittedAt of my
	// last review and the head, so a round that published nothing still lets
	// the next push start another, marked when a re-request started it. On
	// ReviewerNothing it is set only to upgrade a fingerprint stored without
	// the head.
	Fingerprint  string
	LastReviewAt time.Time
}

func Reviewer

func Reviewer(in ReviewerInput) ReviewerDecision

type ReviewerInput

type ReviewerInput struct {
	PR              pr.Facts
	Viewer          string
	WorkspaceStatus string
	// CompletedStatus is the board's completed column; empty when it has none.
	CompletedStatus string
	// TrustedOwners are the repository owners automated rounds may run for.
	TrustedOwners []string
	// TrustedAuthors are logins that pass the author association check.
	TrustedAuthors  []string
	LastFingerprint string
	// Recorded is the loop's record of my last verdict; zero when none.
	Recorded RecordedReview
}

Jump to

Keyboard shortcuts

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