Repository navigation
queue-transport-alert: deploy through the cf versions flow - #12023
Conversation
The broker alert Worker deployed with plain `wrangler deploy` and then `wrangler secret bulk`. It now follows the repo's Worker deployment standard, as pkarr-deploy does: cloudflare.config.ts is the deploy config, and `nix run .#queue-transport-alert-deploy` uploads a version tagged git-<sha12> with its secrets read from stdin, deploys it at 100%, applies the cron trigger, and checks the deployment and /status.json. --deploy-version <id> rolls back to an older version without uploading. cf/config and wrangler (cf's build bridge for a plain-JS Worker) are linked into the staged package from the Nix store, so a deploy runs no npm install. wrangler.jsonc stays for `wrangler dev`; a test keeps the two configs in step. Refs #6369 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
|
Caution Review failedThe pull request is closed.
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. |
Copies of the Nix store package keep read-only modes, so removing the stage after a deploy failed with EACCES. chmod it writable after the copy and only warn if cleanup still fails. Refs #6369 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0442ef17be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| throw new Error(`post-deploy check failed: expected version ${versionId} at 100%, latest deployment serves ${serving.serving}`); | ||
| } | ||
| const url = `${WORKER_URL}/status.json`; | ||
| const response = await fetch(url, { headers: { "user-agent": BROWSER_UA }, signal: AbortSignal.timeout(15_000) }); |
There was a problem hiding this comment.
Use the default User-Agent for deployment verification
The post-deployment health check forces a Chrome User-Agent on its only HTTP probe, so a successful response does not establish that the endpoint works for ordinary automated clients when access behavior varies by User-Agent. Remove the override from this verification request. This directly violates the rule in AGENTS.md against altered-User-Agent application checks and treating their success as evidence of ordinary-client behavior.
AGENTS.md reference: AGENTS.md:L14-L16
Useful? React with 👍 / 👎.
| { | ||
| writeShellApplication, | ||
| bws, | ||
| cf, |
There was a problem hiding this comment.
Supply the new cf dependency in the deploy registry
Adding this required argument also changes the contract of the existing call in pkgs/deploy/default.nix:49-51, but that caller still supplies only queueTransportAlert. The registry uses an unmodified nixpkgs scope (lib/default.nix:1389-1392), while this Cloudflare CLI is provided by the repository-local pkgs/cf package, so registry evaluation now fails with the missing cf argument. Because the registry serializes every service's package, this prevents the entire packages.deploy CLI from building, not just queue-transport-alert. Inject the local cf package at the registry call site as well, following the adjacent pkarr deployment definition.
Useful? React with 👍 / 👎.
Before:
nix run .#queue-transport-alert-deployran plainwrangler deployand thenwrangler secret bulk, so each deploy went straight live with no tagged version to roll back to, and setting secrets created a second, untagged deployment.After: the same command uses the
cfCLI's versions flow, likepkarr-deploy. It uploads a version taggedgit-<sha12>with its secrets, deploys it at 100%, applies the cron schedule, and checks that the latest deployment serves it and/status.jsonanswers.-- --deploy-version <id>rolls back to an older version as it was, and-- --dry-runbuilds without uploading.How:
cloudflare.config.tsis the deploy config: vars, the*/10cron, theTransportStatesqlite Durable Object declared underexports(so the namespace from the wranglerv1migration carries over) and the five secrets asbindings.secret().deploy.mjspasses secrets with--secrets-file /dev/stdin, so nothing touches disk; a secret left out (no broker token file) inherits the previous version's value.deploy.nixlinkscf/configand wrangler (cf's build bridge) frompkgs/cfandpkgs/wranglerinto the staged package, so no npm install runs at deploy time.deploy-lib.mjsholds the fail-closed argument check (deploy.shruns it before Bitwarden or sops) and the version/deployment helpers;test/deploy-lib.test.mjsandtest/config.test.mjscover them and keepcloudflare.config.tsandwrangler.jsoncin step. 39 tests pass.--dry-runbuilds and lists every binding;--deploy-version x --dry-runcreates nothing;--dry-rnuexits 2.Refs #6369
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.