This repository has been archived by the owner on Aug 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 337
Upload "draft" worker if secret is created before initial worker script has been uploaded #1087
Merged
Conversation
This file contains 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
gabbifish
added
feature
Feature requests and suggestions
status - needs review
regression
Something is broken, but works in previous releases
labels
Feb 19, 2020
if the script doesn't exist, then no secret could exist to delete; i think this logic only makes sense for |
ashleymichal
suggested changes
Feb 19, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it only makes sense to create a script on put, not delete.
gabbifish
changed the title
Gabbi/fix #913
Upload "draft" worker if secret is created before initial worker script has been uploaded
Feb 19, 2020
ashleymichal
approved these changes
Feb 19, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
feature
Feature requests and suggestions
regression
Something is broken, but works in previous releases
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.
This PR closes #913.
It introduces fallback logic to upload a "draft" worker whenever a secrets API call is made for a specific script name, and a worker for the script name does not exist yet. This fallback logic currently applies to secret upload and deletion; we can also extend it to
wrangler secret list
if we'd like. I currently avoid doing that given that one is extremely unlikely to usewrangler secret list
before callingwrangler secret put/delete
, but then again, it could be worth preventing unexpected behavior for this CLI call as well.