roller

package
v0.0.0-...-ded851d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 45 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// AutorollURLPublic is the public autoroll frontend URL.
	AutorollURLPublic = "https://autoroll.skia.org"
	// AutorollURLPrivate is the private autoroll frontend URL.
	AutorollURLPrivate = "https://skia-autoroll.corp.goog"
)

Variables

This section is empty.

Functions

func GetReviewers

func GetReviewers(c *http.Client, metricsName string, reviewersSources, backupReviewers []string) []string

GetReviewers retrieves the current reviewers list. Does not return errors; if retrieval of the reviewers list fails, the provided backup reviewers are returned.

Types

type AutoRoller

type AutoRoller struct {
	// contains filtered or unexported fields
}

AutoRoller is a struct which automates the merging new revisions of one project into another.

func NewAutoRoller

func NewAutoRoller(ctx context.Context, c *config.Config, emailer emailclient.Client, chatBotConfigReader chatbot.ConfigReader, g gerrit.GerritInterface, githubClient *github.GitHub, workdir, serverURL string, gcsClient gcs.GCSClient, client *http.Client, rollerName string, local bool, statusDB status.DB, manualRollDB manual.DB, cleanupDB roller_cleanup.DB) (*AutoRoller, error)

NewAutoRoller returns an AutoRoller instance.

func (*AutoRoller) AddComment

func (r *AutoRoller) AddComment(ctx context.Context, issueNum int64, message, user string, timestamp time.Time) error

AddComment adds a comment to the given roll CL.

func (*AutoRoller) AddHandlers

func (r *AutoRoller) AddHandlers(chi.Router)

AddHandlers implements main.AutoRollerI.

func (*AutoRoller) DeleteLocalData

func (r *AutoRoller) DeleteLocalData(ctx context.Context) error

DeleteLocalData deletes the local data stored on this roller. The caller should exit immediately afterward, otherwise processes which depend on this local data will have problems.

func (*AutoRoller) DryRunSuccessThrottle

func (r *AutoRoller) DryRunSuccessThrottle() *state_machine.Throttler

DryRunSuccessThrottle returns a state_machine.Throttler indicating whether we have successfully completed a dry run too recently.

func (*AutoRoller) FailureThrottle

func (r *AutoRoller) FailureThrottle() *state_machine.Throttler

FailureThrottle returns a state_machine.Throttler indicating that we have failed to roll too many times within a time period.

func (*AutoRoller) GetActiveRoll

func (r *AutoRoller) GetActiveRoll() state_machine.RollCLImpl

GetActiveRoll implements state_machine.AutoRollerImpl.

func (*AutoRoller) GetConfig

func (r *AutoRoller) GetConfig() *config.Config

GetConfig implements state_machine.AutoRollerImpl.

func (*AutoRoller) GetCurrentRev

func (r *AutoRoller) GetCurrentRev() *revision.Revision

GetCurrentRev implements state_machine.AutoRollerImpl.

func (*AutoRoller) GetEmails

func (r *AutoRoller) GetEmails() []string

GetEmails returns the list of email addresses which are copied on rolls.

func (*AutoRoller) GetLastNRollRevs

func (r *AutoRoller) GetLastNRollRevs(n int) []string

GetLastNRollRevs returns the revision IDs for up to N most recent rolls, sorted most recent first.

func (*AutoRoller) GetMode

func (r *AutoRoller) GetMode() string

GetMode implements state_machine.AutoRollerImpl.

func (*AutoRoller) GetNextRollRev

func (r *AutoRoller) GetNextRollRev() *revision.Revision

GetNextRollRev implements state_machine.AutoRollerImpl.

func (*AutoRoller) GetRevisionsInRoll

func (r *AutoRoller) GetRevisionsInRoll(ctx context.Context, roll state_machine.RollCLImpl) []*revision.Revision

GetRevisionsInRoll returns a list of revisions in a roll.

func (*AutoRoller) InRollWindow

func (r *AutoRoller) InRollWindow(t time.Time) bool

InRollWindow implements state_machine.AutoRollerImpl.

func (*AutoRoller) RequestCleanup

func (r *AutoRoller) RequestCleanup(ctx context.Context, reason string) error

RequestCleanup implements state_machine.AutoRollerImpl.

func (*AutoRoller) RolledPast

func (r *AutoRoller) RolledPast(ctx context.Context, rev *revision.Revision) (bool, error)

RolledPast implements state_machine.AutoRollerImpl.

func (*AutoRoller) SafetyThrottle

func (r *AutoRoller) SafetyThrottle() *state_machine.Throttler

SafetyThrottle returns a state_machine.Throttler indicating that we have attempted to upload too many CLs within a time period.

func (*AutoRoller) Start

func (r *AutoRoller) Start(ctx context.Context, tickFrequency time.Duration)

Start initiates the AutoRoller's loop.

func (*AutoRoller) SuccessThrottle

func (r *AutoRoller) SuccessThrottle() *state_machine.Throttler

SuccessThrottle returns a state_machine.Throttler indicating whether we have successfully rolled too many times within a time period.

func (*AutoRoller) Tick

func (r *AutoRoller) Tick(ctx context.Context) error

Tick runs one iteration of the roller.

func (*AutoRoller) UpdateRepos

func (r *AutoRoller) UpdateRepos(ctx context.Context) error

UpdateRepos implements state_machine.AutoRollerImpl.

func (*AutoRoller) UploadNewRoll

func (r *AutoRoller) UploadNewRoll(ctx context.Context, from, to *revision.Revision, dryRun bool) (state_machine.RollCLImpl, error)

UploadNewRoll implements state_machine.AutoRollerImpl.

Jump to

Keyboard shortcuts

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