Skip to content

feat(canary): gate :latest tag promotion on canary verify green (Phase 3) - #988

Merged
HongmingWang-Rabbit merged 1 commit into
stagingfrom
feat/canary-gate-latest-tag
Apr 19, 2026
Merged

HongmingWang-Rabbit merged 1 commit into
stagingfrom
feat/canary-gate-latest-tag

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

Closes the canary release loop. Before this, `publish-workspace-server-image.yml` pushed both `:staging-` and `:latest` on every main merge — so the prod tenant fleet auto-pulled every image immediately, before any post-deploy smoke test. A bad image (e.g. today's E2E `current_task` drift, but shipped at 3am instead of caught in CI) would have fanned out to every running tenant within 5 min.

New flow

  1. Main merge → `publish-workspace-server-image.yml` pushes `:staging-` only (NOT `:latest`).
  2. Canary tenants are configured to track `:staging-`; they pick it up on their next auto-update cycle.
  3. `canary-verify.yml` sleeps 6 min, then runs the Phase-2 smoke suite.
  4. On green: new `promote-to-latest` job uses `crane` to remotely retag `:staging-` → `:latest` for both platform and tenant images.
  5. Prod tenants auto-update to the newly-retagged `:latest` within their 5-min window.
  6. On red: `:latest` stays frozen on the prior good digest — prod is untouched. A Step Summary flags which digest was rejected.

Why crane

~4 MB static binary pulled onto the runner, no Docker daemon needed — just a registry API client. A single `crane tag` call per image retags remotely without pulling or pushing layers.

Rollback

If canary passed but something surfaces post-promotion, operator runs `crane tag ghcr.io/molecule-ai/platform: latest` manually. Phase 4 will wrap that in an admin endpoint / `scripts/rollback-latest.sh`.

Test plan

  • Workflow syntax is valid YAML
  • Next main merge: confirm only `:staging-` appears in GHCR initially
  • After canary green: confirm `:latest` retag happens + prod tenants pick it up
  • Canary red path: can only be verified by intentionally breaking an image — TBD in a follow-up test

🤖 Generated with Claude Code

…e 3)

Completes the canary release train. Before this, publish-workspace-
server-image.yml pushed both :staging-<sha> and :latest on every
main merge — meaning the prod tenant fleet auto-pulled every image
immediately, before any post-deploy smoke test. A broken image
(think: this morning's E2E current_task drift, but shipped at 3am
instead of caught in CI) would have fanned out to every running
tenant within 5 min.

Now:
- publish workflow pushes :staging-<sha> ONLY
- canary tenants are configured to track :staging-<sha>; they pick
  up the new image on their next auto-update cycle
- canary-verify.yml runs the smoke suite (Phase 2) after the sleep
- on green: a new promote-to-latest job uses crane to remotely
  retag :staging-<sha> → :latest for both platform and tenant images
- prod tenants auto-update to the newly-retagged :latest within
  their usual 5-min window
- on red: :latest stays frozen on prior good digest; prod is untouched

crane is pulled onto the runner (~4 MB, GitHub release) rather than
docker-daemon retag so the workflow doesn't need a privileged runner.

Rollback: if canary passed but something surfaces post-promotion,
operator runs "crane tag ghcr.io/molecule-ai/platform:<prior-good-sha>
latest" manually. A follow-up can wrap that in a Phase 4 admin
endpoint / script.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit 848f668 into staging Apr 19, 2026
9 checks passed
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
feat(canary): gate :latest tag promotion on canary verify green (Phase 3)
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the feat/canary-gate-latest-tag branch April 24, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant