Documentation ¶
Overview ¶
Package datastoreutil contains utility functions related to datastore entities
Index ¶
- func CountLatestRevertsCommitted(c context.Context, hours int64) (int64, error)
- func CountLatestRevertsCreated(c context.Context, hours int64, analysisType pb.AnalysisType) (int64, error)
- func FetchSuspectsForAnalysis(c context.Context, cfa *model.CompileFailureAnalysis) ([]*model.Suspect, error)
- func FetchTestFailuresForSuspect(c context.Context, suspect *model.Suspect) (*model.TestFailureBundle, error)
- func GetAnalysisForBuild(c context.Context, bbid int64) (*model.CompileFailureAnalysis, error)
- func GetAssociatedBuildID(ctx context.Context, suspect *model.Suspect) (int64, error)
- func GetBuild(c context.Context, bbid int64) (*model.LuciFailedBuild, error)
- func GetBuildIDForCompileSuspect(ctx context.Context, suspect *model.Suspect) (int64, error)
- func GetCompileFailureAnalysis(c context.Context, analysisID int64) (*model.CompileFailureAnalysis, error)
- func GetCompileFailureForAnalysis(c context.Context, cfa *model.CompileFailureAnalysis) (*model.CompileFailure, error)
- func GetCompileFailureForAnalysisID(c context.Context, analysisID int64) (*model.CompileFailure, error)
- func GetFailedBuildForAnalysis(c context.Context, cfa *model.CompileFailureAnalysis) (*model.LuciFailedBuild, error)
- func GetHeuristicAnalysis(c context.Context, analysis *model.CompileFailureAnalysis) (*model.CompileHeuristicAnalysis, error)
- func GetInProgressReruns(ctx context.Context, tfa *model.TestFailureAnalysis) ([]*model.TestSingleRerun, error)
- func GetLastRerunForRerunBuild(c context.Context, rerunBuild *model.CompileRerunBuild) (*model.SingleRerun, error)
- func GetLatestAnalysisForBuilder(c context.Context, project string, bucket string, builder string) (*model.CompileFailureAnalysis, error)
- func GetLatestBuildFailureForBuilder(c context.Context, project string, bucket string, builder string) (*model.LuciFailedBuild, error)
- func GetNthSectionAnalysis(c context.Context, analysis *model.CompileFailureAnalysis) (*model.CompileNthSectionAnalysis, error)
- func GetOtherSuspectsWithSameCL(c context.Context, suspect *model.Suspect) ([]*model.Suspect, error)
- func GetPrimaryTestFailure(ctx context.Context, analysis *model.TestFailureAnalysis) (*model.TestFailure, error)
- func GetProjectForCompileFailureAnalysis(ctx context.Context, cfa *model.CompileFailureAnalysis) (string, error)
- func GetProjectForCompileFailureAnalysisID(ctx context.Context, analysisID int64) (string, error)
- func GetProjectForSuspect(ctx context.Context, suspect *model.Suspect) (string, error)
- func GetRerunsForAnalysis(c context.Context, cfa *model.CompileFailureAnalysis) ([]*model.SingleRerun, error)
- func GetRerunsForNthSectionAnalysis(c context.Context, nsa *model.CompileNthSectionAnalysis) ([]*model.SingleRerun, error)
- func GetRerunsForRerunBuild(c context.Context, rerunBuild *model.CompileRerunBuild) ([]*model.SingleRerun, error)
- func GetSuspect(ctx context.Context, suspectID int64, parentAnalysis *datastore.Key) (*model.Suspect, error)
- func GetSuspectForNthSectionAnalysis(c context.Context, nthsectionAnalysis *model.CompileNthSectionAnalysis) (*model.Suspect, error)
- func GetSuspectForTestAnalysis(ctx context.Context, tfa *model.TestFailureAnalysis) (*model.Suspect, error)
- func GetSuspectsForHeuristicAnalysis(c context.Context, heuristicAnalysis *model.CompileHeuristicAnalysis) ([]*model.Suspect, error)
- func GetTestFailure(ctx context.Context, failureID int64) (*model.TestFailure, error)
- func GetTestFailureAnalysis(ctx context.Context, analysisID int64) (*model.TestFailureAnalysis, error)
- func GetTestFailureAnalysisForSuspect(c context.Context, suspect *model.Suspect) (*model.TestFailureAnalysis, error)
- func GetTestFailureBundle(ctx context.Context, tfa *model.TestFailureAnalysis) (bundle *model.TestFailureBundle, err error)
- func GetTestFailures(c context.Context, project, testID, refHash, variantHash string) ([]*model.TestFailure, error)
- func GetTestNthSectionAnalysis(ctx context.Context, analysisID int64) (*model.TestNthSectionAnalysis, error)
- func GetTestNthSectionForAnalysis(ctx context.Context, tfa *model.TestFailureAnalysis) (nsa *model.TestNthSectionAnalysis, err error)
- func GetTestNthSectionReruns(ctx context.Context, nsa *model.TestNthSectionAnalysis) ([]*model.TestSingleRerun, error)
- func GetTestSingleRerun(ctx context.Context, rerunID int64) (*model.TestSingleRerun, error)
- func GetVerificationRerunsForTestCulprit(ctx context.Context, culprit *model.Suspect) (culpritRerun *model.TestSingleRerun, parentRerun *model.TestSingleRerun, ...)
- func GetVerifiedCulpritForTestAnalysis(ctx context.Context, tfa *model.TestFailureAnalysis) (s *model.Suspect, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountLatestRevertsCommitted ¶
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 GetAnalysisForBuild ¶
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 ¶
GetAssociatedBuildID returns the build ID of the failure associated with the suspect
func GetBuild ¶
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 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 GetProjectForSuspect ¶
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 ¶
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 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 ¶
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)
Types ¶
This section is empty.