Documentation ¶
Index ¶
- Constants
- Variables
- func RollRev(ctx context.Context, subject string, fullHashFn FullHashFn) (string, string, error)
- type AutoRollIssue
- func (a *AutoRollIssue) AllTrybotsFinished() bool
- func (a *AutoRollIssue) AllTrybotsSucceeded() bool
- func (a *AutoRollIssue) AtleastOneTrybotFailure() bool
- func (i *AutoRollIssue) Copy() *AutoRollIssue
- func (a *AutoRollIssue) Failed() bool
- func (a *AutoRollIssue) Succeeded() bool
- func (a *AutoRollIssue) ToGerritChangeInfo() (*gerrit.ChangeInfo, error)
- func (i *AutoRollIssue) Validate() error
- type FullHashFn
- type TryResult
Constants ¶
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 ¶
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 ¶
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 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.