← Back to Pull requests

test(operator): upgrade the operator with the tag's own AICR #3893

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

Summary

The release gate's operator upgrade lane (make operator-qualify-published) again upgrades the published operator, running its own AICR, to the candidate running the tag's own AICR. The lifecycle suite now follows whatever recipe the running AICR resolves, so a stock component that a release adds or drops needs no change to the suite.

Motivation / Context

d34934858 unblocked v1.3.0 GA by holding AICR at the published release's version on both sides of the upgrade. The suite disabled the kind recipe's components using the names in the first plan. AICR v1.3.0 added nktp, so after the upgrade the candidate resolved a new plan that installs it, and the lane could not pass. This restores the coverage that hold removed.

Fixes: #3856
Related: N/A

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: operator qualify suite (tests/operator/qualify), tools/operator-qualify, release and operator-e2e workflow comments
  • Implementation Notes

    Upgrade scenario (upgradeMidRollout):
    1. Pin the in-flight rollout's plan before the upgrade.
    2. Once the resolver runs the next candidate's AICR (status.aicr.image), remove the component toggles. The new AICR then resolves its whole recipe.
    3. Wait for the rollout to end Succeeded with one sync, as before.
    4. Disable every component of the new recipe except cert-manager, unpin, and roll out the plan that resolves. If the new AICR leaves cert-manager's render unchanged, that is the pinned plan, with no new rollout. When both candidates run the same AICR, a different plan fails the scenario, because a plan's digest leaves out the operator that resolved it. That keeps the upgrade-idempotence check the scenario always had.

    The toggles go before the new recipe is read because a toggle naming a component that recipe lacks stalls resolution ("unknown component"), and the stall holds the rollout. The pin is there so that the plan of the whole recipe, resolved in between, never becomes the target. Without it, the operator opens a rollout that would install every component.

    Rollback scenario (rollbackToInstalled): before helm rollback, pin the active plan and remove the toggles. Without the pin, the older AICR would assess a move to whatever plan it resolves. operations.md documents that an older AICR can reject a recipe written by a newer one, and has administrators pin a plan before lowering AICR. Without removing the toggles, the older AICR rejects any toggle that names a component its recipe lacks ("unknown component"). After the re-upgrade, the scenario restores the saved overrides and selection, and requires them to resolve the active plan again.

    Every assertion about the older operator stays the same: it does not stall, rewrites no plan or rollout, and makes no engine write. They now run once it has resolved the runtime, seen as a new input digest (the operator version is an input) or a stall, followed by the same one-minute settle as before. The older operator now resolves a whole recipe here, which can take longer than that minute. Because the target is pinned, the older AICR assesses no transition here. Pinning an earlier plan and rolling back to it, the full documented procedure, is not exercised.

    Which AICR each side runs (tools/operator-qualify hold_aicr): each candidate runs its own AICR. The exception is when the next candidate's AICR is older than the installed candidate's; then both run the installed one's. That is the case on pull requests today: the published v1.3.0 runs AICR v1.3.0, while the .settings.yaml pin is v1.2.0. Moving to an older AICR requires pinning an earlier plan first, which an operator upgrade does not do. At a release tag the candidate's AICR is the tag's, which is newer, so the gate moves AICR forward as the chart defaults do. A prerelease precedes its release. A candidate whose candidate-values.yaml names no AICR release fails the run. The rule lives in the tool, not in the Makefile, so make operator-qualify and the release lane share it.

    Smaller changes:

  • tools/operator-qualify adds every namespace the checkout's component registry names to the chart's namespaces.components. A resolution that renders a release outside that list stalls with NamespaceNotAllowed, and the new AICR's whole recipe is rendered once. So a component that a release adds in a new namespace also needs no change to the suite.

  • recipeComponents parses a recipe using the AICR version recorded in its plan's provenance, since recipes now come from two AICR releases. AICR_OPERATOR_E2E_AICR_VERSION had no other reader, so it is gone.

  • rollOutTo replaces the approve-if-waiting loop in deploymentValidation's restore. follow reuses it, because a transition that AICR assesses as safe needs no approval.
  • Not in this PR: issue item 4, running this lane against main's AICR before release day. It needs an AICR CLI image built from main, which no workflow publishes. That follow-up is #3892. Release candidate tags already run the forward path days before GA.

    Testing

    The suite runs on kind, not in make test, so each scenario below was run locally on a fresh 2-node kind cluster (Kubernetes newest, pinned Argo CD, in-cluster registry).

    | Run | Upgrade path | Result |
    |---|---|---|
    | Forward, replaying the v1.3.0-rc3 failure: PUBLISHED_VERSION=1.2.0 make operator-qualify-published, candidate built with CANDIDATE_AICR_* = v1.3.0 | v1.2.0 operator on AICR v1.1.2 → this branch on AICR v1.3.0, which adds nktp | 10/10 lifecycle subtests pass (4 fault scenarios skipped by design, as in CI) |
    | make operator-qualify | both candidates on the pinned AICR v1.2.0 | 14/14 subtests pass |
    | Removal: PUBLISHED_VERSION=1.3.0 make operator-qualify-published, with hold_aicr disabled for the run | v1.3.0 operator on AICR v1.3.0 → this branch on AICR v1.2.0, which lacks nktp | 10/10 pass (4 fault scenarios skipped by design) |
    | Removal, with a local, uncommitted change that makes the suite wait for the stale nktp toggle to stall resolution and hold the rollout before removing the toggles | same | 10/10 pass. Resolution stalled with AICRInvalidRequest ... unknown component "nktp", and the rollout was held (no step starts: AICRInvalidRequest). After the toggles went, it ended Succeeded with one sync. |
    | The same stall without the pin, driven by hand with kubectl | branch operator on AICR v1.2.0 | The held rollout still ends Succeeded once the toggles change. The whole-recipe plan then becomes the target, and a rollout to it waits for approval (Stalled=True AwaitingApproval). That is what the pin prevents. |

    In the forward run, AICR v1.3.0 resolved the kind recipe to 16 components, including nktp. With all of them but cert-manager disabled, cert-manager renders as it did on v1.1.2, so the plan kept its digest and no follow-on rollout was needed. The rollback then pinned the active plan; the v1.2.0 operator resolved its own 15-component recipe without stalling, and the restored inputs resolved the active plan again.

    hold_aicr decisions, checked against stub candidates:

    | Installed | Next | Result |
    |---|---|---|
    | v1.3.0 | v1.2.0 (the PR lane today) | both run v1.3.0 |
    | v1.3.0 | v1.4.0-rc1 (a tag) | each runs its own |
    | v1.3.0 | v1.3.0-rc3 | both run v1.3.0 (prerelease precedes its release) |
    | v1.3.0-rc2 | v1.3.0-rc1 | both run v1.3.0-rc2 |
    | v1.3.0 | aicr.version missing | the run exits 1 |

    make qualify                                                    # passes
    golangci-lint run -c .golangci.yaml ./tests/operator/qualify/...  # 0 issues
    shellcheck -x tools/operator-qualify                            # clean
    yamllint -c .yamllint.yaml .github/workflows/on-tag.yaml .github/workflows/operator-e2e.yaml  # clean
    

    No Go package outside tests/ changes, so the coverage gate does not apply.

    Risk Assessment

  • Low: changes only test code, the qualify tool, and comments and docs; no operator or AICR code changes.
  • Rollout notes: the PR lane qualify-published keeps running the published release's AICR on both sides until the .settings.yaml pin reaches the published release. The release gate moves AICR forward from the next tag on. A new recipe that breaks an upgrade on kind for some reason other than a changed component set will fail that gate, as v1.3.0-rc3 did. #3892 tracks catching that earlier.

    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)
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: lalitadithya Review duration: 106m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3893"
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 20.5% · Safe to merge
    20.5%
    Repository