TRT-2932: Fix presubmit risk analysis comparing against wrong release - #3956
TRT-2932: Fix presubmit risk analysis comparing against wrong release#3956machine424 wants to merge 1 commit into
Conversation
Since 3f0ab35 ("Add OCPMCP mcp-0.5 release to customizations"), JobRunRiskAnalysis for Presubmits was picking mcp-0.5 as the comparison release (first result from GetReleasesFromDB ordered by development_start_date DESC). This caused all presubmit risk results to show "Unknown" since there's no test history overlap. Filter for the most recent OCP release from the mainline chain (has PreviousRelease set), skipping synthetic releases and non-OCP products. Until non-OCP presubmits are properly supported, this ensures risk analysis works correctly for OCP presubmits.
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe API now selects the latest eligible OCP release for presubmit risk analysis. It excludes non-OCP releases, Presubmits releases, and releases without predecessors. The analysis returns an error when no suitable release exists. Table-driven tests cover these selection rules. ChangesOCP release selection
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR narrows presubmit risk analysis to the appropriate OCP release and adds corresponding test coverage; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 20 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (20 passed)
Full details: Go Error HandlingExplanation The pull request adds no custom-check failure. The new helper has no returned errors, ignored errors, panics, or pointer dereferences. The presubmit path checks Full details: Sql Injection PreventionExplanation No SQL injection issue was introduced. The pull request adds only in-memory release filtering and changes the selected release value. The release lookup uses a static GORM Full details: Excessive Css In React Should Use StylesExplanation PASS: The pull request changes only Full details: Test Coverage For New FeaturesExplanation PASS: The pull request adds unit coverage for the new pure selector, Full details: Single Responsibility And Clear NamingExplanation The patch adds one focused helper, Full details: Feature DocumentationExplanation PASS. The pull request changes presubmit risk-analysis release selection in Full details: Stable And Deterministic Test NamesExplanation The pull request adds only static Go table-test names: "empty list", "skips non-OCP products", "skips releases without PreviousRelease", "skips Presubmits even if it had PreviousRelease", "realistic production ordering", and "no OCP releases". No Ginkgo title calls or dynamic values appear in the changed test code. Release names and products remain in test data, not test titles. Full details: Test Structure And QualityExplanation PASS: The changed tests use Go's Full details: Microshift Test CompatibilityExplanation The check is not applicable. The pull request changes only Full details: Single Node Openshift (Sno) Test CompatibilityExplanation PASS: The pull request adds only a standard Go Full details: Topology-Aware Scheduling CompatibilityExplanation PASS: The pull request changes only Full details: Ote Binary Stdout ContractExplanation PASS. The pull request changes only Full details: Ipv6 And Disconnected Network Test CompatibilityExplanation PASS: The pull request adds a standard Go table-driven unit test, Full details: No-Weak-CryptoExplanation The pull request introduces no weak-crypto usage. The changed code adds release filtering and string comparisons for product, predecessor, and release names. It adds no MD5, SHA-1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret/token comparison logic. Full details: Container-PrivilegesExplanation PASS. The pull request changes only Full details: No-Sensitive-Data-In-LogsExplanation The pull request adds no logging calls or sensitive fields. The implementation only filters release metadata and returns a fixed error. Existing logs may include release or job names, but the pull request does not add sensitive data to those logs.
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Scheduling required tests: |
|
/lgtm |
|
/test e2e |
|
/retitle TRT-2932: Fix presubmit risk analysis comparing against wrong release |
|
@machine424: This pull request references TRT-2932 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.1.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
|
@machine424: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/lgtm cancel |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: machine424 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| compareRelease := jobRun.ProwJob.Release | ||
| neverStableJob := false | ||
| if compareRelease == models.ReleasePresubmits { | ||
| ar, err := GetReleasesFromDB(ctx, dbc) |
There was a problem hiding this comment.
Since 3f0ab35 ("Add OCPMCP mcp-0.5 release to customizations"), JobRunRiskAnalysis for Presubmits was picking mcp-0.5 as the comparison release (first result from GetReleasesFromDB ordered by development_start_date DESC). This caused all presubmit risk results to show "Unknown" since there's no test history overlap.
Filter for the most recent OCP release from the mainline chain (has PreviousRelease set), skipping synthetic releases and non-OCP products. Until non-OCP presubmits are properly supported, this ensures risk analysis works correctly for OCP presubmits.
Summary by CodeRabbit
Bug Fixes
Tests