ci(stack): check migrations against the proposed stack version bump - #1983
Draft
kristinapathak wants to merge 1 commit into
Draft
kristinapathak wants to merge 1 commit into
kristinapathak wants to merge 1 commit into
Conversation
The upgrade contract is that a customer installs each stack major version in order, derived from the version numbers alone so nothing has to publish a catalog or maintain a floor per release. What that rule needs in exchange is that a major boundary is actually cut whenever a candidate contains something a customer cannot safely skip past. That is not decidable by eye. A stack-pin diff is a list of chart versions moving, and nothing in "1.5.3 -> 2.0.0" says a migration landed. In a monorepo the evidence is computable instead, which also means it cannot be forgotten the way a declaration written in a pull request months earlier can. Additive migrations never qualify: golang-migrate applies the ordered set per keyspace, so a cluster many versions behind still arrives at the right schema. Destructive migrations and deleted migration files do, because a drop is unrecoverable without a restore and a deleted migration is how a compatibility bridge stops shipping. Comments are stripped before classifying. nvcf_api/03_init_tables.up.sql documents a "high-churn write/delete workload" above a CREATE TABLE, and a classifier reading raw text calls that destructive. Run over the current corpus the classifier finds exactly the four real drops and leaves the other 38 files additive. The baseline is the stack's last release tag rather than the pinned migrations image, because the stack does not pin that image yet (#1976). Refs #1975 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First piece of #1974. Closes #1975.
Summary
tools/stack-upgrade-policy, a Go tool that reports the schema migrations a stack release candidate introduces since that stack's last published release tag, and fails when they do not match the version bump the candidate is proposing.tools/ci/check-stack-upgrade-policy, the bash entrypoint, mirroringtools/ci/chart-service-edge.migration_pathsfornvcf-self-managed-stackin the existing release metadata rather than adding a new per-stack config file. The compute-plane and observability stacks declare none, so the check is an explicit no-op for them until they ship schema.pull_request-only matrix job over all three stacks inbuild-test.yml.Why this shape
The upgrade contract is that a customer installs each stack major version in order, derived from the version numbers alone — no published catalog, no floor field to maintain per release. What that rule needs in exchange is that a major boundary actually gets cut whenever a candidate contains something a customer cannot safely skip past.
That is not decidable by eye. A stack-pin diff is a list of chart versions moving, and nothing in
1.5.3 -> 2.0.0says a migration landed. In a monorepo the evidence is computable, which also means it cannot be forgotten the way a declaration written in a PR two months earlier can.Additive migrations never qualify.
golang-migrateapplies the ordered set per keyspace, so a cluster many versions behind still arrives at the right schema; skipping stack versions never skips schema migrations.Destructive migrations and deleted migration files do. A drop is unrecoverable without a restore, and a deleted migration is how a compatibility bridge stops shipping — once it is gone, a cluster arriving later has no way to run it.
The proposed bump comes from the existing
tools/ci/release-bump-type, so this and semantic-release agree on what the candidate is proposing rather than deriving it twice.Known limitations
.sqlfiles under the declared paths. Component-side async backfill tasks live outsidemigrations/and are not detected yet.Test plan
go test -C tools/stack-upgrade-policy ./...tools/ci/check-go-tools:ok tools/stack-upgrade-policy (built, vetted, tested)nvcf_api/03_init_tables.up.sqldocuments a "high-churn write/delete workload" above aCREATE TABLE, and a classifier reading raw text calls that destructive.nvcf_api/07_drop_gpu_spec,nvcf_autoscaler/04_drop_obsolete_function_tables,nvct_api/05_drop_health_info,nvct_api/06_delete_health_udt) and leaves the other 38 files additive.nvcf-self-managed-stack: 0 migration change(s) since deploy/stacks/self-managed/v1.0.0, exit 0; observability reports no migration paths, exit 0.gofmt,go vet, andactionlintclean.🤖 Generated with Claude Code