← Back to Pull requests

fix(upgrade): report undefined-origin for sources no record covers #3394

Closed
unknown closed this pull request without merging on Oct 28, 2026 15:13 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 21:52 UTC
Author

Summary

upgrade-check now reports undefined-origin when no record's from covers the source version, instead of multiple-boundaries or record-blocks telling the operator to upgrade to a floor that nothing describes the hop to.

Motivation / Context

From below every recorded starting point, a jump crossing two boundaries said "Upgrade to <first floor> first". No record describes that hop either, so checking it on its own lands on the same question. The MariaDB components reproduce it today: from 25.10.0 to 26.10.1, mariadb-operator and mariadb-operator-crds report multiple-boundaries with "Upgrade to 26.10.0 first".

Fixes: #3138
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: pkg/upgrade (verdict selection behind aicr upgrade-check)
  • Implementation Notes

  • New selection rule 3 in matchVersions: when no record's from covers the source, crossed or not, the result is blocked / undefined-origin. StoppedAt is the lowest crossed record's to, and the explanation names the earliest recorded starting point when the source sits below it. It outranks record-blocks and multiple-boundaries because both tell the operator to upgrade to their stop first, and that hop starts from the same undescribed origin.

  • The check looks at every record, not only crossed ones. A record outside the jump that covers the source keeps the previous verdict, so the sentence "no record describes an upgrade starting from X" stays true.

  • Sources that some record covers get the same verdicts as before. By well-formedness rule 3 (no holes between from domains), the new rule only fires below the earliest origin or above the pin.

  • crossingPhrase is shared by the multiple-boundaries and undefined-origin explanations. The multiple-boundaries text is unchanged.

  • ADR-021's selection order, the package doc, cli-reference.md and upgrading.md are updated to the new order. Tests use synthetic fixtures only.
  • Out of scope: older, related problems where some record does cover the source (shared to floors, and stops no record reaches) are tracked in #3397.

    Testing

    make qualify
    go test -race -count=1 ./pkg/upgrade/...
    golangci-lint run -c .golangci.yaml ./pkg/upgrade/...
    

    make qualify on macOS:

  • Shell tests, the -race Go suite, lint (0 issues), tuning-check, coverage-check, e2e (31 passed), scan and license-check pass. The shell and release-script tests needed a local GNU timeout stand-in, since macOS ships none.

  • One local-only failure: pkg/oci TestHelmPinnedVersionExplicitVersionPull wants the pinned helm v4.3.1, and this machine has v4.2.0. Unrelated to this diff.

  • api-diff and openapi-diff did not run (apidiff and oasdiff are not installed). The diff adds and changes only unexported functions and touches nothing under api/ or pkg/client/.
  • pkg/upgrade coverage: 97.8% → 97.8% (0.0%).

  • New table cases cover rule 3 with several crossed records, with an authored block among them, with a lone crossed block, and the counter-cases where a record outside the jump covers the source. Mutating anyFromCovers to look only at crossed records, or dropping the origin guards on the two multiple-boundaries exemptions, fails the suite.

  • Reproduced on the CLI with minimal recipes pinning the MariaDB components at 25.10.0 and 26.10.1 (aicr upgrade-check --from <recipe> --to <recipe> --deployer helm). Before: multiple-boundaries, "Upgrade to 26.10.0 first". After: all three components report undefined-origin, naming 26.3.0 as the earliest recorded starting point. From 26.3.0 and 26.10.0 the output is identical before and after.
  • 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. Only jumps from a source no record covers change, and they stay blocked with a different reason and stop.

    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: 650 lines (+487 / -163) across 8 files Reviewer: yuanchen8911 Review duration: 6800m
    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 #3394"
    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