Repository navigation
fix(pkarr-worker): honor --dry-run on the --deploy-version path (#3252) - #8483
Conversation
deploy.mjs created a real 100% deployment for --deploy-version <id> --dry-run because the branch never checked the parsed dryRun flag (contract rule 4 of #3352: a parsed safety flag is honored on every path). The branch decision now lives in the testable deploy-version.mjs helper, in the family style of deploy-probe/deploy-verification: on dryRun it reports the would-be deployment (worker, version id) and returns before createDeployment is reachable; without dryRun it deploys exactly as before (create, verify/report, live line). Tests cover the flag x path matrix: dry-run performs no createDeployment/reportLive call, the plain path calls both once in order, and the parseArgs matrix drives preview only when --dry-run is parsed.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🤖 Agent note · shepherd review — merging (task 14841, issue #3252)
|
Summary
Fixes #3252 (contract rule 4 of #3352: a parsed safety flag is honored on every path).
deploy.mjs --deploy-version <id> --dry-run— a rollback preview — created a real 100% deployment, because the deploy-version branch never checked the parseddryRunflag. Both HEAD paths honor--dry-run(they pass it tocf); the deploy-version branch creates the deployment itself, so nothing downstream could honor it.Change
deploy-version.mjshelper (family style ofdeploy-probe.mjs/deploy-verification.mjs, withdeploy-version.d.mts):deployExistingVersion({ dryRun, deployVersion, worker, workerUrl, createDeployment, reportLive, log }). OndryRunit reports the would-be deployment (worker, version id) and returns beforecreateDeploymentis reachable; without it, it deploys exactly as before (create → verify/report → live line, same messages).deploy.mjs: the branch delegates to the helper; header usage documents the preview form.deploy-args.mjs: USAGE line shows--deploy-version <id> [--dry-run](parsing already accepted the combination deliberately, per the pkarr-worker(deploy): --dry-run is ignored on the --deploy-version path — a rollback preview creates a real 100% deployment #3252 comment inparseArgs).Tests
New
test/deploy-version.test.tscovers the flag × path matrix:--deploy-version+--dry-run:createDeploymentandreportLiveare never called; the preview names the worker and version id.--deploy-versionalone: both called once, in order, with the version id; the live line is unchanged.parseArgsmatrix (separate-value and=forms, flag before/after) drives preview only when--dry-runis parsed.Verified on the laptop:
npm testinpkgs/pkarr-worker— 5 files, 64/64 tests pass (including the 3 new ones);npm run typecheck(tsc --noEmit) clean.Queue: task 14841, lane code-f.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.