Documentation
¶
Index ¶
- Constants
- func BuildReleasesResponse(releases []sippyv1.Release, lastUpdated time.Time) apitype.Releases
- func BuildTestsResults(dbc *db.DB, release, period string, collapse, includeOverall bool, ...) (testsAPIResult, *apitype.Test, error)
- func BuildTestsResultsFromBigQuery(ctx context.Context, bqc *bq.Client, release, period string, ...) (testsAPIResultBQ, *apitype.TestBQ, error)
- func CacheSet[T any](ctx context.Context, c cache.Cache, result T, cacheKey []byte, ...)
- func CalculateRoundedCacheDuration(cacheOptions cache.RequestOptions) time.Duration
- func FetchJobRun(dbc *db.DB, jobRunID int64, unknownTests bool, preloads []string, ...) (*models.ProwJobRun, error)
- func FetchTestResultsFromBQ(ctx context.Context, q *bigquery.Query) ([]apitype.TestBQ, []error)
- func GetBaseFrontendURL(req *http.Request) string
- func GetBaseURL(req *http.Request) string
- func GetBuildClusterHealthAnalysis(dbc *db.DB, period string) (map[string]apitype.BuildClusterHealthAnalysis, error)
- func GetBuildClusterHealthReport(dbc *db.DB, start, boundary, end time.Time) ([]apitype.BuildClusterHealth, error)
- func GetDataFromCacheOrGenerate[T any](ctx context.Context, c cache.Cache, cacheOptions cache.RequestOptions, ...) (T, []error)
- func GetDisruptionVsPrevGAReportFromBigQuery(ctx context.Context, client *bigquery.Client) (apitype.DisruptionReport, []error)
- func GetDisruptionVsTwoWeeksAgoReportFromBigQuery(ctx context.Context, client *bigquery.Client) (apitype.DisruptionReport, []error)
- func GetJIRAIncidentsFromDB(dbClient *db.DB, start, end *time.Time) ([]apitype.CalendarEvent, error)
- func GetJobRunTestsCountByLookback(dbc *db.DB, lookbackDays int) (int64, int64, error)
- func GetPayloadDiffPullRequests(dbc *db.DB, fromPayload, toPayload string) ([]models.ReleasePullRequest, error)
- func GetPayloadEvents(dbClient *db.DB, release string, filterOpts *filter.FilterOptions, ...) ([]apitype.CalendarEvent, error)
- func GetPayloadStreamTestFailures(dbc *db.DB, release, stream, arch string, filterOpts *filter.FilterOptions, ...) ([]*apitype.TestFailureAnalysis, error)
- func GetPayloadTestFailures(dbc *db.DB, payloadTag string, logger log.FieldLogger) ([]*apitype.TestFailureAnalysis, error)
- func GetPullRequestsReportFromDB(dbc *db.DB, release string, filterOpts *filter.FilterOptions) ([]apitype.PullRequest, error)
- func GetRecentTestFailures(dbc *db.DB, release string, period time.Duration, ...) (*apitype.PaginationResult, error)
- func GetReleases(ctx context.Context, bqc *bqclient.Client, forceRefresh bool) ([]v1.Release, error)
- func GetReleasesFromBigQuery(ctx context.Context, client *bqcachedclient.Client) ([]sippyv1.Release, error)
- func GetRepositoriesReportFromDB(dbc *db.DB, release string, filterOpts *filter.FilterOptions, ...) ([]apitype.Repository, error)
- func GetTestAnalysisByJobFromDB(dbc *db.DB, filters *filter.Filter, release, testName string, ...) (map[string][]CountByDate, error)
- func GetTestAnalysisByVariantFromDB(dbc *db.DB, filters *filter.Filter, release, testName string, ...) (map[string][]CountByDate, error)
- func GetTestAnalysisOverallFromDB(dbc *db.DB, filters *filter.Filter, release, testName string, ...) (map[string][]CountByDate, error)
- func GetTestCapabilitiesFromDB(ctx context.Context, bqClient *bq.Client) ([]string, error)
- func GetTestDurationsFromDB(dbc *db.DB, release, test string, filters *filter.Filter) (map[string]float64, error)
- func GetTestLifecyclesFromDB(ctx context.Context, bqClient *bq.Client) ([]string, error)
- func GetTestOutputsFromDB(dbc *db.DB, release, test string, filters *filter.Filter, quantity int) ([]apitype.TestOutput, error)
- func GetTestRunsAndOutputsFromBigQuery(ctx context.Context, bigQueryClient *bq.Client, testID string, ...) ([]apitype.TestOutputBigQuery, error)
- func JobReportsFromDB(dbc *db.DB, release, period string, filterOpts *filter.FilterOptions, ...) ([]apitype.Job, error)
- func JobRunRiskAnalysis(ctx context.Context, dbc *db.DB, bqc *bigquery.Client, ...) (apitype.ProwJobRunRiskAnalysis, error)
- func JobsRunsReportFromDB(dbc *db.DB, filterOpts *filter.FilterOptions, release string, ...) (*apitype.PaginationResult, error)
- func ListPayloadJobRuns(dbClient *db.DB, filterOpts *filter.FilterOptions, release string) ([]models.ReleaseJobRun, error)
- func PayloadForJobRun(ctx context.Context, bigQueryClient *bqcachedclient.Client, jobRunID string) ([]apitype.JobPayload, error)
- func PrintAutocompleteFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB)
- func PrintCanaryTestsFromDB(release string, w http.ResponseWriter, dbc *db.DB)
- func PrintInstallJSONReportFromDB(w http.ResponseWriter, dbc *db.DB, release string)
- func PrintJobAnalysisJSONFromDB(dbc *db.DB, release string, jobFilter *filter.Filter, ...) (apitype.JobAnalysisResult, error)
- func PrintJobDetailsReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, ...) error
- func PrintJobsReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release string, ...)
- func PrintOverallReleaseHealthFromDB(w http.ResponseWriter, dbc *db.DB, release string, reportEnd time.Time)
- func PrintPRTestResultsJSON(w http.ResponseWriter, req *http.Request, bqc *bq.Client)
- func PrintPullRequestsReport(w http.ResponseWriter, req *http.Request, dbClient *db.DB)
- func PrintReleasesReport(w http.ResponseWriter, req *http.Request, dbClient *db.DB)
- func PrintTestsDetailsJSONFromDB(w http.ResponseWriter, release string, testSubstrings []string, dbc *db.DB)
- func PrintTestsJSONFromBigQuery(release string, w http.ResponseWriter, req *http.Request, bqc *bq.Client)
- func PrintTestsJSONFromDB(release string, w http.ResponseWriter, req *http.Request, dbc *db.DB)
- func PrintUpgradeJSONReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release string)
- func PrintVariantReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release string, ...)
- func ReleaseHealthReports(dbClient *db.DB, release string, reportEnd time.Time) ([]apitype.ReleaseHealthReport, error)
- func RespondWithJSON(statusCode int, w http.ResponseWriter, data interface{})
- func ValidateVariants(allJobVariants crtest.JobVariants, variantsMap map[string][]string, ...) []string
- func VariantListToMap(allJobVariants crtest.JobVariants, variants []string) (map[string][]string, error)
- func VariantListToMapWithWarnings(allJobVariants crtest.JobVariants, variants []string) (map[string][]string, []string, error)
- func VariantTestsReport(dbc *db.DB, release string, reportType v1.ReportType, ...) (sets.String, map[string]map[string]apitype.Test, error)
- func VariantsStringToSet(allJobVariants crtest.JobVariants, variantsString string) (sets.String, error)
- type CacheData
- type ClusterOperatorStatus
- type CountByDate
- type JobRunData
- type LabelOption
- type PRTestResult
Constants ¶
const PeriodDay = "day"
const PeriodHour = "hour"
Variables ¶
This section is empty.
Functions ¶
func BuildReleasesResponse ¶
BuildReleasesResponse creates the API response structure for releases
func BuildTestsResults ¶
func CalculateRoundedCacheDuration ¶
func CalculateRoundedCacheDuration(cacheOptions cache.RequestOptions) time.Duration
func FetchJobRun ¶
func FetchJobRun(dbc *db.DB, jobRunID int64, unknownTests bool, preloads []string, logger *log.Entry) (*models.ProwJobRun, error)
FetchJobRun returns a single job run loaded from postgres and populated with the ProwJob and test results. If unknownTests is true, all tests not registered in test_ownerships are loaded; otherwise any failed tests are loaded.
func FetchTestResultsFromBQ ¶
func GetBaseFrontendURL ¶
GetBaseFrontendURL returns the base URL for the frontend using the Origin header. If not present, it defaults to GetBaseURL.
func GetBaseURL ¶
GetBaseURL returns the base URL (protocol + host) from the request. Otherwise it uses the request host and handles TLS and X-Forwarded-Proto for the protocol.
func GetDataFromCacheOrGenerate ¶
func GetDataFromCacheOrGenerate[T any]( ctx context.Context, c cache.Cache, cacheOptions cache.RequestOptions, cacheData CacheData, generateFn func(context.Context) (T, []error), defaultVal T, ) (T, []error)
GetDataFromCacheOrGenerate attempts to find a cached record otherwise generates new data.
func GetJIRAIncidentsFromDB ¶
func GetPayloadEvents ¶
func GetPayloadEvents(dbClient *db.DB, release string, filterOpts *filter.FilterOptions, start, end *time.Time) ([]apitype.CalendarEvent, error)
GetPayloadEvents returns the list of release tags in a format suitable for a calendar like FullCalendar.
func GetPayloadStreamTestFailures ¶
func GetPayloadStreamTestFailures(dbc *db.DB, release, stream, arch string, filterOpts *filter.FilterOptions, reportEnd time.Time) ([]*apitype.TestFailureAnalysis, error)
GetPayloadStreamTestFailures loads the most recent payloads for a stream and attempts to search for most commonly failing tests, possible perma-failing blockers, etc.
func GetPayloadTestFailures ¶
func GetPayloadTestFailures(dbc *db.DB, payloadTag string, logger log.FieldLogger) ([]*apitype.TestFailureAnalysis, error)
GetPayloadTestFailures loads the test failures for a specific payload across all of it's jobs. At present, aggregated sub-jobs are not included and we assume only what bubbles up to failing the aggregated job is sufficient.
func GetPullRequestsReportFromDB ¶
func GetPullRequestsReportFromDB(dbc *db.DB, release string, filterOpts *filter.FilterOptions) ([]apitype.PullRequest, error)
func GetRecentTestFailures ¶
func GetRecentTestFailures( dbc *db.DB, release string, period time.Duration, previousPeriod *time.Duration, includeOutputs bool, filterOpts *filter.FilterOptions, pagination *apitype.Pagination, reportEnd time.Time, ) (*apitype.PaginationResult, error)
GetRecentTestFailures returns tests that failed within the given period, optionally excluding tests that also failed in a previous period (to surface only new regressions).
func GetReleases ¶
func GetReleases(ctx context.Context, bqc *bqclient.Client, forceRefresh bool) ([]v1.Release, error)
GetReleases gets all the releases defined in the BQ Releases table.
func GetReleasesFromBigQuery ¶
func GetReleasesFromBigQuery(ctx context.Context, client *bqcachedclient.Client) ([]sippyv1.Release, error)
GetReleasesFromBigQuery gets all releases defined in the Releases table in BigQuery
func GetRepositoriesReportFromDB ¶
func GetRepositoriesReportFromDB(dbc *db.DB, release string, filterOpts *filter.FilterOptions, reportEnd time.Time) ([]apitype.Repository, error)
func GetTestCapabilitiesFromDB ¶
GetTestCapabilitiesFromDB returns a sorted list of capabilities from the BQ component_mapping_latest table
func GetTestDurationsFromDB ¶
func GetTestLifecyclesFromDB ¶
GetTestLifecyclesFromDB returns a sorted list of lifecycles from the BQ junit table
func GetTestOutputsFromDB ¶
func JobReportsFromDB ¶
func JobRunRiskAnalysis ¶
func JobRunRiskAnalysis(ctx context.Context, dbc *db.DB, bqc *bigquery.Client, jobRun *models.ProwJobRun, logger *log.Entry, compareOtherPRs bool) (apitype.ProwJobRunRiskAnalysis, error)
JobRunRiskAnalysis checks the test failures and linked bugs for a job run, and reports back an estimated risk level for each failed test, and the job run overall.
func JobsRunsReportFromDB ¶
func JobsRunsReportFromDB(dbc *db.DB, filterOpts *filter.FilterOptions, release string, pagination *apitype.Pagination, reportEnd time.Time) (*apitype.PaginationResult, error)
JobsRunsReportFromDB renders a filtered summary of matching jobs.
func ListPayloadJobRuns ¶
func ListPayloadJobRuns(dbClient *db.DB, filterOpts *filter.FilterOptions, release string) ([]models.ReleaseJobRun, error)
func PayloadForJobRun ¶
func PayloadForJobRun(ctx context.Context, bigQueryClient *bqcachedclient.Client, jobRunID string) ([]apitype.JobPayload, error)
PayloadForJobRun returns the payload release tag that was used for a given job run.
func PrintAutocompleteFromDB ¶
PrintAutocompleteFromDB returns autocomplete results for a particular field, such as test or job names. It optionally takes a release and search query filter.
func PrintCanaryTestsFromDB ¶
func PrintCanaryTestsFromDB(release string, w http.ResponseWriter, dbc *db.DB)
func PrintInstallJSONReportFromDB ¶
func PrintInstallJSONReportFromDB(w http.ResponseWriter, dbc *db.DB, release string)
PrintInstallJSONReportFromDB renders a report showing the success/fail rates of operator installation.
func PrintJobDetailsReportFromDB ¶
func PrintJobDetailsReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release, jobSearchStr string, reportEnd time.Time) error
PrintJobDetailsReportFromDB renders the detailed list of runs for matching jobs.
func PrintJobsReportFromDB ¶
func PrintJobsReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release string, reportEnd time.Time)
PrintJobsReportFromDB renders a filtered summary of matching jobs.
func PrintOverallReleaseHealthFromDB ¶
func PrintOverallReleaseHealthFromDB(w http.ResponseWriter, dbc *db.DB, release string, reportEnd time.Time)
PrintOverallReleaseHealthFromDB gives a summarized status of the overall health, including infrastructure, install, upgrade, and variant success rates.
func PrintPRTestResultsJSON ¶
PrintPRTestResultsJSON is the HTTP handler for /api/pull_requests/test_results
func PrintPullRequestsReport ¶
func PrintReleasesReport ¶
func PrintTestsJSONFromDB ¶
func PrintUpgradeJSONReportFromDB ¶
func PrintUpgradeJSONReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release string)
PrintUpgradeJSONReportFromDB reports on the success/fail of operator upgrades.
func PrintVariantReportFromDB ¶
func PrintVariantReportFromDB(w http.ResponseWriter, req *http.Request, dbc *db.DB, release string, reportEnd time.Time)
PrintVariantReportFromDB
func ReleaseHealthReports ¶
func ReleaseHealthReports(dbClient *db.DB, release string, reportEnd time.Time) ([]apitype.ReleaseHealthReport, error)
ReleaseHealthReports returns a report on the most recent payload status for each arch/stream in the given release.
func RespondWithJSON ¶
func RespondWithJSON(statusCode int, w http.ResponseWriter, data interface{})
func ValidateVariants ¶
func ValidateVariants(allJobVariants crtest.JobVariants, variantsMap map[string][]string, source string) []string
ValidateVariants checks if variant names and values exist in BigQuery and returns warnings for any that don't. The source parameter is appended to warning messages to indicate where the variants came from (e.g., " from view").
func VariantListToMap ¶
func VariantListToMap(allJobVariants crtest.JobVariants, variants []string) (map[string][]string, error)
VariantListToMap collects a list of variants like "Architecture:amd64" into a map [Architecture -> amd64]; it also validates that the variants are known
func VariantListToMapWithWarnings ¶
func VariantListToMapWithWarnings(allJobVariants crtest.JobVariants, variants []string) (map[string][]string, []string, error)
VariantListToMapWithWarnings collects a list of variants like "Architecture:amd64" into a map [Architecture -> amd64]; it validates that the variants are known, but collects warnings instead of failing for invalid variants
func VariantTestsReport ¶
func VariantTestsReport(dbc *db.DB, release string, reportType v1.ReportType, testNames, testPrefixes, testSubStrings sets.String, excludedVariants []string) (sets.String, map[string]map[string]apitype.Test, error)
VariantTestsReport returns a set of all variant columns plus "All", and a map of testName to variant column to test results for that variant. Caller can provide exact test names to match, test name prefixes, or test substrings.
func VariantsStringToSet ¶
func VariantsStringToSet(allJobVariants crtest.JobVariants, variantsString string) (sets.String, error)
VariantsStringToSet converts comma separated variant string into a set; also validates that the variants are known
Types ¶
type CacheData ¶
type CacheData struct {
// contains filtered or unexported fields
}
func GetPrefixedCacheKey ¶
func (*CacheData) GetCacheKey ¶
type ClusterOperatorStatus ¶
type ClusterOperatorStatus struct {
Name string `json:"name"`
Status string `json:"status"`
Reason string `json:"reason"`
Message string `json:"message"`
}
ClusterOperatorStatus represents the status of a cluster operator
type CountByDate ¶
type CountByDate struct {
Date string `json:"date"`
Group string `json:"group"`
PassPercentage float64 `json:"pass_percentage"`
FlakePercentage float64 `json:"flake_percentage"`
FailPercentage float64 `json:"fail_percentage"`
Runs int `json:"runs"`
Passes int `json:"passes"`
Flakes int `json:"flakes"`
Failures int `json:"failures"`
}
type JobRunData ¶
type JobRunData struct {
// Basic job information
ID uint `json:"id"`
Name string `json:"name"`
Release string `json:"release"`
Cluster string `json:"cluster"`
URL string `json:"url"`
GCSBucket string `json:"gcsBucket"`
// Timing information
StartTime time.Time `json:"startTime"`
Duration time.Duration `json:"duration"`
DurationSeconds float64 `json:"durationSeconds"`
// Status and results
OverallResult string `json:"overallResult"`
Reason string `json:"reason"`
Succeeded bool `json:"succeeded"`
Failed bool `json:"failed"`
InfrastructureFailure bool `json:"infrastructureFailure"`
KnownFailure bool `json:"knownFailure"`
// Test information
TestCount int `json:"testCount"`
TestFailureCount int `json:"testFailureCount"`
TestFailures map[string]string `json:"testFailures,omitempty"`
// Job metadata
Variants []string `json:"variants,omitempty"`
// Cluster and infrastructure information
ClusterOperators []ClusterOperatorStatus `json:"clusterOperators,omitempty"`
}
JobRunData contains the comprehensive data for a job run including test failures and cluster operator status
type LabelOption ¶
LabelOption represents a label with ID and title for autocomplete
type PRTestResult ¶
type PRTestResult struct {
ProwJobBuildID string `json:"prowjob_build_id"`
ProwJobName string `json:"prowjob_name"`
ProwJobURL string `json:"prowjob_url"`
PRSha string `json:"pr_sha"`
ProwJobStart time.Time `json:"prowjob_start"`
TestName string `json:"test_name"`
TestSuite string `json:"test_suite"`
Success bool `json:"success"`
Flaked bool `json:"flaked"`
FailureContent string `json:"failure_content"`
}
PRTestResult represents a test result from a pull request job
func GetPRTestResults ¶
func GetPRTestResults(ctx context.Context, bqc *bq.Client, org, repo string, prNumber int, startDate, endDate time.Time, includeSuccesses []string) ([]PRTestResult, error)
GetPRTestResults fetches test failures for a specific pull request from BigQuery This queries both junit_pr and junit tables: - junit_pr: Contains results from normal presubmit jobs - junit: Contains results from /payload jobs (manually invoked jobs) Note: Only returns test failures (success = false), excluding flakes and passes includeSuccesses: Optional list of test name substrings to also include successes for