[wrangler] Mention --secrets-file in required-secrets error messages#14540
Closed
petebacondarwin wants to merge 1 commit into
Closed
[wrangler] Mention --secrets-file in required-secrets error messages#14540petebacondarwin wants to merge 1 commit into
petebacondarwin wants to merge 1 commit into
Conversation
When a Worker declares secrets.required and is deployed for the first time, `wrangler secret put` cannot set those secrets because the Worker does not exist yet. The first-deploy error now leads with `wrangler deploy --secrets-file <FILE>`, and the missing-secret API errors for deploy and versions upload now mention --secrets-file alongside the existing secret put guidance.
🦋 Changeset detectedLatest commit: 43b9062 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
Contributor
|
✅ All changesets look good
|
Contributor
|
All references are consistent. The change is clean, well-scoped, correctly handles all branches (first deploy, deploy API error, versions upload API error), tests are updated to match, and there's a valid changeset. The LGTM |
Contributor
Author
|
Just realised that there is already a PR here #14332 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14258.
When a Worker declares
secrets.requiredand is deployed for the first time, the remedies suggested by the error messages don't work:wrangler secret putfails because the Worker doesn't exist yet, and the one path that does work —--secrets-file— was never mentioned.This updates the messages emitted by
addRequiredSecretsInheritBindingsandhandleMissingSecretsError(in@cloudflare/deploy-helpers, surfaced through Wrangler) to point at--secrets-file:wrangler deploy --secrets-file <FILE>as the way to supply required secrets in a single step, and mentionswrangler secret put <NAME>only as the option for once the Worker exists.deploy): now mentionwrangler deploy --secrets-file <FILE>alongside the existingwrangler secret put <NAME>guidance.versions upload): now mentionwrangler versions upload --secrets-file <FILE>alongside the existingwrangler versions secret put <NAME>guidance.This is scoped to the wording of these two error messages, per the actionable item called out in the issue. It does not change how secrets are actually supplied or routed.
--secrets-fileflag and its behaviour are unchanged and already documented.