model

package
v0.0.0-...-a8f2654 Latest Latest
Warning

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

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

Documentation

Overview

Package model contains the datastore model for LUCI Bisection.

Index

Constants

View Source
const (
	ChangeType_ADD    = "add"
	ChangeType_MODIFY = "modify"
	ChangeType_COPY   = "copy"
	ChangeType_RENAME = "rename"
	ChangeType_DELETE = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionDetails

type ActionDetails struct {
	// URL to the code review of the revert.
	RevertURL string `gae:"revert_url"`

	// Whether LUCI Bisection has created the revert
	IsRevertCreated bool `gae:"is_revert_created"`

	// Time when the revert was created
	RevertCreateTime time.Time `gae:"revert_create_time"`

	// Whether LUCI Bisection has committed the revert
	IsRevertCommitted bool `gae:"is_revert_committed"`

	// Time when the revert for the suspect was bot-committed
	RevertCommitTime time.Time `gae:"revert_commit_time"`

	// Whether LUCI Bisection has added a supporting comment to an existing revert
	HasSupportRevertComment bool `gae:"has_support_revert_comment"`

	// Time when LUCI Bisection added a supporting comment to an existing revert
	SupportRevertCommentTime time.Time `gae:"support_revert_comment_time"`

	// Whether LUCI Bisection has added a comment to the culprit CL
	HasCulpritComment bool `gae:"has_culprit_comment"`

	// Time when LUCI Bisection commented on the culprit
	CulpritCommentTime time.Time `gae:"culprit_comment_time"`

	// Optional explanation for when processing the culprit results in no action.
	InactionReason pb.CulpritInactionReason `gae:"inaction_reason"`

	// HasTakenActions indicates if the all actions for culprit
	// (e.g. comment, revert...) have been taken.
	// This field is only valid if a culprit is confirmed by culprit verification.
	// If there is no action to be taken (e.g. if actions are disabled),
	// then this field is set to true.
	HasTakenActions bool `gae:"has_taken_actions"`
}

ActionDetails encapsulate the details of actions performed by LUCI Bisection, e.g. creating a revert, commenting on a culprit, etc.

type BundleMetaData

type BundleMetaData struct {
	SheriffRotations []string
}

type ChangeLog

type ChangeLog struct {
	Commit         string          `json:"commit"`
	Tree           string          `json:"tree"`
	Parents        []string        `json:"parents"`
	Author         ChangeLogActor  `json:"author"`
	Committer      ChangeLogActor  `json:"committer"`
	Message        string          `json:"message"`
	ChangeLogDiffs []ChangeLogDiff `json:"tree_diff"`
}

ChangeLog represents the changes of a revision

func (*ChangeLog) GetCommitTime

func (cl *ChangeLog) GetCommitTime() (*timestamppb.Timestamp, error)

func (*ChangeLog) GetReviewTitle

func (cl *ChangeLog) GetReviewTitle() (string, error)

GetReviewTitle returns the review title from the changelog.

func (*ChangeLog) GetReviewUrl

func (cl *ChangeLog) GetReviewUrl() (string, error)

GetReviewUrl returns the review URL of the changelog.

type ChangeLogActor

type ChangeLogActor struct {
	Name  string `json:"name"`
	Email string `json:"email"`
	Time  string `json:"time"`
}

type ChangeLogDiff

type ChangeLogDiff struct {
	Type    ChangeType `json:"type"`
	OldID   string     `json:"old_id"`
	OldMode int        `json:"old_mode"`
	OldPath string     `json:"old_path"`
	NewID   string     `json:"new_id"`
	NewMode int        `json:"new_mode"`
	NewPath string     `json:"new_path"`
}

type ChangeLogResponse

type ChangeLogResponse struct {
	Log  []*ChangeLog `json:"log"`
	Next string       `json:"next"` // From next revision
}

ChangeLogResponse represents the response from gitiles for changelog.

type ChangeType

type ChangeType string

type CompileFailure

type CompileFailure struct {
	// Id is the build Id of the compile failure
	Id int64 `gae:"$id"`
	// The key to LuciFailedBuild that the failure belongs to.
	Build *datastore.Key `gae:"$parent"`

	// The list of output targets that failed to compile.
	// This is to speed up the compilation process, as we only want to rerun failed targets.
	OutputTargets []string `gae:"output_targets"`

	// The list of source files resulting in compile failures
	FailedFiles []string `gae:"failed_files"`

	// Compile rule, e.g. ACTION, CXX, etc.
	// For chromium builds, it can be found in json.output[ninja_info] log of
	// compile step.
	// For chromeos builds, it can be found in an output property 'compile_failure'
	// of the build.
	Rule string `gae:"rule"`

	// Only for CC and CXX rules
	// These are the source files that this compile failure uses as input
	Dependencies []string `gae:"dependencies"`

	// Key to the CompileFailure that this failure merges into.
	// If this exists, no analysis on current failure, instead use the results
	// of merged_failure.
	MergedFailureKey *datastore.Key `gae:"merged_failure_key"`
}

CompileFailure represents a compile failure in one or more targets.

type CompileFailureAnalysis

type CompileFailureAnalysis struct {
	Id int64 `gae:"$id"`
	// Key to the CompileFailure that this analysis analyses.
	CompileFailure *datastore.Key `gae:"compile_failure"`
	// Time when the analysis is created.
	CreateTime time.Time `gae:"create_time"`
	// Time when the analysis starts to run.
	StartTime time.Time `gae:"start_time"`
	// Time when the analysis ends, or canceled.
	EndTime time.Time `gae:"end_time"`
	// Status of the analysis
	Status pb.AnalysisStatus `gae:"status"`
	// Run status of the analysis
	RunStatus pb.AnalysisRunStatus `gae:"run_status"`
	// Id of the build in which the compile failures occurred the first time in
	// a sequence of consecutive failed builds.
	FirstFailedBuildId int64 `gae:"first_failed_build_id"`
	// Id of the latest build in which the failures did not happen.
	LastPassedBuildId int64 `gae:"last_passed_build_id"`
	// Initial regression range to find the culprit
	InitialRegressionRange *pb.RegressionRange `gae:"initial_regression_range"`
	// Key to the heuristic suspects that was verified by Culprit verification
	// In some rare cases, there are more than 1 culprit for the regression range.
	VerifiedCulprits []*datastore.Key `gae:"verified_culprits"`
	// Indicates whether the analysis should be cancelled or not,
	// such as in the situation where the corresponding builder start passing again
	ShouldCancel bool `gae:"should_cancel"`
	// Is this analysis for a tree closer failure.
	// If it is, all reruns of this analysis should have higher priority.
	IsTreeCloser bool `gae:"is_tree_closer"`
}

CompileFailureAnalysis is the analysis for CompileFailure. This stores information that is needed during the analysis, and also some metadata for the analysis.

func (*CompileFailureAnalysis) HasEnded

func (cfa *CompileFailureAnalysis) HasEnded() bool

type CompileFailureEdge

type CompileFailureEdge struct {
	Rule         string // Rule is like CXX, CC...
	OutputNodes  []string
	Dependencies []string
}

CompileFailureEdge represents a failed edge in ninja failure log

type CompileFailureSignal

type CompileFailureSignal struct {
	Nodes []string
	Edges []*CompileFailureEdge
	// A map of {<file_path>:[lines]} represents failure positions in source file
	Files map[string][]int
	// A map of {<dependency_file_name>:[<list of dependencies>]}. Used to improve
	// the speed when we do dependency analysis
	DependencyMap map[string][]string
}

Compile Failure Signal represents signal extracted from compile failure log.

func (*CompileFailureSignal) AddFilePath

func (c *CompileFailureSignal) AddFilePath(filePath string)

func (*CompileFailureSignal) AddLine

func (c *CompileFailureSignal) AddLine(filePath string, line int)

func (*CompileFailureSignal) CalculateDependencyMap

func (cfs *CompileFailureSignal) CalculateDependencyMap(c context.Context)

Put all the dependencies in a map with the form {<dependency_file_name>:[<list of dependencies>]}

type CompileHeuristicAnalysis

type CompileHeuristicAnalysis struct {
	Id int64 `gae:"$id"`
	// Key to the parent CompileFailureAnalysis
	ParentAnalysis *datastore.Key `gae:"$parent"`
	// Time when the analysis starts to run.
	StartTime time.Time `gae:"start_time"`
	// Time when the analysis ends, or canceled
	EndTime time.Time `gae:"end_time"`
	// Status of the analysis
	Status pb.AnalysisStatus `gae:"status"`
	// Run status of the analysis
	RunStatus pb.AnalysisRunStatus `gae:"run_status"`
}

CompileHeuristicAnalysis is heuristic analysis for compile failures.

func (*CompileHeuristicAnalysis) HasEnded

func (ha *CompileHeuristicAnalysis) HasEnded() bool

type CompileLogs

type CompileLogs struct {
	NinjaLog  *NinjaLog
	StdOutLog string
}

type CompileNthSectionAnalysis

type CompileNthSectionAnalysis struct {
	Id int64 `gae:"$id"`
	// Key to the parent CompileFailureAnalysis
	ParentAnalysis *datastore.Key `gae:"$parent"`
	// Time when the analysis starts to run.
	StartTime time.Time `gae:"start_time"`
	// Time when the analysis ends, or canceled
	EndTime time.Time `gae:"end_time"`
	// Status of the analysis
	Status pb.AnalysisStatus `gae:"status"`
	// Run status of the analysis
	RunStatus pb.AnalysisRunStatus `gae:"run_status"`

	// When storing protobuf message, datastore will compress the data if it is big
	// https://source.corp.google.com/chops_infra_internal/infra/go/src/go.chromium.org/luci/gae/service/datastore/protos.go;l=88
	// We can also declare zstd compression here, but there seems to be a bug where
	// the message size is 0
	BlameList *pb.BlameList `gae:"blame_list"`

	// Suspect is the result of nthsection analysis.
	// Note: We call it "suspect" because it has not been verified (by culprit verification component)
	Suspect *datastore.Key `gae:"suspect"`
}

CompileNthSectionAnalysis is nth-section analysis for compile failures.

func (*CompileNthSectionAnalysis) HasEnded

func (nsa *CompileNthSectionAnalysis) HasEnded() bool

type CompileRerunBuild

type CompileRerunBuild struct {
	// Id is the buildbucket Id for the rerun build.
	Id int64 `gae:"$id"`
	// LUCI build data
	LuciBuild
	// contains filtered or unexported fields
}

CompileRerunBuild is one rerun build for CompileFailureAnalysis. The rerun build may be for nth-section analysis or for culprit verification.

type HeuristicAnalysisResult

type HeuristicAnalysisResult struct {
	// A slice of possible culprit, sorted by score descendingly
	Items []*HeuristicAnalysisResultItem
}

func (*HeuristicAnalysisResult) AddItem

func (r *HeuristicAnalysisResult) AddItem(commit string, reviewUrl string, reviewTitle string, justification *SuspectJustification)

AddItem adds a suspect to HeuristicAnalysisResult.

func (*HeuristicAnalysisResult) Sort

func (r *HeuristicAnalysisResult) Sort()

Sort items descendingly based on score (CLs with higher possibility to be culprit will come first).

type HeuristicAnalysisResultItem

type HeuristicAnalysisResultItem struct {
	Commit        string
	ReviewUrl     string
	ReviewTitle   string
	Justification *SuspectJustification
}

type JustificationType

type JustificationType int64
const (
	JustificationType_UNSPECIFIED JustificationType = 0
	// If a commit touches a file in the failure log
	JustificationType_FAILURELOG JustificationType = 1
	// If a commit touches a file in the dependency
	JustificationType_DEPENDENCY JustificationType = 2
)

type LUCIBuild

type LUCIBuild struct {
	BuildID       int64                        `gae:"build_id"`
	Project       string                       `gae:"project"`
	Bucket        string                       `gae:"bucket"`
	Builder       string                       `gae:"builder"`
	BuildNumber   int                          `gae:"build_number"`
	GitilesCommit *buildbucketpb.GitilesCommit `gae:"gitiles_commit"`
	CreateTime    time.Time                    `gae:"create_time"`
	EndTime       time.Time                    `gae:"end_time"`
	StartTime     time.Time                    `gae:"start_time"`
	Status        buildbucketpb.Status         `gae:"status"`
}

type LuciBuild

type LuciBuild struct {
	BuildId     int64  `gae:"build_id"`
	Project     string `gae:"project"`
	Bucket      string `gae:"bucket"`
	Builder     string `gae:"builder"`
	BuildNumber int    `gae:"build_number"`
	buildbucketpb.GitilesCommit
	CreateTime time.Time            `gae:"create_time"`
	EndTime    time.Time            `gae:"end_time"`
	StartTime  time.Time            `gae:"start_time"`
	Status     buildbucketpb.Status `gae:"status"`
}

LuciBuild represents one LUCI build. Deprecated. Please use LUCIBuild model instead. It is kept here because some old code is still using it.

type LuciFailedBuild

type LuciFailedBuild struct {
	// Id is the build Id
	Id int64 `gae:"$id"`
	LuciBuild
	// Obsolete field - specify BuildFailureType instead
	FailureType string `gae:"failure_type"`
	// Failure type for the build
	BuildFailureType pb.BuildFailureType `gae:"build_failure_type"`
	// The platform of the failure
	Platform Platform `gae:"platform"`
	// The sheriff rotations that watch the builder.
	SheriffRotations []string `gae:"sheriff_rotations"`
}

type NinjaLog

type NinjaLog struct {
	Failures []*NinjaLogFailure `json:"failures"`
}

type NinjaLogFailure

type NinjaLogFailure struct {
	Dependencies []string `json:"dependencies"`
	Output       string   `json:"output"`
	OutputNodes  []string `json:"output_nodes"`
	Rule         string   `json:"rule"`
}

type Platform

type Platform string
const (
	// The build didn't specified a platform
	PlatformUnspecified Platform = "unspecified"
	// Platform is not win, mac or linux
	PlatformUnknown Platform = "unknown"
	PlatformWindows Platform = "win"
	PlatformMac     Platform = "mac"
	PlatformLinux   Platform = "linux"
)

func PlatformFromOS

func PlatformFromOS(ctx context.Context, os string) Platform

type RerunBuildType

type RerunBuildType string
const (
	RerunBuildType_CulpritVerification RerunBuildType = "Culprit Verification"
	RerunBuildType_NthSection          RerunBuildType = "NthSection"
)

type RerunSingleTestResult

type RerunSingleTestResult struct {
	// Key to TestFailure model.
	TestFailureKey *datastore.Key `gae:"test_failure_key"`

	// TODO (nqmtuan): Consider breaking this to status level (e.g.
	// unexpected pass count). But for now, keeping the total expected
	// and unexpected count may be enough, as we only support bisection
	// from expected to unexpected.
	// We use number count instead of status to open for possibility
	// to support flakiness bisection in the future (where a test may need
	// to be rerun multiple times to get the flakiness level).
	// The number of expected results. Skipped results are not counted.
	ExpectedCount int64 `gae:"expected_count"`
	// The number of unexpected results. Skipped results are not counted.
	UnexpectedCount int64 `gae:"unexpected_count"`
}

RerunSingleTestResult is the result for one TestFailure.

type RerunTestResults

type RerunTestResults struct {
	// IsFinalized indicates whether the results have been finalized and
	// is ready to be consumed.
	IsFinalized bool                    `gae:"is_finalized"`
	Results     []RerunSingleTestResult `gae:"results"`
}

RerunTestResults captures test results of TestSingleRerun.

type SingleRerun

type SingleRerun struct {
	Id int64 `gae:"$id"`
	// Key to the parent CompileRerunBuild
	RerunBuild *datastore.Key `gae:"rerun_build"`
	// Type for the rerun build
	// Either culprit verification or nth section run.
	Type RerunBuildType `gae:"rerun_type"`
	// Key to the CompileFailureAnalysis of this SingleRerun
	// This is mainly used for getting all reruns for an analysis,
	// for the purpose of nth-section analysis
	Analysis *datastore.Key `gae:"analysis"`
	// The commit that this SingleRerun runs on
	buildbucketpb.GitilesCommit
	// Time when the rerun was created
	CreateTime time.Time `gae:"create_time"`
	// Time when the rerun starts.
	StartTime time.Time `gae:"start_time"`
	// Time when the rerun ends.
	EndTime time.Time `gae:"end_time"`
	// Status of the rerun
	Status pb.RerunStatus
	// Key to the Suspect, if this is for culprit verification
	Suspect *datastore.Key `gae:"suspect"`
	// Key to NthSectionAnalysis, if this is for nthsection
	NthSectionAnalysis *datastore.Key `gae:"nthsection_analysis"`
	// Priority of this run
	Priority int32 `gae:"priority"`
	// The dimensions of the rerun build.
	Dimensions *pb.Dimensions `gae:"dimensions"`
}

SingleRerun represents one rerun for a particular compile/test failures for a particular commit. Initially, we wanted to trigger multiple reruns for different commits in the same build, but it is not possible. We can only trigger one rerun per rerun build, i.e. the relationship between single rerun : rerun build is 1:1.

func (*SingleRerun) HasEnded

func (rerun *SingleRerun) HasEnded() bool

type Suspect

type Suspect struct {
	Id int64 `gae:"$id"`

	// Type of the suspect, either heuristic or nthsection
	Type SuspectType `gae:"type"`

	// Key to the CompileFailureHeuristicAnalysis or CompileFailureNthSectionAnalysis
	// or TestNthSectionAnalysis that results in this suspect
	ParentAnalysis *datastore.Key `gae:"$parent"`

	// The commit of the suspect
	buildbucketpb.GitilesCommit

	// The Url where the suspect was reviewed
	ReviewUrl string `gae:"review_url"`

	// Title of the review for the suspect
	ReviewTitle string `gae:"review_title"`

	// Score is an integer representing the how confident we believe the suspect
	// is indeed the culprit.
	// A higher score means a stronger signal that the suspect is responsible for
	// a failure.
	// Only applies to Heuristic suspect
	Score int `gae:"score"`

	// A short, human-readable string that concisely describes a fact about the
	// suspect. e.g. 'add a/b/x.cc'
	// Only applies to Heuristic suspect
	Justification string `gae:"justification,noindex"`

	// Whether if a suspect has been verified
	VerificationStatus SuspectVerificationStatus `gae:"verification_status"`

	// Key to the CompileRerunBuild or TestSingleRerun of the suspect, for culprit verification purpose.
	SuspectRerunBuild *datastore.Key `gae:"suspect_rerun_build"`

	// Key to the CompileRerunBuild or TestSingleRerun of the parent commit of the suspect, for culprit verification purpose.
	ParentRerunBuild *datastore.Key `gae:"parent_rerun_build"`

	// Details of actions performed by LUCI Bisection for this suspect.
	ActionDetails

	// Type of the suspect.
	AnalysisType pb.AnalysisType `gae:"analysis_type"`

	// The time that this suspect was committed.
	// For now, it is only populated for test failure suspects.
	CommitTime time.Time `gae:"commit_time"`
	// contains filtered or unexported fields
}

Suspect is the suspect of heuristic analysis or nthsection.

type SuspectJustification

type SuspectJustification struct {
	IsNonBlamable bool
	Items         []*SuspectJustificationItem
}

SuspectJustification represents the heuristic analysis of a CL. It how likely the suspect is the real culprit and also the reason for suspecting.

func (*SuspectJustification) AddItem

func (justification *SuspectJustification) AddItem(score int, filePath string, reason string, justificationType JustificationType)

func (*SuspectJustification) GetReasons

func (justification *SuspectJustification) GetReasons() string

func (*SuspectJustification) GetScore

func (justification *SuspectJustification) GetScore() int

func (*SuspectJustification) Sort

func (justification *SuspectJustification) Sort()

Sort sorts the items descendingly based on score

type SuspectJustificationItem

type SuspectJustificationItem struct {
	Score    int
	FilePath string
	Reason   string
	Type     JustificationType
}

SuspectJustificationItem represents one item of SuspectJustification

type SuspectType

type SuspectType string
const (
	SuspectType_Heuristic  SuspectType = "Heuristic"
	SuspectType_NthSection SuspectType = "NthSection"
)

type SuspectVerificationStatus

type SuspectVerificationStatus string
const (
	// The suspect is not verified and no verification is happening
	SuspectVerificationStatus_Unverified SuspectVerificationStatus = "Unverified"
	// The suspect is scheduled to be verified (via a task queue)
	SuspectVerificationStatus_VerificationScheduled SuspectVerificationStatus = "Verification Scheduled"
	// The suspect is under verification
	SuspectVerificationStatus_UnderVerification SuspectVerificationStatus = "Under Verification"
	// The suspect is confirmed to be culprit
	SuspectVerificationStatus_ConfirmedCulprit SuspectVerificationStatus = "Confirmed Culprit"
	// This is a false positive - the suspect is not the culprit
	SuspectVerificationStatus_Vindicated SuspectVerificationStatus = "Vindicated"
	// Some error happened during verification
	SuspectVerificationStatus_VerificationError SuspectVerificationStatus = "Verification Error"
	// The verification is canceled
	SuspectVerificationStatus_Canceled SuspectVerificationStatus = "Canceled"
)

func SuspectStatus

func SuspectStatus(rerunStatus pb.RerunStatus, parentRerunStatus pb.RerunStatus) SuspectVerificationStatus

type TestFailure

type TestFailure struct {
	ID int64 `gae:"$id"`
	// The LUCI project of this test variant.
	Project string `gae:"project"`
	// Test ID of the test variant.
	TestID string `gae:"test_id"`
	// Variant hash of the test variant.
	VariantHash string `gae:"variant_hash"`
	// The variant of the test.
	Variant *pb.Variant `gae:"variant"`
	// The name of the test (used in recipe). Note that it is different
	// from TestID.
	TestName string `gae:"test_name"`
	// The name of the test suite that this test variant belongs to.
	// For chromium, this information can be derived from Variant field.
	TestSuiteName string `gae:"test_suite_name"`
	// Hash of the ref to identify the branch in the source control.
	RefHash string `gae:"ref_hash"`
	// The LUCI bucket for the builder of this test failure.
	Bucket string `gae:"bucket"`
	// The name for the builder of this test failure.
	Builder string `gae:"builder"`
	// The branch where this failure happens.
	Ref *pb.SourceRef `gae:"ref"`
	// Start commit position of the regression range exclusive.
	RegressionStartPosition int64 `gae:"regression_start_position"`
	// End commit position of the regression range inclusive.
	RegressionEndPosition int64 `gae:"regression_end_position"`
	// The unexpected test result rate at regression_start_position, between 0 and 1 inclusive.
	StartPositionFailureRate float64 `gae:"start_position_failure_rate"`
	// The unexpected test result rate at regression_end_position, between 0 and 1 inclusive.
	EndPositionFailureRate float64 `gae:"end_position_failure_rate"`
	// When run multiple test variants in a bisection build, the bisection path
	// follows the test variant of the primary test failure.
	IsPrimary bool
	// IsDiverged is true when the bisection path of this test failure diverges from
	// the primary test failure. This suggests that this test failure has a different root cause.
	// We will not attempt to re-bisect this test failure.
	IsDiverged bool `gae:"is_diverged"`
	// Key to the TestFailureAnalysis that analyses this TestFailure.
	AnalysisKey *datastore.Key `gae:"analysis_key"`
	// RedundancyScore of the test failure, between 0 and 1, larger score means more redundant.
	// Only set for primary test failure.
	RedundancyScore float64 `gae:"redundancy_score"`
	// The time when the failure starts, truncated into hours.
	StartHour time.Time `gae:"start_hour"`
	// The time when we get last got the failure result, truncated into hours.
	EndHour time.Time `gae:"end_hour"`
}

TestFailure represents a failure on a test variant.

type TestFailureAnalysis

type TestFailureAnalysis struct {
	ID int64 `gae:"$id"`
	// The LUCI project of the test variants this analysis analyses.
	Project string `gae:"project"`
	// The LUCI bucket for the builder that this analysis analyses.
	Bucket string `gae:"bucket"`
	// The name for the builder that this analysis analyses.
	Builder string `gae:"builder"`
	// Key to the primary TestFailure entity that this analysis analyses.
	TestFailure *datastore.Key `gae:"test_failure"`
	// Time when the entity is first created.
	CreateTime time.Time `gae:"create_time"`
	// Time when the analysis starts to run.
	StartTime time.Time `gae:"start_time"`
	// Time when the analysis ends, or canceled.
	EndTime time.Time `gae:"end_time"`
	// Status of the analysis
	Status pb.AnalysisStatus `gae:"status"`
	// Run status of the analysis
	RunStatus pb.AnalysisRunStatus `gae:"run_status"`
	// Key to the suspect that was verified by Culprit verification
	VerifiedCulpritKey *datastore.Key `gae:"verified_culprit_key"`
	// Priority of this run.
	Priority int32 `gae:"priority"`
	// The start commit hash (exclusive) of the regression range that this analysis analyses.
	// It corresponds to the RegressionStartPosition.
	StartCommitHash string `gae:"start_commit_hash"`
	// The end commit hash (inclusive) of the regression range that this analysis analyses.
	// It corresponds to the RegressionEndPosition.
	EndCommitHash string `gae:"end_commit_hash"`
	// An example Buildbucket ID in which the test failed.
	FailedBuildID int64 `gae:"failed_build_id"`
	// The sheriff rotations that watch the builder.
	SheriffRotations []string `gae:"sheriff_rotations"`
}

TestFailureAnalysis is the analysis for test failure. This stores information that is needed during the analysis, and also some metadata for the analysis.

func (*TestFailureAnalysis) HasEnded

func (tfa *TestFailureAnalysis) HasEnded() bool

func (*TestFailureAnalysis) HasStarted

func (tfa *TestFailureAnalysis) HasStarted() bool

type TestFailureBundle

type TestFailureBundle struct {

	// Contains metadata that is common for this bundle that
	// is not suitable to put in TestFailure model.
	Metadata *BundleMetaData
	// contains filtered or unexported fields
}

TestFailureBundle contains TestFailure models that will be bisected together.

func (*TestFailureBundle) Add

func (tfb *TestFailureBundle) Add(testFailures []*TestFailure) error

func (*TestFailureBundle) All

func (tfb *TestFailureBundle) All() []*TestFailure

All return all test failures for the bundle.

func (*TestFailureBundle) NonDiverged

func (tfb *TestFailureBundle) NonDiverged() []*TestFailure

NonDiverged returns all non-diverged test failures for the bundle.

func (*TestFailureBundle) Others

func (tfb *TestFailureBundle) Others() []*TestFailure

Others returns other test failures for the bundle.

func (*TestFailureBundle) Primary

func (tfb *TestFailureBundle) Primary() *TestFailure

Primary returns the primary test failure for the bundle.

type TestNthSectionAnalysis

type TestNthSectionAnalysis struct {
	ID int64 `gae:"$id"`
	// Key to the parent TestFailureAnalysis.
	ParentAnalysisKey *datastore.Key `gae:"parent_analysis_key"`
	// Time when the analysis starts to run.
	StartTime time.Time `gae:"start_time"`
	// Time when the analysis ends, or canceled.
	EndTime time.Time `gae:"end_time"`
	// Status of the analysis.
	Status pb.AnalysisStatus `gae:"status"`
	// Run status of the analysis.
	RunStatus pb.AnalysisRunStatus `gae:"run_status"`

	// When storing protobuf message, datastore will compress the data if it is big
	// https://source.corp.google.com/chops_infra_internal/infra/go/src/go.chromium.org/luci/gae/service/datastore/protos.go;l=88
	BlameList *pb.BlameList `gae:"blame_list"`

	// Culprit is the result of nthsection analysis.
	// Nthsection analysis follows the path of the primary test failure,
	// so the culprit here is the culprit of the primary test failure.
	CulpritKey *datastore.Key `gae:"culprit"`
}

TestNthSectionAnalysis is nth-section analysis for test failures.

func (*TestNthSectionAnalysis) HasEnded

func (nsa *TestNthSectionAnalysis) HasEnded() bool

type TestSingleRerun

type TestSingleRerun struct {
	// The buildbucket ID of the rerun.
	ID int64 `gae:"$id"`
	// LUCI build data for the rerun build.
	LUCIBuild `gae:"luci_build"`
	// Type for the rerun build
	// Either culprit verification or nth section run.
	Type RerunBuildType `gae:"rerun_type"`
	// Key to the TestFailureAnalysis of this SingleRerun
	AnalysisKey *datastore.Key `gae:"analysis_key"`
	// Time when the rerun send the result to bisection from recipe.
	ReportTime time.Time `gae:"report_time"`
	// The dimensions of the rerun build.
	Dimensions *pb.Dimensions `gae:"dimensions"`
	// Key to the culprit (Suspect model), if this is for culprit verification
	CulpritKey *datastore.Key `gae:"culprit_key"`
	// Key to TestNthSectionAnalysis, if this is for nthsection.
	NthSectionAnalysisKey *datastore.Key `gae:"nthsection_analysis_key"`
	// Priority of this run.
	Priority int32 `gae:"priority"`
	// Results of the test runs.
	// The TestFailureKey field of test result will be populated when this model
	// is first created.
	// This is useful to know which test failures are running for this rerun without
	// waiting for the result.
	TestResults RerunTestResults `gae:"test_results"`
	// Status of the rerun.
	// If the rerun ended, this result will base on the result
	// of the primary test failure. See pb.RerunStatus for more information.
	Status pb.RerunStatus `gae:"status"`
}

TestSingleRerun represents one rerun for test failures at a particular commit. A TestSingleRerun corresponds to one buildbucket run, and may run multiple test failures at the same time. A TestSingleRerun may be for nth-section or for culprit verification.

func (*TestSingleRerun) HasEnded

func (rerun *TestSingleRerun) HasEnded() bool

func (*TestSingleRerun) HasStarted

func (rerun *TestSingleRerun) HasStarted() bool

Jump to

Keyboard shortcuts

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