-
Notifications
You must be signed in to change notification settings - Fork 755
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
Bradley/r2 event notification get #6652
Bradley/r2 event notification get #6652
Conversation
🦋 Changeset detectedLatest commit: fc10687 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
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/10817376489/npm-package-wrangler-6652 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6652/npm-package-wrangler-6652 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10817376489/npm-package-wrangler-6652 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10817376489/npm-package-create-cloudflare-6652 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10817376489/npm-package-cloudflare-kv-asset-handler-6652 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10817376489/npm-package-miniflare-6652 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10817376489/npm-package-cloudflare-pages-shared-6652 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10817376489/npm-package-cloudflare-vitest-pool-workers-6652 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10817376489/npm-package-cloudflare-workers-editor-shared-6652 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/10817376489/npm-package-cloudflare-workers-shared-6652 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
90040d3
to
db05894
Compare
.changeset/few-toes-remember.md
Outdated
@@ -0,0 +1,5 @@ | |||
--- | |||
"wrangler": major |
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.
If the event notification feature is currently not GA, this can be a minor/patch bump
This PR cannot be merged while this is a major bump
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 seems this subcommand is not marked as experimental in the subhelp output:
$ npx wrangler r2 bucket --help
wrangler r2 bucket
Manage R2 buckets
COMMANDS
wrangler r2 bucket create <name> Create a new R2 bucket
wrangler r2 bucket update Update bucket state
wrangler r2 bucket list List R2 buckets
wrangler r2 bucket delete <name> Delete an R2 bucket
wrangler r2 bucket sippy Manage Sippy incremental migration on an R2 bucket
wrangler r2 bucket notification Manage event notifications for an R2 bucket
GLOBAL FLAGS
-j, --experimental-json-config Experimental: support wrangler.json [boolean]
-c, --config Path to .toml configuration file [string]
-e, --env Environment to use for operations and .env files [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Can you add ${chalk.hex(betaCmdColor)("[open beta]")}
to the end of the subcommand description please?
"┌────────────┬────────┬────────┬─────────────────────────────┐ | ||
│ queue_name │ prefix │ suffix │ event_type │ | ||
├────────────┼────────┼────────┼─────────────────────────────┤ | ||
│ my-queue-1 │ /p1 │ s1/ │ object-create,object-delete │ | ||
├────────────┼────────┼────────┼─────────────────────────────┤ | ||
│ my-queue-1 │ │ │ object-delete │ | ||
├────────────┼────────┼────────┼─────────────────────────────┤ | ||
│ my-queue-2 │ //1 │ 2// │ object-delete │ | ||
└────────────┴────────┴────────┴─────────────────────────────┘" | ||
"┌──────────────────────────────────────┬──────────────────────────┬────────────┬────────┬────────┬───────────────────────────────────┐ | ||
│ rule_id │ created_at │ queue_name │ prefix │ suffix │ event_type │ | ||
├──────────────────────────────────────┼──────────────────────────┼────────────┼────────┼────────┼───────────────────────────────────┤ | ||
│ 68746106-12f8-4bba-a57b-adaf37fe11ca │ │ my-queue-1 │ /p1 │ s1/ │ PutObject,CopyObject,DeleteObject │ | ||
├──────────────────────────────────────┼──────────────────────────┼────────────┼────────┼────────┼───────────────────────────────────┤ | ||
│ 5aa280bb-39d7-48ed-8c21-405fcd078192 │ │ my-queue-1 │ │ │ DeleteObject │ | ||
├──────────────────────────────────────┼──────────────────────────┼────────────┼────────┼────────┼───────────────────────────────────┤ | ||
│ c4725929-3799-477a-a8d9-2d300f957e51 │ 2024-09-05T01:02:03.000Z │ my-queue-2 │ //1 │ 2// │ LifecycleDeletion │ | ||
└──────────────────────────────────────┴──────────────────────────┴────────────┴────────┴────────┴───────────────────────────────────┘" |
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 table is getting quite wide. Would it make sense to switch to a labelled list? (like deployments list
)
Easily done with the formatLabelledValues
util
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.
Yes I like this suggestion, I'll check it out.
resp[args.bucket], | ||
getQueueById | ||
); | ||
const tableOutput = await tableFromNotificationGetResponse(config, resp); | ||
logger.table(tableOutput); |
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.
To render as a labelled list instead:
logger.table(tableOutput); | |
logger.log(tableOutput.map((x) => formatLabelledValues(x)).join("\n\n")); |
db05894
to
1513dc6
Compare
1513dc6
to
fc10687
Compare
* main: Add pipeline binding to wrangler.toml (#6674) Fix Pages duplicating hash in redirects (#6680) Bradley/r2 event notification get (#6652) feat(wrangler): Add support for placement hints (#6625) fix(wrangler): Validate `routes` for Workers with assets (#6621) chore(deps): bump the workerd-and-workers-types group across 1 directory with 2 updates (#6673) chore(workers-shared): Configure GitHub Actions to deploy Asset Worker (#6542) feat: experimental workers assets can be ignored by adding a .assetsignore file (#6640)
What this PR solves / how to test
wrangler r2 bucket notification get
Note: The change to the GET payload is not backwards compatible. Users will need to update to the latest version of wrangler to continue using Event Notifications after the GA launch. Backwards compatibility is added here for the case that we need to revert the API changes.
Fixes #[insert GH or internal issue number(s)].
Internal issues: R2-2379 and R2-2380
Author has addressed the following