datastoreutil

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

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

Documentation

Overview

Package datastoreutil contains utility functions related to datastore entities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountLatestRevertsCommitted

func CountLatestRevertsCommitted(c context.Context, hours int64) (int64, error)

CountLatestRevertsCommitted returns the number of reverts committed within the last number of hours

func CountLatestRevertsCreated

func CountLatestRevertsCreated(c context.Context, hours int64, analysisType pb.AnalysisType) (int64, error)

CountLatestRevertsCreated returns the number of reverts created within the last number of hours

func FetchSuspectsForAnalysis

func FetchSuspectsForAnalysis(c context.Context, cfa *model.CompileFailureAnalysis) ([]*model.Suspect, error)

FetchSuspectsForAnalysis returns all suspects (from heuristic and nthsection) for an analysis

func FetchTestFailuresForSuspect

func FetchTestFailuresForSuspect(c context.Context, suspect *model.Suspect) (*model.TestFailureBundle, error)

func GetAnalysisForBuild

func GetAnalysisForBuild(c context.Context, bbid int64) (*model.CompileFailureAnalysis, error)

GetAnalysisForBuild returns the failure analysis associated with the given Buildbucket ID Note: if the build or its analysis is not found, this will return (nil, nil)

func GetAssociatedBuildID

func GetAssociatedBuildID(ctx context.Context, suspect *model.Suspect) (int64, error)

GetAssociatedBuildID returns the build ID of the failure associated with the suspect

func GetBuild

func GetBuild(c context.Context, bbid int64) (*model.LuciFailedBuild, error)

GetBuild returns the failed build in the datastore with the given Buildbucket ID Note: if the build is not found, this will return (nil, nil)

func GetBuildIDForCompileSuspect

func GetBuildIDForCompileSuspect(ctx context.Context, suspect *model.Suspect) (int64, error)

func GetCompileFailureAnalysis

func GetCompileFailureAnalysis(c context.Context, analysisID int64) (*model.CompileFailureAnalysis, error)

GetCompileFailureAnalysis gets compile failure analysis by its id

func GetCompileFailureForAnalysis

func GetCompileFailureForAnalysis(c context.Context, cfa *model.CompileFailureAnalysis) (*model.CompileFailure, error)

GetCompileFailureForAnalysis gets CompileFailure for analysis

func GetCompileFailureForAnalysisID

func GetCompileFailureForAnalysisID(c context.Context, analysisID int64) (*model.CompileFailure, error)

GetCompileFailureForAnalysisID gets CompileFailure for analysisID.

func GetFailedBuildForAnalysis

func GetFailedBuildForAnalysis(c context.Context, cfa *model.CompileFailureAnalysis) (*model.LuciFailedBuild, error)

GetFailedBuildForAnalysis gets LuciFailedBuild for analysis.

func GetHeuristicAnalysis

func GetHeuristicAnalysis(c context.Context, analysis *model.CompileFailureAnalysis) (*model.CompileHeuristicAnalysis, error)

GetHeuristicAnalysis returns the heuristic analysis associated with the given failure analysis

func GetInProgressReruns

func GetInProgressReruns(ctx context.Context, tfa *model.TestFailureAnalysis) ([]*model.TestSingleRerun, error)

GetInProgressReruns returns the reruns which are in progress.

func GetLastRerunForRerunBuild

func GetLastRerunForRerunBuild(c context.Context, rerunBuild *model.CompileRerunBuild) (*model.SingleRerun, error)

GetLastRerunForRerunBuild returns the last SingleRerun for a rerunBuild (based on start_time)

func GetLatestAnalysisForBuilder

func GetLatestAnalysisForBuilder(c context.Context, project string, bucket string, builder string) (*model.CompileFailureAnalysis, error)

GetLatestAnalysisForBuilder returns the latest CompileFailureAnalysis for a builderID If there is no analysis, return (nil, nil)

func GetLatestBuildFailureForBuilder

func GetLatestBuildFailureForBuilder(c context.Context, project string, bucket string, builder string) (*model.LuciFailedBuild, error)

GetLatestBuildFailureForBuilder returns the latest LuciFailedBuild model for a builderID If there is no build failure, return (nil, nil)

func GetNthSectionAnalysis

func GetNthSectionAnalysis(c context.Context, analysis *model.CompileFailureAnalysis) (*model.CompileNthSectionAnalysis, error)

GetNthSectionAnalysis returns the nthsection analysis associated with the given failure analysis

func GetOtherSuspectsWithSameCL

func GetOtherSuspectsWithSameCL(c context.Context, suspect *model.Suspect) ([]*model.Suspect, error)

GetOtherSuspectsWithSameCL returns the list of Suspect(from different analyses) that has the same reviewURL as this suspect. It is meant to check if the same CL is the suspects for multiple failures.

func GetPrimaryTestFailure

func GetPrimaryTestFailure(ctx context.Context, analysis *model.TestFailureAnalysis) (*model.TestFailure, error)

