Repository navigation
Description
What
gateweave deploy id names three things after --name: the Worker, the D1 database and the logout Queue, <name>-logouts. The name check allows up to 57 characters. That limit was chosen for Track's R2 bucket (<name>-files, 6 more characters). Cloudflare Queue names are at most 63 characters, so with ID a 56- or 57-character name produces a 64- or 65-character Queue name. That only fails inside the product's own deploy, after the person said yes, so whatever the deploy had already created is left in the account. The check should allow only names whose longest derived resource name still fits.
Where to look
packages/cli/src/main.ts, lines 130-132:and lines 279-286, where it is applied and the message says "at most 57 characters" for every product.// Worker and bucket names allow lowercase letters, digits and dashes; the bucket adds "-files" // and must stay within 63 characters. const NAME = /^[a-z0-9](?:[a-z0-9-]{0,55}[a-z0-9])?$/;
packages/cli/src/products.ts, line 48 (bucket: { binding: "FILES", suffix: "-files" }) and line 66 (queue: { binding: "LOGOUTS", suffix: "-logouts" }). The suffixes are data, so the limit can be worked out from the product instead of written by hand.- The same check covers
update idanddoctor id. A shorter limit there is harmless, because no ID deployment can have a longer name. - Tests:
packages/cli/test/deploy-track.test.ts, lines 1396-1401 ("rejects a name that cannot name a Worker and a bucket") shows the shape, includingassert.deepEqual(calls, [])to prove nothing ran.packages/cli/test/deploy-id.test.tshas adeploy(args)helper at line 14.
Done when
gateweave deploy id --name <56 lowercase letters> --jsonexits 2 with codebad-name, and no command was run (callsis empty).- A 55-character name for
deploy idis accepted as far as the name check goes. - Track keeps its limit: a 57-character name still passes the name check for
deploy track, and a 58-character name is refused. - The message gives the limit for the product in question (57 for Track, 55 for ID) and names what it has to fit (the bucket for Track, the Queue for ID).
- The new ID test fails without the change.
pnpm verifypasses.
How to check
pnpm install
pnpm --filter gateweave test
pnpm verifyThe tests fake Wrangler, git and pnpm, and never reach Cloudflare.
The draft pull request #18 changes the same files (main.ts, system.ts). If it merges before you open yours, rebase on main first.
Setup is in CONTRIBUTING.md. Say here if you're taking this, so nobody does it twice, and ask here if you get stuck.
Activity