TRT-3009: Prevent daemon new-test analysis from blocking fetchdata partition creation #4099
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 328 lines diff across 4 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.347
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4099"
general
weight: 0.35
sosiouxme
Summary
Fixes TRT-3009: the sippy daemon's new-test analysis held relation locks on partitioned test-result tables long enough to block fetchdata partition creation.
FetchJobRun(onlyNewTests=true)correlatedNOT EXISTSsubquery was constrained by release but not by timestamp, scanning every daily range sub-partition within the release. Addedt2.prow_job_run_timestamp >= ?with a 90-day lookback from the job run's timestamp so PostgreSQL can prune to only recent sub-partitions. This prevents the shared locks from blockingCREATE TABLE ... PARTITION OFDDL during fetchdata.PrintJobAnalysisJSONFromDBnow returns early whenListFilteredJobIDsyields no results, avoidingprow_job_id IN (NULL)queries that would plan across all partitions and acquire locks.Changes
| File | Change |
|------|--------|
|
pkg/api/job_runs.go| AddedmergedPRLookbackDaysconstant (90 days) and timestamp bound to theNOT EXISTSsubquery inFetchJobRun||
pkg/api/job_analysis.go| Early return with initialized empty map when no jobs match the filter ||
test/integration/new_test_analysis_test.go| Integration tests validating bounded partition access and empty-jobs guard |Test plan
go vet ./pkg/api/...passesgo test ./pkg/...passes (all unit tests)make lintpassesgo test -c ./test/integration/)make integrationvalidates bounded partition access (requires container runtime)-
TestFetchJobRunOnlyNewTests/only_returns_tests_not_seen_in_merged_PRs_or_ownership_registry-
TestFetchJobRunOnlyNewTests/old_merged_PR_beyond_lookback_does_not_exclude_test(regression test)-
TestFetchJobRunOnlyNewTests/failed_tests_returned_when_onlyNewTests_is_false-
TestPrintJobAnalysisEmptyJobs🤖 Generated with Claude Code
---
Generated with Claude Code
<!-- coderabbit-review -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Bug Fixes
New-test filtering now checks merged pull request runs from the 90 days ending at the job run’s timestamp, inclusive. Tests found only in older runs no longer prevent a test from being treated as new.
* Job analysis with filters that match no jobs now returns an empty result without an error, including an empty period breakdown.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->