Gate production promotion and rollback behind a GitHub-identity allowlist - #5
Merged
Conversation
On a `released` event the release pipeline no longer runs `wrangler versions deploy`; it posts a Slack message asking a Cloudflare admin to promote the already-staged version by hand, with the release link, dashboard link, and exact CLI commands. Production promotion cannot be gated by GitHub environment protection (unavailable on private non-Enterprise repos) and the Cloudflare token cannot be scoped to forbid version deploys, so removing the automated path is the available control. Documented as a process control, not a hard one: app-rollback.yml's prod path still carries the same deploy capability by design (emergency traffic shift). Also adds a security-focused CLAUDE.md and a CODEOWNERS assigning the deployment/secret-sensitive paths to a designated reviewer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017jj24BNHVr8gQX2mhgHWLT
gregory-kf
approved these changes
Aug 4, 2026
…otion # Conflicts: # .github/workflows/app-build-deploy-release.yml
gregory-kf
approved these changes
Aug 17, 2026
Adopts centrifuge/backend's activate-production model. On `released` the pipeline still only notifies, but the Slack message now carries a `gh workflow run promote-production.yml -f tag=...` command instead of raw wrangler instructions: promotion happens through the new app-promote-production.yml reusable workflow, dispatched by an actor in the caller repo's AUTHORIZED_DEPLOYERS variable (empty fails closed), from main only, with the tag verified to be on main, and both failed attempts and successful promotions announced to Slack. app-rollback.yml gains the same allowlist gate — previously any repo write user could shift production traffic by dispatching a rollback. Its authorized-deployers input is optional only for parse-compat with callers already on main; empty refuses to roll back at runtime, so rollback fails closed until the app callers pass the variable. This ties promotion to a GitHub identity with a native audit trail and removes the need for humans to hold Cloudflare prod tokens for routine releases. Still a process control: token holders can promote out-of-band and repo admins can edit the allowlist — documented in the workflow headers, README, and CLAUDE.md.
gpmayorga
marked this pull request as ready for review
August 18, 2026 11:20
ARR552
approved these changes
Aug 18, 2026
gregory-kf
approved these changes
Aug 18, 2026
2 tasks
Keep the prod-promotion gate focused on workflows, CODEOWNERS, and README; docs land separately in #11.
Collaborator
Author
|
Split |
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.
What
Production promotion moves from "a Cloudflare admin runs wrangler by hand" to a GitHub-gated dispatch flow mirroring centrifuge/backend's activate-production model:
releasedevent →app-build-deploy-release.ymlstill does not deploy. It posts a Slack notification carrying the promotion command (gh workflow run promote-production.yml --ref main -f tag=<TAG>) and a link to the dispatch page.app-promote-production.yml(workflow_call, dispatched via each app's thinpromote-production.ymlcaller):authorizejob: must be dispatched frommain(the workflow YAML on main is the trust root), and the actor must appear in the caller'sAUTHORIZED_DEPLOYERSrepository variable, passed as theauthorized-deployersinput — empty fails closed. Failed attempts are announced to Slack.promotejob (environment: production): verifies the tag's commit is onmain, resolves the Worker version staged for the tag (versions listbyworkers/tagannotation), shifts traffic (versions deploy <id>@100%), announces to Slack, and notifies on failure with a reason.app-rollback.ymlgains the same allowlist gate — previously any repo write user could shift production traffic by dispatching a rollback.authorized-deployersis declared optional purely for parse-compat with callers already onmain; an empty value refuses to roll back at runtime. Optionalslack-webhook-urlsecret for failed-attempt alerts.Also adds a
CODEOWNERS(deployment/secret-sensitive paths →@gpmayorga/@hieronx/@gregory-kf) and updates the README for the new model. Security-focusedCLAUDE.mdguidance lives in #11.Why
GitHub environment protection (required reviewers) is unavailable on private non-Enterprise repos, and the Cloudflare token cannot be scoped to forbid version deploys. The previous notify-only approach removed the unattended path but left rollback ungated and promotion un-audited. This model:
It remains a process control, not a hard control: anyone holding a Worker-deploy-capable token can promote out-of-band, and repo admins can edit the allowlist variable. The hard boundary — repo access + branch protection + CODEOWNERS on
.github/workflows/**— is handled repo-settings-side.Contract changes (callers must update)
app-build-deploy-release.yml: new required secretslack-webhook-url; new optional inputsproduction-worker-name,production-url;production-urloutput removed; the notification links to the caller'spromote-production.yml(name the caller exactly that).app-promote-production.yml(new): inputstag,app-name,production-worker-name,cloudflare-account-id,authorized-deployers, optionalproduction-url; secretscloudflare-api-token,slack-webhook-url.app-rollback.yml: new inputauthorized-deployers(parse-optional, runtime fail-closed), new optional secretslack-webhook-url.AUTHORIZED_DEPLOYERSis created.Rollout / merge order
@mainbefore merging.AUTHORIZED_DEPLOYERSrepository variable (comma-separated GitHub usernames) before the first promotion or rollback.Verification
lib-ci) clean; callerwith:/secrets:keys cross-checked against theworkflow_callcontracts of both consumer PRs.