autoroll

package
v0.0.0-...-03d6fc4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2019 License: BSD-3-Clause Imports: 14 Imported by: 0

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 (
	ROLL_REV_REGEX = regexp.MustCompile(`^(?:\[\S+\] )?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 RollRev

func RollRev(ctx context.Context, subject string, fullHashFn FullHashFn) (string, string, error)

RollRev returns the commit the given roll is rolling from and to.

Types

type AutoRollIssue

type AutoRollIssue struct {
	Closed            bool               `json:"closed"`
	Comments          []*comment.Comment `json:"comments"`
	Committed         bool               `json:"committed"`
	CommitQueue       bool               `json:"commitQueue"`
	CommitQueueDryRun bool               `json:"cqDryRun"`
	Created           time.Time          `json:"created"`
	Issue             int64              `json:"issue"`
	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 FromGerritChangeInfo

func FromGerritChangeInfo(ctx context.Context, i *gerrit.ChangeInfo, fullHashFn FullHashFn, rollIntoAndroid bool) (*AutoRollIssue, error)

FromGerritChangeInfo returns an AutoRollIssue instance based on the given gerrit.ChangeInfo.

func FromGitHubPullRequest

func FromGitHubPullRequest(ctx context.Context, pullRequest *github_api.PullRequest, g *github.GitHub, fullHashFn FullHashFn) (*AutoRollIssue, error)

FromGitHubPullRequest returns an AutoRollIssue instance based on the given PullRequest.

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) ToGerritChangeInfo

func (a *AutoRollIssue) ToGerritChangeInfo() (*gerrit.ChangeInfo, error)

ToGerritChangeInfo returns a GerritChangeInfo instance based on the AutoRollIssue.

func (*AutoRollIssue) Validate

func (i *AutoRollIssue) Validate() error

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

type FullHashFn

type FullHashFn func(context.Context, string) (string, error)

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 *buildbucket.Build) (*TryResult, error)

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

func TryResultsFromBuildbucket

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

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

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