-
Notifications
You must be signed in to change notification settings - Fork 560
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
wrangler support Queues http-pull consumer config and cli #5231
wrangler support Queues http-pull consumer config and cli #5231
Conversation
🦋 Changeset detectedLatest commit: c7322a3 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/8366124306/npm-package-wrangler-5231 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5231/npm-package-wrangler-5231 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8366124306/npm-package-wrangler-5231 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8366124306/npm-package-create-cloudflare-5231 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8366124306/npm-package-cloudflare-kv-asset-handler-5231 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8366124306/npm-package-miniflare-5231 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8366124306/npm-package-cloudflare-pages-shared-5231 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8366124306/npm-package-cloudflare-vitest-pool-workers-5231 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
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.
LGTM from a help text / CLI sub-command surface perspective!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5231 +/- ##
==========================================
+ Coverage 71.96% 72.14% +0.17%
==========================================
Files 313 317 +4
Lines 16239 16318 +79
Branches 4157 4164 +7
==========================================
+ Hits 11687 11773 +86
+ Misses 4552 4545 -7
|
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.
A few suggestions. But looking pretty good.
Oh and I think this should have a changeset, right?
(Edit: I see that you have marked this, and docs, as "TODO before merge" - so we should hold you to that!)
I think we'll want a new test that runs workers-sdk/packages/wrangler/src/__tests__/deploy.test.ts Lines 8609 to 8645 in f5e4922
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
tested |
@@ -96,6 +97,33 @@ export async function postConsumer( | |||
); | |||
} | |||
|
|||
export async function postTypedConsumer( |
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.
IMO it's more confusing than helpful to try to offer a generic "typed consumer" function here.
I suggest just having a separate postWorkerConsumer
and postHttpConsumer
. Each one can have request/response types that apply to that consumer type.
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, from a Wrangler team perspective. Nice work @w-kuhn
Oh actually the test failures are legit: https://github.com/cloudflare/workers-sdk/actions/runs/8364727430/job/22900763340?pr=5231#step:8:2073 Need to update some snapshots. |
Thanks! Fixed that up. Just need to open up some gates before merging tomorrow. 🥳 |
What this PR solves / how to test
Fixes MQ-307
Cloudflare Queues currently only supports worker consumers. Support for http-pull consumers is coming soon and part of that support is wranglerization.
This change extends the current worker-only consumer config (
wrangler queues consumer add <queue-name> <script-name> ...options
) to includewrangler queues consumer http add|remove <queue-name> ...options
andwrangler queues consumer worker add|remove <queue-name> <script-name> ...options
.and:
Author has addressed the following