Skip to content

Refuse --no-attachments for deploy id, as update id already does #21

Backlog

Description

@xgame92

What

ID has no R2 bucket, so --no-attachments means nothing for it. gateweave update id --no-attachments is refused with "has no option --no-attachments", and gateweave deploy id --help doesn't list it. gateweave deploy id --no-attachments is still accepted and silently ignored. The CLI's own rule, in a comment in main.ts, is that another command's options are refused, not ignored.

Where to look

  • packages/cli/src/main.ts, lines 247-278. The comment at line 247 says: "Another command's options are refused, not ignored, so a typo cannot pass for a choice." The update list (lines 262-267) adds "bucket", "no-attachments" when the product is ID. The deploy list (line 268) is the same for both products:
    : ["url", "to", "from", "worker", "database", "bucket", "queue"];
  • packages/cli/src/deploy-track.ts, lines 158-159: for ID, product.bucket is null, so options.attachments is never read.
  • Tests to copy: packages/cli/test/update-track.test.ts, lines 796-800 ("update id has no --bucket ..."), and packages/cli/test/deploy-id.test.ts, lines 161-168, which already checks that the help leaves out --no-attachments.

Done when

  • gateweave deploy id --no-attachments --json exits 2. The JSON reason matches /has no option --no-attachments/, and no command ran.
  • gateweave deploy track --no-attachments works as before. The existing "--no-attachments deploys without the bucket" test still passes.
  • The new test is in packages/cli/test/deploy-id.test.ts and fails without the change.
  • If the README says what deploy id refuses, it says this too. Today it describes update id refusing these options (README lines 210-214).
  • pnpm verify passes.

How to check

pnpm install
pnpm --filter gateweave test
pnpm verify

The 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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions