autoroll

package
v0.0.0-...-d3458be Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: BSD-3-Clause Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	AUTOROLL_STATUS_URL = "https://autoroll.skia.org/json/status"
	POLLER_ROLLS_LIMIT  = 10
	RECENT_ROLLS_LIMIT  = 200

	ROLL_RESULT_DRY_RUN_SUCCESS     = "dry run succeeded"
	ROLL_RESULT_DRY_RUN_FAILURE     = "dry run failed"
	ROLL_RESULT_DRY_RUN_IN_PROGRESS = "dry run in progress"
	ROLL_RESULT_IN_PROGRESS         = "in progress"
	ROLL_RESULT_SUCCESS             = "succeeded"
	ROLL_RESULT_FAILURE             = "failed"

	TRYBOT_CATEGORY_CQ = "cq"

	TRYBOT_STATUS_STARTED   = "STARTED"
	TRYBOT_STATUS_COMPLETED = "COMPLETED"
	TRYBOT_STATUS_SCHEDULED = "SCHEDULED"

	TRYBOT_RESULT_CANCELED = "CANCELED"
	TRYBOT_RESULT_SUCCESS  = "SUCCESS"
	TRYBOT_RESULT_FAILURE  = "FAILURE"
)

Variables

View Source
var (
	// "RESTRICT AUTOMERGE: " is from skbug.com/8998
	ROLL_REV_REGEX = regexp.MustCompile(`^(?:(?:\[\S+\] )|(?:RESTRICT AUTOMERGE: ))?Roll \S+(?:\s+\S+)* (?:from )?(\S+)(?:(?:\.\.)|(?: to ))(\S+)(?: \(\d+ commit.*\))?\.?`)

	OPEN_ROLL_VALID_RESULTS = []string{
		ROLL_RESULT_DRY_RUN_FAILURE,
		ROLL_RESULT_DRY_RUN_IN_PROGRESS,
		ROLL_RESULT_DRY_RUN_SUCCESS,
		ROLL_RESULT_IN_PROGRESS,
	}

	DRY_RUN_RESULTS = []string{
		ROLL_RESULT_DRY_RUN_FAILURE,
		ROLL_RESULT_DRY_RUN_IN_PROGRESS,
		ROLL_RESULT_DRY_RUN_SUCCESS,
	}

	FAILURE_RESULTS = []string{
		ROLL_RESULT_DRY_RUN_FAILURE,
		ROLL_RESULT_FAILURE,
	}

	SUCCESS_RESULTS = []string{
		ROLL_RESULT_DRY_RUN_SUCCESS,
		ROLL_RESULT_SUCCESS,
	}
)

Functions

func RollResult

func RollResult(roll *AutoRollIssue) string

RollResult derives a result string for the roll.

Types

type AutoRollIssue

type AutoRollIssue struct {
	Attempt        int                `json:"attempts"`
	AttemptStart   time.Time          `json:"attemptStart"`
	Closed         bool               `json:"closed"`
	Comments       []*comment.Comment `json:"comments"`
	Committed      bool               `json:"committed"`
	Created        time.Time          `json:"created"`
	IsDryRun       bool               `json:"isDryRun"`
	DryRunFinished bool               `json:"dryRunFinished"`
	DryRunSuccess  bool               `json:"dryRunSuccess"`
	CqFinished     bool               `json:"cqFinished"`
	CqSuccess      bool               `json:"cqSuccess"`
	Issue          int64              `json:"issue"`
	Manual         bool               `json:"manual"`
	Modified       time.Time          `json:"modified"`
	Patchsets      []int64            `json:"patchSets"`
	Result         string             `json:"result"`
	RollingFrom    string             `json:"rollingFrom"`
	RollingTo      string             `json:"rollingTo"`
	Subject        string             `json:"subject"`
	TryResults     []*TryResult       `json:"tryResults"`
}

AutoRollIssue is a struct containing the information we care about for AutoRoll CLs.

func (*AutoRollIssue) AllTrybotsFinished

func (a *AutoRollIssue) AllTrybotsFinished() bool

AllTrybotsFinished returns true iff all CQ trybots have finished for the given issue.

func (*AutoRollIssue) AllTrybotsSucceeded

func (a *AutoRollIssue) AllTrybotsSucceeded() bool

AllTrybotsSucceeded returns true iff all CQ trybots have succeeded for the given issue. Note that some trybots may fail and be retried, in which case a successful retry counts as a success.

func (*AutoRollIssue) AtleastOneTrybotFailure

func (a *AutoRollIssue) AtleastOneTrybotFailure() bool

AtleastOneTrybotFailure returns true iff there is atleast one trybot that has failed for the given issue.

func (*AutoRollIssue) Copy

func (i *AutoRollIssue) Copy() *AutoRollIssue

Copy returns a copy of the AutoRollIssue.

func (*AutoRollIssue) Failed

func (a *AutoRollIssue) Failed() bool

Failed returns true iff the roll failed (including dry run failure).

func (*AutoRollIssue) Succeeded

func (a *AutoRollIssue) Succeeded() bool

Succeeded returns true iff the roll succeeded (including dry run success).

func (*AutoRollIssue) Validate

func (i *AutoRollIssue) Validate() error

Validate returns an error iff there is some problem with the issue.

type TryResult

type TryResult struct {
	Builder  string    `json:"builder"`
	Category string    `json:"category"`
	Created  time.Time `json:"created_ts"`
	Result   string    `json:"result"`
	Status   string    `json:"status"`
	Url      string    `json:"url"`
}

TryResult is a struct which contains trybot result details.

func TryResultFromBuildbucket

func TryResultFromBuildbucket(b *buildbucketpb.Build) (*TryResult, error)

TryResultFromBuildbucket returns a new TryResult based on a buildbucketpb.Build.

func TryResultsFromBuildbucket

func TryResultsFromBuildbucket(tries []*buildbucketpb.Build) ([]*TryResult, error)

TryResultsFromBuildbucket returns a slice of TryResults based on a slice of buildbucket.Builds.

func TryResultsFromGithubChecks

func TryResultsFromGithubChecks(checks []*github.Check, checksWaitFor []string) []*TryResult

func (*TryResult) Copy

func (t *TryResult) Copy() *TryResult

Copy returns a copy of the TryResult.

func (TryResult) Failed

func (t TryResult) Failed() bool

Failed returns true iff the trybot completed and failed.

func (TryResult) Finished

func (t TryResult) Finished() bool

Finished returns true iff the trybot is done running.

func (TryResult) Succeeded

func (t TryResult) Succeeded() bool

Succeeded returns true iff the trybot completed successfully.

Jump to

Keyboard shortcuts

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