rerun

package
v0.0.0-...-a70aae3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package rerun handles rerun for a build.

Index

Constants

View Source
const (
	// Baseline priority
	PriorityCulpritVerificationHighConfidence   = 100
	PriorityCulpritVerificationMediumConfidence = 120
	PriorityCulpritVerificationLowConfidence    = 140
	PriorityNthSection                          = 130
	PriorityTestFailure                         = 160

	// Offset priority
	PriorityTreeClosureOffset                    = -70
	PriorityShortBuildOffset                     = -20
	PriorityMediumBuildOffset                    = -10
	PriorityLongBuildOffset                      = 0
	PriorityVeryLongBuildOffset                  = 40
	PriorityAnalysisTriggeredByNonSheriffsOffset = -5
	PriorityAnalysisTriggeredBySheriffsOffset    = -10
	PriorityFlakyBuilderOffset                   = 50
	PriorityAnotherVerificationBuildExistOffset  = 20
	PrioritySuspectInMultipleFailedBuildOffset   = -20
	PrioritySuspectIsRevertedOffset              = 25
	PriorityNthSectionNoSuspectOffset            = -10
	PriorityScheduleOnSameBotOffset              = -15
)

These constants are used for offsetting the buildbucket run priortity The priority ranges from 20 - 255. Lower number means higher priority. See go/luci-bisection-run-prioritization for more details.

Variables

This section is empty.

Functions

func CapPriority

func CapPriority(priority int32) int32

CapPriority caps priority into the range [20..255]

func CreateRerunBuildModel

func CreateRerunBuildModel(c context.Context, build *buildbucketpb.Build, rerunType model.RerunBuildType, suspect *model.Suspect, nsa *model.CompileNthSectionAnalysis, priority int32) (*model.CompileRerunBuild, error)

CreateRerunBuildModel creates a CompileRerunBuild (and SingleRerun) in datastore

func OffsetPriorityBasedOnRunDuration

func OffsetPriorityBasedOnRunDuration(c context.Context, priority int32, cfa *model.CompileFailureAnalysis) (int32, error)

OffsetPriorityBasedOnRunDuration offsets the priority based on run duration. See go/luci-bisection-run-prioritization We based on the duration of the failed build to adjust the priority We favor faster builds than longer builds

func TriggerRerun

func TriggerRerun(c context.Context, options *TriggerOptions) (*buildbucketpb.Build, error)

TriggerRerun triggers a rerun build given the options.

func UpdateCompileRerunStatus

func UpdateCompileRerunStatus(c context.Context, bbid int64) error

UpdateCompileRerunStatus updates the start/end time and status of rerun builds and single rerun (when we received buildbucket pubsub messages)

func UpdateTestRerunStatus

func UpdateTestRerunStatus(ctx context.Context, build *buildbucketpb.Build) error

UpdateTestRerunStatus is called when we receive updates from buildbucket for test rerun build.

Types

type TriggerOptions

type TriggerOptions struct {
	// The builder we should trigger the rerun on. Required.
	Builder *buildbucketpb.BuilderID
	// The gitiles commit for the revision that we want to run the rerun build. Required.
	GitilesCommit *buildbucketpb.GitilesCommit
	// The buildbucket ID that the rerun build should copy the properties
	// and dimension from. Required.
	SampleBuildID int64
	// Extra properties we want the rerun build to have.
	ExtraProperties map[string]any
	// Extra dimensions we want the rerun build to have.
	ExtraDimensions map[string]string
	// Priority of the rerun build.
	Priority int32
}

TriggerOptions contains information how the rerun should be triggered.

Jump to

Keyboard shortcuts

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