← Back to Pull requests

ROX-39204: Use only the scan's ProfileBundle for Rule metadata #1452

Open
unknown opened this pull request with 186 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 06, 2026 22:28 UTC
Author

The aggregator indexed every Rule in the namespace by its rule ID (compliance.openshift.io/rule) when propagating custom labels and annotations to ComplianceCheckResults. Two ProfileBundles with the same content have Rules with the same ID, so the Rule listed last won, and a check result could get another bundle's metadata and lose its own.

Found while running the serial e2e suite in parallel (#1451): TestOpenSCAPRuleMetadataPropagation lost its custom labels while another test's bundle with ocp4 content existed.

  • ProfileBundlesForScan follows the scan's compliance.openshift.io/profile-name label (set since #1456 on the scans a ScanSettingBinding creates for a Profile) to the Profile, and that Profile's compliance.openshift.io/profile-bundle label to its bundle. Scans without the label (TailoredProfile and CEL scans, scans created directly, and scans created before the label existed) fall back to the bundles with the scan's content image and file, which a ScanSettingBinding copies from the bundle into the scan.

  • NewRuleMetadataCacheForBundles indexes only those bundles' Rules. With none, it indexes every Rule, as before; NewRuleMetadataCache keeps that behavior.

  • The remediation-aggregator Role and both CSVs gain list on profilebundles and get on profiles.

  • Unit tests cover two bundles sharing a rule ID, the label lookup and its fallbacks. TestOpenSCAPRuleMetadataPropagation passes on OCP 4.22 with this change.
  • Generated with Claude Code

    Diff: 186 lines (+139 / -47) across 2 files Reviewer: Vincent056 Review duration: 78773m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 186 lines diff across 2 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.313
    Real PR Conversation Timeline
    1 comments
    "Review active on #1452"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% 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: 42.8% (MEDIUM) · Higher = larger blast radius
    42.8%
    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: 44.7% · Lower = rushed or shallow review
    44.7%
    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: 23.6% · Safe to merge
    23.6%