← Back to Pull requests

test(recipe): read Percona pins from values in remediation image test #3190

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

Summary

TestRemediationImagesPinnedEverywhere now reads the Percona image pins from recipes/components/{psmdb-operator,nvsentinel-mongodb}/values.yaml instead of a hardcoded map. A Renovate bump to those values files alone now fails at PR time.

Motivation / Context

The test checked the hand-maintained copies of the Percona pins (tools/mirror-e2e, the render test, the vuln-scan matrix, the BOM doc) against a hardcoded map. Nothing compared that map with the values files. #3184 bumped pmm-client in nvsentinel-mongodb/values.yaml only, and it passed PR CI. The drift showed up only in the advisory Mirror E2E and in the live render test, which make test skips under -short. #3189 fixed main forward.

Fixes: N/A
Related: #3184, #3189

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

  • Documentation update

  • Refactoring (no functional changes)

  • Build/CI/tooling
  • Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)

  • API server (cmd/aicrd, pkg/server)

  • Recipe engine / data (pkg/recipe)

  • Bundler and deployers (pkg/bundler, pkg/component)

  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)

  • Validator (pkg/validator)

  • Core libraries (pkg/errors, pkg/k8s)

  • Docs/examples (docs/, examples/)

  • Other: ____________
  • Implementation Notes

  • The test walks both values files and collects every image reference: any map with a repository (joined to its tag) and any string under an image key. A pin added to either file later is covered without editing the test.

  • It fails closed in these cases:

  • - a file with no image references;
    - an image with no tag, or a tag that isn't a string;
    - the same repository pinned at two different tags. The operator image appears in both files.
  • The hardcoded remediationThirdPartyImages map is gone, which removes one more copy to keep in sync. The comment in vuln-scan-images.yaml that says this test catches drift from the values pins is now accurate.

  • Expect red Renovate PRs: a Renovate PR that bumps one of these six Percona images in the values files will now fail tests until someone updates tools/mirror-e2e, the render test's perconaImages, the vuln-scan include tag, and runs make bom-docs. Each failure names the file and the image:tag it expected.

  • Not covered, same as before: removing an image from the values files while its old entries stay in the copies is still caught only by the live render test.
  • Testing

    make qualify   # clean detached worktree
    

  • TestRemediationImagesPinnedEverywhere, the new table-driven TestSplitImageRef and TestNVSentinelMongoDBContract pass. go test -short -race ./pkg/recipe passes, and golangci-lint reports 0 issues.

  • Gap shown on main: changing only the pmm-client digest in nvsentinel-mongodb/values.yaml leaves the old test passing.

  • Mutations on this branch:

  • - Each of the seven digest-pinned references across both files (operator, initImage, mongod, exporter sidecar, PBM, fluent-bit, PMM), changed on its own in the values file, makes the test fail.
    - Bumping the operator in one file only reports the conflict and names both files.
    - Removing a tag reports has no string tag.
  • Coverage: test-only change, so there is no change to source coverage.
  • Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

  • Medium — Touches multiple components or has broader impact

  • High — Breaking change, affects critical paths, or complex rollout
  • Rollout notes: N/A

    Checklist

  • Tests pass locally (make test with -race)

  • Linter passes (make lint)

  • I did not skip/disable tests to make CI green

  • I added/updated tests for new functionality

  • I updated docs if user-facing behavior changed

  • Changes follow existing patterns in the codebase

  • Commits are signed off and cryptographically signed (git commit -s -S) — GPG signing info
  • Diff: 531 lines (+398 / -133) across 6 files Reviewer: lalitadithya Review duration: 72m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 531 lines diff across 6 files
    0.48
    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.376
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3190"
    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: 47.9% (MEDIUM) · Higher = larger blast radius
    47.9%
    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: 18.9% · Safe to merge
    18.9%
    Repository