← Back to Pull requests

CMP-4818: Look for the scan's Profile in every bundle with its content #1456

Closed
unknown closed this pull request without merging on Oct 21, 2026 15:16 UTC
View on GitHub
unknown unknown commented on Oct 08, 2026 18:21 UTC
Author

When a scan starts, the operator checks whether its Profile is deprecated, and errors the scan if it can't find the Profile. It looked only in the first ProfileBundle with the scan's content image and file. Several bundles can use the same content, and one that is still being parsed (or deleted) has no Profiles. So the scan went straight to DONE/ERROR ("Could not check whether the Profile used by ComplianceScan is deprecated") whenever that bundle came first, even though another bundle, such as the default rhcos4, had the Profile.

The operator now looks for the Profile in every matching bundle and checks the first one that exists. The scan still errors when none of them has it.

Scans that the suite controller creates for a Profile are also labeled with compliance.openshift.io/profile-name, and the operator checks that Profile first, so the warning names the scan's own Profile when bundles share content.

This is what made TestUnapplyRemediation fail after 5 seconds in the parallel serial suite (#1304, #1451): TestAutoRemediate creates a bundle with the rhcos4 content while other tests start scans with it. It's also needed for the TestScanDeprecatedProfile flake fix (#1455, CMP-4819), because while a bundle is still being parsed, no deprecation warning is sent at all.

Tested with unit tests for the PENDING phase and the suite controller, and with the coverage check, which raises the compliancescan baseline from 43.8% to 45.1% and the compliancesuite baseline from 23.7% to 29.9%. The first PENDING test lists a bundle with no Profiles before the one that has the scan's Profile; another labels the scan with the second of two bundles' deprecated Profiles and checks that the warning names it. Both fail without the fix. On an OCP 4.20 cluster, with two bundles of the same deprecated content, each ScanSettingBinding's scan now warns about its own Profile.

This is the same change as #1454, cherry-picked from the original commit.

Generated with Claude Code

Diff: 252 lines (+189 / -63) across 3 files Reviewer: Vincent056 Review duration: 18534m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 252 lines diff across 3 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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.331
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1456"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39% (MEDIUM) · Higher = larger blast radius
39%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%