Skip to content

CC-7948 Update wrangler CLI to support GAR#14311

Draft
sherryliu-lsy wants to merge 6 commits into
cloudflare:mainfrom
sherryliu-lsy:sherryliu/cc-7948-update-wrangler-cli-to-support-gar
Draft

CC-7948 Update wrangler CLI to support GAR#14311
sherryliu-lsy wants to merge 6 commits into
cloudflare:mainfrom
sherryliu-lsy:sherryliu/cc-7948-update-wrangler-cli-to-support-gar

Conversation

@sherryliu-lsy

@sherryliu-lsy sherryliu-lsy commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

CC-7948

Adds Google Artifact Registry to Wrangler's external registry configuration flow. GAR credentials differ from ECR and DockerHub because the public credential comes from the service-account key JSON file itself, so Wrangler now parses the key, derives client_email from the key as the public credential, and stores/sends the key as base64 for Cloudchamber.

Provide the Google service-account key as a path to the key file via --gar-service-account-key.

Follows CC-7866 Add Google Artifact Registry (GAR) support as an external registry provider

  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: GAR support depends on the Cloudchamber backend release. We need to validate the full end-to-end flow after the Cloudchamber changes are deployed, then finalize user-facing docs.

Open in Devin Review

Adds Google Artifact Registry to Wrangler's external registry
configuration flow. GAR credentials differ from ECR and DockerHub
because the public credential comes from the service-account key
itself, so Wrangler now parses the key, derives `client_email`,
and stores/sends the key as base64 for Cloudchamber.

The command also accepts an optional GAR-specific
`--google-service-account-email` flag.
@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: efb175e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@cloudflare/containers-shared Minor
wrangler Minor
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Jun 15, 2026
@workers-devprod workers-devprod requested a review from a team June 15, 2026 23:54
@workers-devprod workers-devprod requested review from a team and emily-shen and removed request for a team June 15, 2026 23:54
@workers-devprod

workers-devprod commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
  • ✅ @cloudflare/cloudchamber
Show detailed file reviewers
  • .changeset/common-boats-help.md: [@cloudflare/wrangler]
  • packages/containers-shared/src/client/models/ExternalRegistryKind.ts: [@cloudflare/wrangler]
  • packages/containers-shared/src/images.ts: [@cloudflare/wrangler]
  • packages/containers-shared/tests/images.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/containers/registries.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/containers/registries.ts: [@cloudflare/wrangler]

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14311

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14311

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14311

miniflare

npm i https://pkg.pr.new/miniflare@14311

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14311

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14311

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14311

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14311

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14311

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14311

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14311

wrangler

npm i https://pkg.pr.new/wrangler@14311

commit: efb175e

@nikitassharma

Copy link
Copy Markdown
Member

Can we also accept a filename for the service key? We shouldn't require a user to paste the JSON object if they've already downloaded the file from GCP

@sherryliu-lsy

Copy link
Copy Markdown
Contributor Author

Can we also accept a filename for the service key? We shouldn't require a user to paste the JSON object if they've already downloaded the file from GCP

Yes great point let me add that!

devin-ai-integration[bot]

This comment was marked as resolved.

sherryliu-commits and others added 2 commits June 16, 2026 16:27
- Add the --gar-service-account-key flag, accepting the service-account key as
  a file path, raw JSON, or base64 (resolved in that order). Mutually exclusive
  with credential flags from other providers. If the flag is not provided,
  accept the key (raw JSON or base64) via stdin
- Removed the --google-service-account-email flag since it was redundant with
  the email field in the service account key.
- Surface targeted errors for unreadable key files, stray PEM private keys, and
  missing/empty key fields instead of a generic "invalid key" message.
- Updated tests and changeset.
@sherryliu-lsy sherryliu-lsy force-pushed the sherryliu/cc-7948-update-wrangler-cli-to-support-gar branch from 5351a0d to a5afd87 Compare June 16, 2026 21:35

@nikitassharma nikitassharma left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The more I think about it, the more I think we should disallow the base64 or raw json secrets in the cli flag. That should only accept a filename. We can accept base64 or raw json through stdin, but in general we shouldn't encourage pasting a secret value into the terminal where it would remain visible in shell history.

Comment thread packages/containers-shared/src/images.ts Outdated
Comment thread packages/wrangler/src/containers/registries.ts Outdated
@sherryliu-lsy sherryliu-lsy marked this pull request as draft June 17, 2026 20:58
…alFlagConflicts logic

- wrangler now only accepts a file path for the GAR service account key, and no longer
    accepts raw JSON or base64 input for security considerations.
- Handling provider-specific credential flag conflicts simplified to provider map rather
    than hardcoding
- Updated tests and changeset.
@sherryliu-lsy sherryliu-lsy force-pushed the sherryliu/cc-7948-update-wrangler-cli-to-support-gar branch from c718e6e to efb175e Compare June 17, 2026 21:58
await expect(
runWrangler(`containers registries configure ${garDomain}`)
).rejects.toThrowErrorMatchingInlineSnapshot(
`[Error: Missing required argument: gar-service-account-key. Provide the path to the Google service account key file.]`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not require this. We should be able to accept credentials through stdin the way we do for other registries.

like all of these should be valid (or entering secret through the interactive prompt)

wrangler containers registries configure --gar-service-account-key=path/to/key.json
echo $BASE64_PRIVATE_KEY | wrangler containers registries configure
cat path/to/key.json | wrangler containers registries configure

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to think through what makes the most sense from a ux perspective, what are your thoughts on this:

CLI flag:

  • file path

stdin:

  • base 64 encoded json
  • raw json
  • file path (unsure ?)

interactive prompt:

  • file path
  • raw json

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

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

4 participants