GetPrimaryTestFailure gets the primary TestFailure model for a TestFailureAnalysis.

func GetProjectForCompileFailureAnalysis

func GetProjectForCompileFailureAnalysis(ctx context.Context, cfa *model.CompileFailureAnalysis) (string, error)

func GetProjectForCompileFailureAnalysisID

func GetProjectForCompileFailureAnalysisID(ctx context.Context, analysisID int64) (string, error)

func GetProjectForSuspect

func GetProjectForSuspect(ctx context.Context, suspect *model.Suspect) (string, error)

func GetRerunsForAnalysis

func GetRerunsForAnalysis(c context.Context, cfa *model.CompileFailureAnalysis) ([]*model.SingleRerun, error)

GetRerunsForAnalysis returns all reruns for an analysis The result is sorted by start_time

func GetRerunsForNthSectionAnalysis

func GetRerunsForNthSectionAnalysis(c context.Context, nsa *model.CompileNthSectionAnalysis) ([]*model.SingleRerun, error)

func GetRerunsForRerunBuild

func GetRerunsForRerunBuild(c context.Context, rerunBuild *model.CompileRerunBuild) ([]*model.SingleRerun, error)

GetRerunsForRerunBuild returns all SingleRerun for a rerunBuild

func GetSuspect

func GetSuspect(ctx context.Context, suspectID int64,
	parentAnalysis *datastore.Key) (*model.Suspect, error)

GetSuspect returns the Suspect given its ID and key to parent analysis

func GetSuspectForNthSectionAnalysis

func GetSuspectForNthSectionAnalysis(c context.Context, nthsectionAnalysis *model.CompileNthSectionAnalysis) (*model.Suspect, error)

GetSuspectForNthSectionAnalysis returns the heuristic suspects identified by the given heuristic analysis

func GetSuspectForTestAnalysis

func GetSuspectForTestAnalysis(ctx context.Context, tfa *model.TestFailureAnalysis) (*model.Suspect, error)

GetSuspectForTestAnalysis returns suspect for test analysis.

func GetSuspectsForHeuristicAnalysis

func GetSuspectsForHeuristicAnalysis(c context.Context, heuristicAnalysis *model.CompileHeuristicAnalysis) ([]*model.Suspect, error)

GetSuspectsForHeuristicAnalysis returns the heuristic suspects identified by the given heuristic analysis

func GetTestFailure

func GetTestFailure(ctx context.Context, failureID int64) (*model.TestFailure, error)

GetTestFailure gets test failure by its ID.

func GetTestFailureAnalysis

func GetTestFailureAnalysis(ctx context.Context, analysisID int64) (*model.TestFailureAnalysis, error)

GetTestFailureAnalysis gets test failure analysis by its ID.

func GetTestFailureAnalysisForSuspect

func GetTestFailureAnalysisForSuspect(c context.Context, suspect *model.Suspect) (*model.TestFailureAnalysis, error)

func GetTestFailureBundle

func GetTestFailureBundle(ctx context.Context, tfa *model.TestFailureAnalysis) (bundle *model.TestFailureBundle, err error)

GetTestFailureBundle returns a TestFailureBundle for a TestFailureAnalysis.

func GetTestFailures

func GetTestFailures(c context.Context, project, testID, refHash, variantHash string) ([]*model.TestFailure, error)

GetTestFailures returns all TestFailures for a test. Optionally filter by variant_hash.

func GetTestNthSectionAnalysis

func GetTestNthSectionAnalysis(ctx context.Context, analysisID int64) (*model.TestNthSectionAnalysis, error)

GetTestNthSectionAnalysis gets test nthsection analysis by its ID.

func GetTestNthSectionForAnalysis

func GetTestNthSectionForAnalysis(ctx context.Context, tfa *model.TestFailureAnalysis) (nsa *model.TestNthSectionAnalysis, err error)

GetTestNthSectionForAnalysis gets test nthsection analysis for a test failure analysis. This may return nil if the nthsection analysis has not been created yet.

func GetTestNthSectionReruns

func GetTestNthSectionReruns(ctx context.Context, nsa *model.TestNthSectionAnalysis) ([]*model.TestSingleRerun, error)

GetTestNthSectionReruns returns the nthsection reruns. The reruns are ordered by create time.

func GetTestSingleRerun

func GetTestSingleRerun(ctx context.Context, rerunID int64) (*model.TestSingleRerun, error)

GetTestSingleRerun gets test single rerun by its ID.

func GetVerificationRerunsForTestCulprit

func GetVerificationRerunsForTestCulprit(ctx context.Context, culprit *model.Suspect) (culpritRerun *model.TestSingleRerun, parentRerun *model.TestSingleRerun, reterr error)

func GetVerifiedCulpritForTestAnalysis

func GetVerifiedCulpritForTestAnalysis(ctx context.Context, tfa *model.TestFailureAnalysis) (s *model.Suspect, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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