Documentation
¶
Index ¶
- Constants
- func BackfillData(dbc *db.DB, table string, startDate, endDate civil.Date) error
- func RefreshData(dbc *db.DB, cacheClient cache.Cache, opts RefreshOptions) error
- func SortByJobNameNT(risks []*JobNewTestRisks)
- func SortByJobNameRA(ras []RiskAnalysisSummary)
- type AnalysisWorker
- type CommentWorker
- type DaemonProcess
- type DaemonServer
- type ExpandedTriage
- type JobNewTestRisks
- type JobRunFilter
- type Mode
- type NewTest
- type NewTestRisk
- type NewTestsWorker
- type PreparedComment
- type RefreshOptions
- type RiskAnalysisSummary
- type Server
- type WorkProcessor
Constants ¶
const ( // Whether this instance of sippy is capable of displaying OpenShift-releated data. This // is basically always since we don't have a kube Sippy anymore. OpenshiftCapability = "openshift_releases" // LocalDB is whether we have a local DB client (currently postgres) LocalDBCapability = "local_db" // BuildclusterCapability is whether we have build cluster health data. BuildClusterCapability = "build_clusters" // ComponentReadiness capability is whether this sippy instance is configured for Component Readiness ComponentReadinessCapability = "component_readiness" // WriteEndpointsCapability is whether we have enabled write APIs on this server. WriteEndpointsCapability = "write_endpoints" )
const APIConfigError = "APIConfigError"
some standard error types
const ParameterInvalid = "ParameterInvalid"
const ParameterMissing = "ParameterMissing"
Variables ¶
This section is empty.
Functions ¶
func BackfillData ¶
BackfillData refreshes a specific table for a given date range, bypassing the normal incremental logic. Used for backfilling.
func RefreshData ¶
RefreshData refreshes materialized views. Summary tables (test_daily_totals, test_cumulative_summaries) are updated incrementally by the prow loader; use "sippy backfill" to repair them.
func SortByJobNameNT ¶
func SortByJobNameNT(risks []*JobNewTestRisks)
func SortByJobNameRA ¶
func SortByJobNameRA(ras []RiskAnalysisSummary)
Types ¶
type AnalysisWorker ¶
type AnalysisWorker struct {
// contains filtered or unexported fields
}
func (*AnalysisWorker) Run ¶
func (aw *AnalysisWorker) Run(ctx context.Context)
type CommentWorker ¶
type CommentWorker struct {
// contains filtered or unexported fields
}
func (*CommentWorker) Run ¶
func (cw *CommentWorker) Run()
type DaemonProcess ¶
type DaemonServer ¶
type DaemonServer struct {
// contains filtered or unexported fields
}
func NewDaemonServer ¶
func NewDaemonServer(processes []DaemonProcess) *DaemonServer
func (*DaemonServer) Serve ¶
func (da *DaemonServer) Serve()
type ExpandedTriage ¶
type ExpandedTriage struct {
*models.Triage
RegressedTests map[string][]*componentreport.ReportTestSummary `json:"regressed_tests"`
SymptomSummaries []componentreadiness.TriageSymptomSummary `json:"symptom_summaries,omitempty"`
}
ExpandedTriage allows for additional information to be included in the triage response.
type JobNewTestRisks ¶
type JobNewTestRisks struct {
JobName string
NewTestRisks map[string]*NewTestRisk // one risk record per new test name
}
JobNewTestRisks represents the new test risks for (all runs of) a single job
type JobRunFilter ¶
type JobRunFilter interface {
// OnlyLatestSha filters out runs that are not against the PR's latest sha
OnlyLatestSha(entry *logrus.Entry, info prJobInfo) []*prow.ProwJob
// JobFailedEarly determines if a run did not get far enough to be included in new test analysis
JobFailedEarly(logger *logrus.Entry, run *models.ProwJobRun) bool
}
type Mode ¶
type Mode string
Mode defines the server mode of operation, OpenShift or upstream Kubernetes.
type NewTest ¶
type NewTest struct {
JobName string
JobRunID uint
TestName string
Success bool
Failure bool // and if both, it's a flake
}
NewTest represents a test result whose name has not been seen in merged code before. we want to call out these out in comments alongside risk analysis.
type NewTestRisk ¶
type NewTestRisk struct {
TestName string
AnyMissing bool // it was a new test in one run but missing in another at same sha
Runs int // how many job runs did we examine
Failures int // how many of the test results were failure
Flakes int // or flakes
OnlyInOne bool // new test was only seen in one job of multiple for this PR
NewTests []NewTest
Level apiModels.RiskLevel
Reason string
}
NewTestRisk is created for the following scenarios: 1. Any PR job adds a new test that appears in one run and not another at the same sha - high risk 2. PR adds new test that appears in only a single job and:
- it fails at all - high risk
- it succeeds or flakes - medium risk (might not be intended for multiple jobs)
3. PR adds new test that appears in more than one job and (at latest sha):
- it fails at all - high risk
- it succeeds or flakes - no risk (only included in list of all new tests)
type NewTestsWorker ¶
type NewTestsWorker struct {
// contains filtered or unexported fields
}
NewTestsWorker analyzes PR jobs looking for new tests and determining their risks.
func StandardNewTestsWorker ¶
func StandardNewTestsWorker(dbc *db.DB) *NewTestsWorker
StandardNewTestsWorker is a convenience method to create a NewTestsWorker with standard filters
type PreparedComment ¶
type PreparedComment struct {
// contains filtered or unexported fields
}
PreparedComment is a comment that is ready to be posted on a github PR
type RefreshOptions ¶
type RefreshOptions struct {
RefreshOnlyIfEmpty bool
}
RefreshOptions controls the incremental refresh behavior.
type RiskAnalysisSummary ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer( mode Mode, listenAddr string, corsAllowedOrigin string, syntheticTestManager synthetictests.SyntheticTestManager, variantManager testidentification.VariantManager, sippyNG fs.FS, static fs.FS, dbClient *db.DB, gcsClient *storage.Client, gcsBucket string, bigQueryClient *sippybq.Client, crDataProvider dataprovider.DataProvider, pinnedDateTime *time.Time, cacheClient cache.Cache, crTimeRoundingFactor time.Duration, crTimeRoundingOffset time.Duration, views *apitype.SippyViews, config *v1.SippyConfig, enableWriteEndpoints bool, jiraClient *jira.Client, ) *Server
func (*Server) GetHTTPServer ¶
func (*Server) GetReportEnd ¶
func (*Server) SetSymptomReEvaluation ¶
func (s *Server) SetSymptomReEvaluation(submitter *symptomre.Submitter, querier *symptomre.StatusQuerier, canceller *symptomre.BatchCanceller)
SetSymptomReEvaluation wires the async symptom re-evaluation submitter, status querier, and batch canceller. Called during server setup when River is available.
type WorkProcessor ¶
type WorkProcessor struct {
// contains filtered or unexported fields
}
WorkProcessor coordinates the initialization, connection, and execution of all the workers that go into generating PR comments
func NewWorkProcessor ¶
func NewWorkProcessor(dbc *db.DB, bigQueryClient *bigquery.Client, gcsBucket *storage.BucketHandle, cacheClient cache.Cache, ghCommenter *commenter.GitHubCommenter, commentAnalysisWorkers int, commentAnalysisRate, commentUpdaterRate time.Duration, dryRunOnly bool) *WorkProcessor
NewWorkProcessor creates a standard work processor from parameters. dbc: our database bigQueryClient: client for querying our data warehouse gcsBucket: handle to our root gcs bucket cacheClient: client for our local redis cache ghCommenter: the commenting implementation commentAnalysisWorkers: the number of threads active to process pending comment jobs commentAnalysisRate: the minimun duration between querying the db for pending jobs commentUpdaterRate: the minimum duration between adding a comment before we begin work on adding the next dryRunOnly: default is true to prevent unintended commenting when running locally or in a test deployment
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package workqueue provides generic infrastructure for River-based asynchronous work queues.
|
Package workqueue provides generic infrastructure for River-based asynchronous work queues. |
|
symptomre
Package symptomre implements the asynchronous symptom re-evaluation workflow.
|
Package symptomre implements the asynchronous symptom re-evaluation workflow. |