Skip to content

pkarr-worker(deploy): --dry-run is ignored on the --deploy-version path — a rollback preview creates a real 100% deployment #3252

Open

Description

@dezren39

Problem

pkgs/pkarr-worker/deploy.mjs ignores --dry-run on the --deploy-version (rollback / redeploy) path: the flag combination that should be the safest way to preview a rollback instead creates a real Cloudflare deployment at 100%.

Evidence (verified this run, main 5e08e198)

  • Arg parsing is global: deploy.mjs:40-45 — dryRun = args.includes("--dry-run"), deployVersion from --deploy-version <id>.

  • The deploy-version branch runs before any dry-run handling and never checks dryRun (deploy.mjs:84-88):

    if (deployVersion !== null) {
      createDeployment(deployVersion);
      reportLive();
      process.exit(0);
    }

    createDeployment (deploy.mjs:161-170) unconditionally runs cf workers deployments create --strategy percentage --versions [{version_id, percentage: 100}].

  • Both other paths honour the flag: the bootstrap path pushes --dry-run into cf deploy and exits (deploy.mjs:99-105), and the versions path pushes --dry-run into cf workers versions create and exits (deploy.mjs:118-124). The deploy-version branch is the only one that drops it.

  • Laptop probe (sha-matched copy of deploy.mjs, sha256 805d407348729bf00a6010a5502b66455d66c559d79d4659a786faf067d80ff9, stub cf/bws on PATH, CLOUDFLARE_ACCOUNT_ID stubbed; probe dir ~/git/fleet/probe-2026-10-31-laneA-pkarr-dryrun/ on the laptop):

    • node deploy.mjs --dry-run --deploy-version v-rollback-123 → stub cf log records a real call: cf -q workers deployments create --worker pkarr --strategy percentage --versions [{"version_id":"v-rollback-123","percentage":100}], exit 0.
    • Control node deploy.mjs --dry-run → cf receives only workers get and workers versions create ... --dry-run; no deployment is created. The flag works everywhere except this branch.

Why it matters

--dry-run is the safety affordance for the deploy tool, and --deploy-version is the rollback path — the moment an operator is most likely to reach for a preview before committing. The combination silently doing the live thing (100% traffic shift to the named version) is worse than having no dry-run at all: it teaches the operator the preview was clean when in fact the rollback already happened.

Acceptance criteria

  • deploy.mjs --dry-run --deploy-version <id> creates no deployment: it prints what it would do (worker, version id, 100%) and exits 0 without calling deployments create.
  • The non-dry-run --deploy-version path is unchanged (creates the deployment, then reports live deployments).
  • Unknown/conflicting argument handling is not weakened: --deploy-version with no id still errors.
  • A regression test (stub cf/bws, as in the probe) covers all three paths: plain --dry-run (no create), --deploy-version (create), and --dry-run --deploy-version (no create) — the third fails on current code.

Related: #1828 / #1829 (the deployment standard this script implements; the deployable-shape and strategy fixes landed today in #3241/#3242/#3244 — this branch was not touched by them).

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: filed

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a, 2026-10-31 18:05 CDT run
    • Found via: filed this run
    • Task: Filed after verifying on the laptop (sha-matched deploy.mjs, stub cf/bws) that --dry-run --deploy-version creates a real deployment while plain --dry-run does not
    • Expectation: effort/xs — guard the deploy-version branch on dryRun, print the would-be deployment, exit 0; stub-cf regression test for all three paths
    • Links: pkgs/pkarr-worker/deploy.mjs:84-88; probe ~/git/fleet/probe-2026-10-31-laneA-pkarr-dryrun/ (laptop)
  3. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    Adopted as Phase 1 of design #3352 (with #3264 — same file: corollary 4, a parsed safety flag is honoured on every path). The design records the contract this issue's fix must follow: every argument is accounted for before any side effect; unknown/typo'd arguments are a usage error naming the argument (exit non-zero, 2 where no usage code is established) before any subprocess/network/file/lock/deploy step. Triage: do NOT re-file, re-scope or split this issue — record the phase structure and verdict, and keep this issue's own acceptance criteria as the phase's acceptance. Design doc: files/designs/code-operator-argument-contract.md (keep-the-four-repos-healthy goal workspace).

  4. 23 remaining items

  5. added
    queue/queuedHas a queued task in the Supabase agent queue
    and removed
    queue/blockedQueue or user escalation state
    on Nov 3, 2026
  6. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: reviewed (coverage loop-back)
    Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 5685 (small_fix, queued, priority 70) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
    Found via: coverage loop-back 2026-11-03

  7. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: picked-up
    queue: repo-health-code-pilot
    task: 5685 (small_fix, worker repo-worker-code, OpenChamber scheduled lane ec118cad-0fd3-4652-91c4-27432f2f2efd), attempt 3
    by: openchamber-scheduled-lane
    at: 2026-11-04T08:19:10Z

    Revalidated before any file changes. Issue #3252 remains OPEN. The combined packet also requires #3264 to close in the same PR, but #3264 is already CLOSED by merged PR #4946 (fix(pkarr-worker): fail closed on unrecognized deploy arguments). The packet's prior claim that both issues are open and that the parser remains in deploy.mjs is stale; I will block this packet as packet_defect rather than improvise a narrower implementation. No files changed and no PR created.
    labels: queue/claimed + status/in-progress + work/assigned remain until the block transition.

  9. added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 4, 2026
  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: blocked
    queue: repo-health-code-pilot
    task: 5685 (small_fix, worker repo-worker-code, OpenChamber scheduled lane ec118cad-0fd3-4652-91c4-27432f2f2efd), attempt 3
    by: openchamber-scheduled-lane
    at: 2026-11-04T08:20:00Z

    Blocked as packet_defect. Fresh GitHub: #3252 remains OPEN; #3264 is CLOSED by merged PR #4946. Task 5685 still requires both issues to close in one PR and carries stale parser evidence, so it cannot be executed as written. No code changed and no PR opened. The packet must be corrected to the remaining #3252 requirement and current source structure before requeue.
    labels: queue/blocked + status/blocked; work/assigned, queue/claimed, and status/in-progress removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/pkarr-workerpkgs/pkarr-workereffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)queue/blockedQueue or user escalation statesource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus/blockedQueue or user escalation statetask/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