Repository navigation
Conversation
A bake started from POST /api/admin/bake now lands on the `unstable`
channel, which no buyer gets. POST /api/admin/bake/{id}/promote (called by
the harness after a green smoke clone) moves it to `latest`; the previous
`latest` becomes `stable`. Clone and validate resolve `latest`, then
`stable`, then the newest ungated snapshot, so stacks baked before this
change (and by the `bake` binary) keep working.
- migration: baked_snapshot_channels (pointer per stack/provider/channel),
baked_snapshots.gated, Casbin rule for the promote route
- db::bake_registry: point, state, promote (one transaction, pointers
locked; only the current `unstable` can be promoted; a repeat is a no-op)
- `gated` keeps a bake whose smoke failed hidden after the next bake
replaces the `unstable` pointer
Tests: tests/bake_channels.rs (written failing first).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Re-verification: the test run I re-did just before committing this PR was silently skipped, because the local test Postgres had gone down when the disk filled up. Re-run today against real Postgres, with no skips: |
This branch has not been deployed
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.
Stage 4 of
config/docs/BAKE_PIPELINE_PLAN.md.Problem. Clone picks the newest healthy snapshot. A fresh bake reaches buyers immediately, whether or not its smoke clone passed.
Change
20261026100000_baked_snapshot_channels:baked_snapshot_channels: one pointer per stack/provider/channel (unstable/latest/stable);baked_snapshots.gated;group_admin,admin_service).POST /api/admin/bakerecords the snapshot as gated and pointsunstableat it, in one transaction.POST /api/admin/bake/{id}/promote(bake job id). After a green smoke clone it moveslatest ← unstableandstable ← old latest, usinghelpers::bake_registry::promote_ladder.unstablecan be promoted: 409 otherwise, and 409 while the bake is not done.baked_snapshot::resolve/resolve_latest(clone and validate) picklatest, thenstable, then the newest ungated healthy snapshot.bakebinary, are ungated, so existing Quick Deploy links behave as before.gatedexists (not in the plan): without it, a bake whose smoke failed would lose itsunstablepointer at the next bake and become "newest healthy". There is a test for this.Tests.
tests/bake_channels.rs, 4 tests, written failing first:Unchanged and green:
admin_bake,migration_boot_contract,quick_deploy_server_type, and--lib(2302).clippyreports nothing in the changed files.Follow-up, not in this PR.
awesome-selfhosted-stackerscripts/bake_pipeline.pymust call/promoteafter a green smoke clone. Until then, new API bakes stay onunstableand are not served.🤖 Generated with Claude Code