Title: pkarr-worker(deploy): unrecognized arguments are silently ignored — a typo'd --dry-rnu or --deploy-version=
Open Graph Title: pkarr-worker(deploy): unrecognized arguments are silently ignored — a typo'd --dry-rnu or --deploy-version=
X Title: pkarr-worker(deploy): unrecognized arguments are silently ignored — a typo'd --dry-rnu or --deploy-version=
Description: Problem pkgs/pkarr-worker/deploy.mjs performs no argument validation: it reads only the two spellings it knows and silently ignores everything else on the command line. A misspelled --dry-run, the conventional --deploy-version=
Open Graph Description: Problem pkgs/pkarr-worker/deploy.mjs performs no argument validation: it reads only the two spellings it knows and silently ignores everything else on the command line. A misspelled --dry-run, the ...
X Description: Problem pkgs/pkarr-worker/deploy.mjs performs no argument validation: it reads only the two spellings it knows and silently ignores everything else on the command line. A misspelled --dry-run, the ...
Opengraph URL: https://github.com/developing-today/code/issues/3264
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pkarr-worker(deploy): unrecognized arguments are silently ignored — a typo'd --dry-rnu or --deploy-version=\u003cid> performs a real deploy of HEAD","articleBody":"## Problem\n\n`pkgs/pkarr-worker/deploy.mjs` performs **no argument validation**: it reads only the two spellings it knows and silently ignores everything else on the command line. A misspelled `--dry-run`, the conventional `--deploy-version=\u003cid>` equals form, or any stray flag is dropped without a word — and the script proceeds to make a **real production deploy**. For a deploy tool, an ignored argument is not a cosmetic papercut: the operator believes they asked for a preview (or a rollback to a named version) and instead ships HEAD at 100%.\n\nThis is the sibling of #3252 (a *known* flag ignored on one path): here the flag is never recognized at all, on *every* path.\n\n## Evidence (verified this run, main `f4f800e7`)\n\n- Arg parsing is two lookups and nothing else (`deploy.mjs:39-45`):\n\n ```js\n const args = process.argv.slice(2);\n const dryRun = args.includes(\"--dry-run\");\n const deployVersionAt = args.indexOf(\"--deploy-version\");\n const deployVersion = deployVersionAt >= 0 ? args[deployVersionAt + 1] : null;\n if (deployVersionAt >= 0 && !deployVersion) {\n throw new Error(\"--deploy-version needs a version id\");\n }\n ```\n\n No loop over `args`, no rejection of unrecognized entries. `--deploy-version=\u003cid>` does not match the exact-string `indexOf`, so `deployVersion` stays `null` and the script falls through to the deploy-HEAD flow. A typo'd `--dry-rnu` leaves `dryRun === false`.\n\n- Laptop probe (sha-matched copy of `deploy.mjs`, sha256 `805d407348729bf00a6010a5502b66455d66c559d79d4659a786faf067d80ff9` — same hash as current main; stub `cf`/`bws`/`git` on PATH logging argv, `CLOUDFLARE_ACCOUNT_ID` stubbed, stub `cf workers get` failing so the bootstrap path runs; probe dir `~/git/fleet/probe-2026-10-31-laneB-deployargs/` on the laptop):\n\n - Control `node deploy.mjs --dry-run` → cf log: `cf -q deploy --worker pkarr --tag git-aaaaaaaaaaaa --message … --dry-run`; exit 0; \"dry run: config builds, nothing uploaded\".\n - `node deploy.mjs --dry-rnu` (one transposed letter) → cf log: `cf -q deploy --worker pkarr --tag git-aaaaaaaaaaaa --message …` — **no `--dry-run`**: a real `cf deploy` call. The run then continued to `workers versions list` and stopped only because the stub returned no version; against the real account it would have proceeded to create the 100% deployment.\n - `node deploy.mjs --deploy-version=v-rollback-123` → the named rollback version is never mentioned again; cf log shows the same real bootstrap deploy of HEAD (`git-aaaaaaaaaaaa`). The operator asked to roll back and instead deployed current HEAD.\n - `node deploy.mjs --prod` (unknown flag) → silently ignored; same real deploy of HEAD.\n\n## Why it matters\n\n`deploy.mjs` is the one sanctioned path for shipping and rolling back the pkarr Worker (#1828 standard). Its safety rests entirely on the operator typing exactly `--dry-run` or exactly `--deploy-version \u003cid>` — one typo or the ubiquitous `--flag=value` habit converts a preview or a rollback into a live deploy of whatever HEAD happens to be, with no warning that anything was ignored. Tools that perform irreversible outward actions must fail closed on input they do not understand.\n\n## Acceptance criteria\n\n- [ ] Any argument that is not `--dry-run`, `--deploy-version \u003cid>`, or `--deploy-version=\u003cid>` (if the equals form is supported) aborts before any `bws`/`cf` call, with an error naming the offending argument and the usage.\n- [ ] `--deploy-version=\u003cid>` either works identically to the space form or is refused as above — it must never fall through to deploying HEAD.\n- [ ] A misspelled safety flag (e.g. `--dry-rnu`) can no longer produce a real deploy: covered by the unknown-argument refusal, with a regression test/probe case.\n- [ ] The known-good invocations in the header comment (`deploy.mjs [--dry-run]`, `deploy.mjs --deploy-version \u003cid>`) behave exactly as today (including #3252's dry-run semantics once that lands).\n- [ ] Verification is reproducible with stub `cf`/`bws` on PATH: unknown/equals-form arguments make zero `cf` calls.\n\n## Dedup\n\nSearched open + closed issues for pkarr-worker deploy argument handling. #3252 covers `--dry-run` being ignored *on the `--deploy-version` path* (both flags recognized, one branch drops the check); #3261 is `RETENTION_SECONDS` parsing in `src/index.ts`; #1828/#1829 are the deployment standard and the original implementation. No issue covers unrecognized/misspelled arguments or the `--deploy-version=\u003cid>` form being silently ignored.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-01T00:02:16Z","url":"https://github.com/developing-today/code/issues/3264"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fcd41cc5-99be-2696-040e-9c1192526f6f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D91E:43776:8D8CA7:BC2FA4:6B06347D |
| html-safe-nonce | 211b50ff4e15b3024de514a85b659454285d6f58e5732b730d74030586fff4b0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTFFOjQzNzc2OjhEOENBNzpCQzJGQTQ6NkIwNjM0N0QiLCJ2aXNpdG9yX2lkIjoiNzQyMzExMzk1NjU0MzU3NTE2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 632bb788d33f8dcfd78ab5b59512d94eff90f85db8c59e8c0f2982aab9ee3041 |
| hovercard-subject-tag | issue:6141223655 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/3264/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f5f18ebf89c32a06c70d1767c66465ec2a73ce58500e47efa9123ceeec051050/developing-today/code/issues/3264 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f5f18ebf89c32a06c70d1767c66465ec2a73ce58500e47efa9123ceeec051050/developing-today/code/issues/3264 |
| og:image:alt | Problem pkgs/pkarr-worker/deploy.mjs performs no argument validation: it reads only the two spellings it knows and silently ignores everything else on the command line. A misspelled --dry-run, the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9eb3bb1597d09170a5f282cd38ae376dee1a5ec1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width