Documentation ¶
Index ¶
Constants ¶
View Source
const ( // GitHubPRDurationForChecks is the duration after a PR is created that // checks should be looked at. GitHubPRDurationForChecks = time.Minute * 15 )
Variables ¶
View Source
var ( // GerritConfigs maps Gerrit config names to gerrit.Configs. GerritConfigs = map[config.GerritConfig_Config]*gerrit.Config{ config.GerritConfig_ANDROID: gerrit.ConfigAndroid, config.GerritConfig_ANDROID_NO_CR: gerrit.ConfigAndroidNoCR, config.GerritConfig_ANDROID_NO_CR_NO_PR: gerrit.ConfigAndroidNoCRNoPR, config.GerritConfig_ANGLE: gerrit.ConfigANGLE, config.GerritConfig_CHROMIUM: gerrit.ConfigChromium, config.GerritConfig_CHROMIUM_NO_CQ: gerrit.ConfigChromiumNoCQ, config.GerritConfig_CHROMIUM_BOT_COMMIT: gerrit.ConfigChromiumBotCommit, config.GerritConfig_CHROMIUM_BOT_COMMIT_NO_CQ: gerrit.ConfigChromiumBotCommitNoCQ, config.GerritConfig_CHROMIUM_NO_CR: gerrit.ConfigChromiumNoCR, config.GerritConfig_LIBASSISTANT: gerrit.ConfigLibAssistant, } )
View Source
var ( // Create exponential backoff config to use for Github calls. // // The below example demonstrates what a series of // retries will look like. retry_interval is 10 seconds, // randomization_factor is 0.5, multiplier is 2 and the max_interval is 3 // minutes. For 5 tries the sequence will be (values in seconds) and // assuming we go over the max_elapsed_time on the 5th try: // // attempt# retry_interval randomized_interval // 1 10 [5, 15] // 2 20 [10, 30] // 3 40 [20, 60] // 4 60 [30, 90] // 5 120 backoff.Stop GithubBackOffConfig = &backoff.ExponentialBackOff{ InitialInterval: 10 * time.Second, RandomizationFactor: 0.5, Multiplier: 2, MaxInterval: 3 * time.Minute, MaxElapsedTime: 5 * time.Minute, Clock: backoff.SystemClock, } )
Functions ¶
This section is empty.
Types ¶
type CodeReview ¶
type CodeReview interface { // GetIssueUrlBase returns a base URL which can be used to construct // URLs for individual issues. GetIssueUrlBase() string // GetFullHistoryUrl returns a url that contains all changes uploaded by // the user. GetFullHistoryUrl() string // RetrieveRoll retrieves a RollImpl corresponding to the given issue. // The passed-in AutoRollIssue becomes owned by the RollImpl; it may // modify it, insert it into the RecentRolls DB, etc. // TODO(borenet): Consider storing the rollingTo Revision as part of the // autoroll.AutoRollIssue struct, to avoid passing it around. RetrieveRoll(context.Context, *autoroll.AutoRollIssue, *recent_rolls.RecentRolls, *revision.Revision, *revision.Revision, func(context.Context, RollImpl) error) (RollImpl, error) // UserEmail returns the email address of the authenticated user. UserEmail() string // UserName returns the name of the authenticated user. UserName() string // Client returns the API client used to interact with this CodeReview. Client() interface{} }
CodeReview outlines the autoroller's interaction with a code review system.
func NewGerrit ¶
func NewGerrit(cfg *config.GerritConfig, gerritClient gerrit.GerritInterface, client *http.Client) (CodeReview, error)
NewGerrit returns a gerritCodeReview instance.
func NewGitHub ¶
func NewGitHub(cfg *config.GitHubConfig, githubClient *github.GitHub) (CodeReview, error)
NewGitHub returns a githubCodeReview instance.
type CodeReviewConfig ¶
CodeReviewConfig provides generalized configuration information for a code review service.
type RollImpl ¶
type RollImpl interface { state_machine.RollCLImpl // Insert the roll into the DB. InsertIntoDB(ctx context.Context) error }
RollImpl describes the behavior of an autoroll CL.
Click to show internal directories.
Click to hide internal directories.