-
Notifications
You must be signed in to change notification settings - Fork 716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WC-1308 Reduce force-deletes unless explicitly confirmed #3426
WC-1308 Reduce force-deletes unless explicitly confirmed #3426
Conversation
🦋 Changeset detectedLatest commit: a71815c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Definitely open to any suggestions on copy here - see the included test for an example |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5467339575/npm-package-wrangler-3426 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/3426/npm-package-wrangler-3426 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5467339575/npm-package-wrangler-3426 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5467339575/npm-package-cloudflare-pages-shared-3426 Note that these links will no longer work once the GitHub Actions artifact expires. |
Codecov Report
@@ Coverage Diff @@
## main #3426 +/- ##
==========================================
+ Coverage 75.09% 75.24% +0.14%
==========================================
Files 190 190
Lines 11110 11160 +50
Branches 2919 2944 +25
==========================================
+ Hits 8343 8397 +54
+ Misses 2767 2763 -4
|
18edc5a
to
c6e5ec9
Compare
c6e5ec9
to
722d8d6
Compare
Actually, looking at this again—the delete command should take a |
@penalosa should merge be blocked on this? if so, can you update your approval :) |
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.
This should have a --force
flag
fe083c6
to
60b7c20
Compare
60b7c20
to
3100941
Compare
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.
Looks good to me. Let's have another person in @cloudflare/wrangler take a pass before merging though
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.
Nice PR! Really clean and understandable code.
Can you confirm that the new requests are to stable public APIs? So that Wrangler won't get broken by them being changed or removed.
I think it would be good to only ask about deleting if there is no --force
flag, and also can we move the new types into the delete.ts
file.
Otherwise LGTM!
Changes the default ?force param to the delete API call to be false. Also uses the /scripts/{scriptName}/references and /tails/by-consumer/{scriptName} endpoints to determine what resources depend on the current script. We check for other scripts that use this one as outbound worker (for dynamic dispatch), as a tail worker, as a service binding, or use a durable object implemented by this script. If any other resources rely on this worker, we require another step of confirmation, describing the dependencies, and only then do we allow doing a force delete.
3100941
to
a71815c
Compare
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.
❤️
Um last thought... is this a breaking change for users that previously expected their deletions to be forced through, even if that is bad for them? |
erm, I don't know. I suppose you could classify it as a breaking change, albeit not a very impactful one |
OK so I think the opinion is that this does not deserve a major versio bump. |
Changes the default ?force param to the delete API call to be false. Also uses the /scripts/{scriptName}/references and /tails/by-consumer/{scriptName} endpoints to determine what resources depend on the current script. We check for other scripts that use this one as outbound worker (for dynamic dispatch), as a tail worker, as a service binding, or use a durable object implemented by this script. If any other resources rely on this worker, we require another step of confirmation, describing the dependencies, and only then do we allow doing a force delete.
Changes the default ?force param to the delete API call to be false.
Also uses the /scripts/{scriptName}/references and /tails/by-consumer/{scriptName} endpoints to determine what resources depend on the current script. We check for other scripts that use this one as outbound worker (for dynamic dispatch), as a tail worker, as a service binding, or use a durable object implemented by this script. If any other resources rely on this worker, we require another step of confirmation, describing the dependencies, and only then do we allow doing a force delete.
for WC-1308
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable: