π make same-schema releases deployable, and derive umbrella subchart packaging - #686
Merged
Merged
Conversation
Every umbrella dependency is a file:// chart in this repository, so the checked-out commit already fixes the exact sources. The umbrella now declares open version constraints and the deploy fixture packages the current sources at render time; the checked-in Chart.lock and vendored archives are gone, and a chart version bump no longer requires touching the umbrella at all. The release gate keeps the one invariant that can still drift: every chart-bearing application must stay declared as an umbrella dependency.
Two contracts render the repository chart directory rather than the disposable fixture, so removing the vendored archives left them without a charts/ directory. A shared helper packages the in-repo subcharts on demand; charts/ and Chart.lock are derived and gitignored, so writing them during a contract run is the intended model.
A release that changes no schema resolves to kind=current with no migration, but a live database that reached that schema through a real migration still records the transition, and the privileges Job compares the database against exactly that record. The old fallback re-resolved the transition against the release's own previous version β another same-schema hop that returned null again β so the Job saw no evidence and failed closed. Every same-schema patch was therefore undeployable to an already-migrated silo, which is what blocked testv4 0.9.1 -> 0.9.2. resolveSchemaLineage walks the release chain to the release that owns the migration producing the current schema and returns its recorded evidence. The transition stays current: no migration is proposed, no adjacency policy is relaxed, and the reported history deliberately does not authorise a carry-forward override.
The lineage resolver hands the deploy engine the owning release's evidence for a release that changes no schema, which routes the current-release path through the live convergence classifier where it used to skip it. Cover both shapes a silo can be in under that evidence: bootstrapped fresh at the current baseline with no history, and migrated into the schema by an earlier release. CI now proves both stay deployable instead of reading incompatible.
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.
Two related deploy-path fixes: the one that makes 0.9.2 deployable at all, and the one that removes the chart-pin ceremony. Reopens the work from the closed #681 with the deploy fix added.
1. Same-schema releases are undeployable to a migrated silo (fixes #685)
Deploying 0.9.1 β 0.9.2 to
testv4failed at the PostgreSQL privileges Job:apps/postgres/helm/templates/database-privileges-job.yamlaccepts two database life-histories: a fresh install whose recorded origin equals the current release's protected baseline, or a migrated database proven against deploy-supplied previous-migration evidence.testv4is neither: it legitimately reached schema 0.9.0 through the reviewed0.8.0-to-0.9.0migration, so its recorded origin is the older protected baseline and it needs the second path β but the deploy supplied no evidence.Why no evidence: 0.9.1, 0.9.2 and 0.9.0 all declare schema
0.9.0, soresolveDatabaseTransition(0.9.2, 0.9.1)correctly returnskind=current, migration=null. The old fallback ink8s-deploy.shthen re-resolved the transition against 0.9.2's ownpreviousRepositoryVersion(0.9.1) β another same-schema hop returningnullagain β and gave up. Every same-schema patch train was therefore undeployable to any already-migrated silo.Two things I verified rather than assumed, both of which invalidated the first proposed fixes:
resolve(0.9.2, 0.8.1)errors withautomatic database migration requires exact previous release '0.9.1', and it also requires the release version to equal the rootpackage.jsonversion. So "walk back and re-resolve" is not implementable, and the--from-release-version 0.8.1workaround cannot run at all.The fix adds
resolveSchemaLineage(repositoryRoot, releaseVersion), which walks the release chain to the release that owns the migration producing the current schema and returns that migration's recorded evidence, exposed throughscripts/release-versioning/schema-lineage.mjs.k8s-deploy.shcalls it only when the transition iscurrentwith no migration of its own.Proof against the real chain:
12505f3cβ¦is exactly the origin digesttestv4's database records, which is the value the Job's convergence gate compares against.Deliberate constraints: the transition stays
current(no migration is proposed or executed), the adjacent-minor policy is untouched, the convergence gate is not loosened, and the returned history setscarriedForwardThroughReleaseVersion: nullso reporting history can never authorise a carry-forward override. The fresh-install path is unaffected β the fallback is gated onkind == current.2. Derive umbrella subchart packaging (was #681)
Every subchart version bump required three synchronised edits β the umbrella
Chart.yamlpin,Chart.lock, and the vendoredcharts/*.tgzβ and a missed one blocked CI and deploys. All 15 umbrella dependencies are in-repofile://charts, so the checked-out commit already fixes their sources; the pin ceremony recorded nothing git did not already hold.">=0.0.0-0"), always accepting the version each app currently declares.Chart.lockandcharts/*.tgzare deleted and gitignored; packaging is derived at render time.validateUmbrellakeeps the one invariant that can still drift β every chart-bearing application must stay declared as an umbrella dependency β and drops the pin/lock/archive comparisons.ensure_umbrella_chart_dependencieshelper.External bootstrap charts stay pinned by version and digest; this changes in-repo charts only.
Validation
node scripts/release-versioning/schema-lineage.mjs . 0.9.2returns the0.8.0-to-0.9.0evidence including the digesttestv4recordstest:release-versioning51/51, including two new tests: lineage recovery for a same-schema release, and no lineage for a schema never migrated intorun-helm-contracts.sh21/21 from a clean checkout withcharts/andChart.lockdeleted first (the earlier β‘ derive umbrella subchart packaging from in-repo sourcesΒ #681 run passed only because stale archives lingered on disk β that mistake is why this was re-validated from scratch)check:release-versioning --base origin/developPASS; shell syntax checkedtest:database-migrationsneeds a local Docker daemon (removed with Colima today), so CI owns that proofNext
Once merged, retry the
testv40.9.1 β 0.9.2 deploy β the silo is still serving a server image that predates the merged conversation-response-parser fix (#670), which is the "Chats are unavailable" symptom.