Skip to content
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

Adding argument to specify rule to delete if don't want to delete every rule in config #6679

Merged

Conversation

jkoe-cf
Copy link
Contributor

@jkoe-cf jkoe-cf commented Sep 11, 2024

What this PR solves / how to test

Updates the R2 Event Notification DELETE payload to the Cloudflare API to be able to specify rules within a config to delete.

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Included
    • Not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required / Maybe required
    • Not required because: no e2e tests cover r2 event notifications
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Included
    • Not necessary because:
  • Public documentation

@jkoe-cf jkoe-cf requested a review from a team as a code owner September 11, 2024 18:01
Copy link

changeset-bot bot commented Sep 11, 2024

🦋 Changeset detected

Latest commit: b17d39e

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

This PR includes changesets to release 2 packages
Name Type
wrangler Minor
@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

@jkoe-cf jkoe-cf marked this pull request as draft September 11, 2024 18:02
Copy link
Contributor

github-actions bot commented Sep 11, 2024

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/10834626965/npm-package-wrangler-6679

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6679/npm-package-wrangler-6679

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10834626965/npm-package-wrangler-6679 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10834626965/npm-package-create-cloudflare-6679 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10834626965/npm-package-cloudflare-kv-asset-handler-6679
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10834626965/npm-package-miniflare-6679
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10834626965/npm-package-cloudflare-pages-shared-6679
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10834626965/npm-package-cloudflare-vitest-pool-workers-6679
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10834626965/npm-package-cloudflare-workers-editor-shared-6679
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10834626965/npm-package-cloudflare-workers-shared-6679

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240821.2
workerd 1.20240909.0 1.20240909.0
workerd --version 1.20240909.0 2024-09-09

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@lrapoport-cf lrapoport-cf added the caretaking Priority for caretaking label Sep 11, 2024
Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

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

Could you fill out the PR description template?

Comment on lines 141 to 142
`${queue}`,
`${rule}`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these wrapped in `${...}`?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure - was leftover from previous committer, will remove

})
.option("rule", {
describe:
"The id of the rule to delete. If no rule is specified, all rules for the bucket/queue configuration will be deleted. ex '--ruleId 12345678'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"The id of the rule to delete. If no rule is specified, all rules for the bucket/queue configuration will be deleted. ex '--ruleId 12345678'",
"The id of the rule to delete. If no rule is specified, all rules for the bucket/queue configuration will be deleted.",

Comment on lines 554 to 556
const body: DeleteNotificationRequestBody = {
rules: [ruleId],
};
Copy link
Contributor

Choose a reason for hiding this comment

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

The flag description implies that providing a rule ID is optional. What should happen here in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If a rule id is not specified, then all rules within the config will be deleted (which is the current behavior)

@jkoe-cf jkoe-cf force-pushed the jkoe/update-delete-event-notification-config branch 4 times, most recently from e2a46f3 to a29c1e2 Compare September 12, 2024 00:28
@jkoe-cf jkoe-cf marked this pull request as ready for review September 12, 2024 15:06
@jkoe-cf jkoe-cf changed the title DO NOT MERGE YET - Adding argument to specify rule to delete if don't want to delete every rule in config Adding argument to specify rule to delete if don't want to delete every rule in config Sep 12, 2024
@jkoe-cf jkoe-cf force-pushed the jkoe/update-delete-event-notification-config branch from a29c1e2 to 308cba1 Compare September 12, 2024 15:30
@penalosa
Copy link
Contributor

For posterity, we're merging this without passing status checks intentionally. It's repeatedly flaking on Windows fixtures and re-running isn't helping because it's on a fork and so Turbo caching isn't enabled. We're confident the failures are unrelated to these changes, and in any case will re-run the fixtures before releasing a version of Wrangler with this change. Approved by @lrapoport-cf

@jkoe-cf jkoe-cf force-pushed the jkoe/update-delete-event-notification-config branch from a22985e to b17d39e Compare September 12, 2024 16:09
@penalosa penalosa merged commit 2174127 into cloudflare:main Sep 12, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
caretaking Priority for caretaking
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants