TRT-2884: add backfill-infra-failures command (phase 2) #3927
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.73) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 566 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.379
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.073
Real PR Conversation Timeline
1 comments
"Review active on #3927"
general
weight: 0.35
neisw
Summary
Adds a
backfill-infra-failuresCLI command that syncs InfraFailure labels from BigQuery into PostgreSQL and corrects the shared summary tables. This is Phase 2 of TRT-2884, building on the foundation from #3922.Problem
PG's
prow_job_runs.labelsis only populated at initial load or by the re-evaluator — it is not kept in sync with BigQuery'sjob_labelstable. As a result, ~85% of InfraFailure-labeled runs in BQ are missing the label (and the corresponding summary table corrections) in PG.What this PR adds
New command:
sippy backfill-infra-failuresA management command that:
1. Queries BQ
job_labelsfor InfraFailure-labeled runs within a configurable time window2. Pre-checks PG in batches to classify already-labeled vs missing runs
3. Calls
RecordInfraFailure()for each missing run — atomically adding the label AND subtracting from all summary tables4. Reports statistics: total BQ runs found, already labeled in PG, newly synced, errors
Flags
| Flag | Default | Description |
|------|---------|-------------|
|
--since| (none) | Start of time window (date string, e.g.2026-07-01) ||
--days| 90 | Look back N days from now (used when--sinceis not set) ||
--dry-run| false | Report what would be done without making changes ||
--batch-size| 100 | Process runs in batches of this size |Plus the standard
--database-dsn, BigQuery, and Google Cloud credential flags.Key design points
RecordInfraFailureis a no-op for already-labeled runsregressiontracker.gopattern) for unit-testable pure functionscmd/sippy/backfill_infra_failures.gowires up clients;pkg/dataloader/infrafailurebackfill/backfill.goholds all logicRecordInfraFailureWithOutcomedistinguishes subtracted / already-labeled / not-found for accurate stats reportingEvidence from local testing
Labeling (7-day window against staging DB)
Idempotency (re-run immediately after)
Testing
Jira: https://redhat.atlassian.net/browse/TRT-2884
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Added a command to backfill infrastructure-failure records.
Supports configurable time windows, batch sizes, dry-run mode, and UTC-based processing.
Provides completion status, failure reporting, and processing statistics.
Added outcome tracking for successful, reclassified, and unknown results.
Bug Fixes
Improved error handling to avoid exposing credential or connection details.
Tests
* Added unit, integration, and command-level coverage for backfill behavior and outcomes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->