Skip to content

github-backup(deploy): the version advertised for rollback is the pre-secrets version, and --deploy-version never provisions secrets #3475

Closed

Description

@dezren39

Finding (from PR review)

Codex P2 on PR #3280 (chatgpt-codex-connector[bot], 2026-11-01T01:33:18Z): "Include secrets in the version advertised for rollback" — #3280 (comment)

On a fresh Worker, the tagged version is uploaded before either required secret exists. This subsequent call changes the deployed version: Cloudflare documents that wrangler secret put "creates a new version of the Worker and deploys it immediately." Consequently, the version ID printed as live below is not the final secret-bearing version. The --deploy-version path deploys that advertised ID without provisioning secrets, so it does not restore the working configuration: the tagged bootstrap version lacks the bearer token required by /queue and the HMAC secret required by /github. Include the secrets before selecting the tagged deployment version, or retain and advertise the final configured version for rollback.

(Secret names only — no values are involved in this issue: the Worker secrets are DRAIN_BEARER and GITHUB_WEBHOOK_SECRET, provisioned from Bitwarden by name in setWorkerSecrets().)

No-response evidence

Still-live evidence (verified this run, current main)

infra/github-backup/worker/deploy.mjs (current main), normal deploy flow:

  1. versions upload → tagged version.id
  2. createDeployment(version.id) (when not already live)
  3. setWorkerSecrets() — each wrangler secret put creates and deploys a NEW version, per Cloudflare's documentation
  4. reportLive() + console.log("live: ... at version ${version.id}") — advertising the pre-secrets version id as the live/rollback target

And the --deploy-version branch (createDeployment(deployVersion); reportLive(); process.exit(0)) never calls setWorkerSecrets() at all, so rolling back to the advertised bootstrap version restores a Worker with no DRAIN_BEARER / GITHUB_WEBHOOK_SECRET: /queue auth and /github HMAC verification both fail.

Dedupe

Searched open and closed issues for "github-backup rollback version secrets" (2026-11-01): no issue covers this.

Acceptance criteria

  • The version advertised as live/for rollback is the final secret-bearing version (secrets provisioned before the tagged deployment version is selected, or the final configured version is retained and advertised).
  • The --deploy-version rollback path provisions (or verifies) the required Worker secrets as part of restoring the working configuration.
  • Or the finding is resolved by a documented decision on this issue.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 1, 2026
  2. developing-today commented on Nov 1, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: OpenCode scheduled lane 2026-11-01; queue task 5419 (triage, attempt 1)
    • Found via: claimed from repo-health-code-pilot queue
    • Task: Verify whether the advertised rollback version includes the required secrets and whether the rollback path restores them; route any remaining fix.
  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 1, 2026
  6. 15 remaining items

  7. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 1, 2026
  9. added 2 commits that reference this issue on Nov 1, 2026
  10. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: repo queue worker lane C (repo-worker-code)
    • Task: queue task 5425 (small_fix) — DONE, PR github-backup(deploy): advertise the configured version as the rollback target (#3475) #3510 merged (f5f612871), this issue closed by the merge.
    • What changed: normal deploy flow re-reads the live deployment after secret provisioning and advertises the final configured version as the rollback target; --deploy-version verifies the target's secret bindings first (wrangler versions view) and refuses unconfigured targets before any traffic switch, naming the roll-forward remedy.
    • Codex round: P1 finding verified against pinned Wrangler 4.147.0 source and dispositioned on the PR thread (ordinary secret put hard-errors VERSION_NOT_DEPLOYED in the rollback state; versions secret put patches the latest version only) — the verify-first design is the fix. Re-review completed with no unresolved findings.
    • Tests (laptop, stubbed, no live deploy): new rollback suite 16/16; existing dry-run 11/11, drain-queue 54/54, inventory 18/18, reconcile 9/9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/github-backupinfra/github-backup estate mirror systemeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-comment-reviewFiled by the pr-comment-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions