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

Support Queue events in tail #2397

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

a-robinson
Copy link
Member

Queue events have an "event" section containing two fields -- "queue" and "batchSize", which contain the queue name and number of messages in the batch. Queue events can be distinguished from other events by the presence of the "queue" field, so that's what I do here.

I've followed the example of RequestEvent more closely than either ScheduledEvent or AlarmEvent here, but am happy to change up the format if there's a reason to do so.

@OilyLime @jbw1991

@a-robinson a-robinson requested a review from a team as a code owner December 12, 2022 15:43
@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2022

🦋 Changeset detected

Latest commit: 3fd7eff

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

This PR includes changesets to release 1 package
Name Type
wrangler Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 12, 2022

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/6460339910/npm-package-wrangler-2397

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6460339910/npm-package-wrangler-2397 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6460339910/npm-package-cloudflare-pages-shared-2397

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 3.20231002.1 3.20231002.1
workerd 1.20231002.0 1.20231002.0
workerd --version 1.20231002.0 2023-10-02

|

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

@JacobMGEvans
Copy link
Contributor

You seem to have your own local formatter/linter setup that is overriding ours, you can run the formatter command and save without formatting, which should clear this up 😃

@a-robinson
Copy link
Member Author

You seem to have your own local formatter/linter setup that is overriding ours, you can run the formatter command and save without formatting, which should clear this up 😃

Ugh it's just the classic "newline at the end of a file" vs "no newline at the end of a file" debate combined with me forgetting to run prettier one last time before sending this up. Should be fixed now, thanks.

@codecov
Copy link

codecov bot commented Dec 12, 2022

Codecov Report

Merging #2397 (f5e9415) into main (3077016) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head f5e9415 differs from pull request most recent head 3fd7eff. Consider uploading reports for the commit 3fd7eff to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2397      +/-   ##
==========================================
- Coverage   75.35%   75.31%   -0.05%     
==========================================
  Files         223      222       -1     
  Lines       12203    12188      -15     
  Branches     3154     3152       -2     
==========================================
- Hits         9196     9179      -17     
- Misses       3007     3009       +2     
Files Coverage Δ
packages/wrangler/src/tail/createTail.ts 83.33% <ø> (ø)
packages/wrangler/src/tail/printing.ts 85.18% <100.00%> (ø)

... and 8 files with indirect coverage changes

@a-robinson
Copy link
Member Author

Sorry for not knowing offhand who's best to review this, @JacobMGEvans , but would you mind pointing me in the right direction?

@JacobMGEvans
Copy link
Contributor

Sorry for not knowing offhand who's best to review this, @JacobMGEvans , but would you mind pointing me in the right direction?

Anyone from the Wrangler team, I think it just got lost in the notifications

@JacobMGEvans
Copy link
Contributor

Could you also add a changeset please 😊

@lrapoport-cf lrapoport-cf added the queues Relating to queues label Feb 8, 2023
@a-robinson
Copy link
Member Author

Ugh I'm just now seeing this never made it in :(

I'll take a look at the conflicts soon, hopefully they were just due to support being added for other event types in the meantime.

@a-robinson
Copy link
Member Author

a-robinson commented Oct 4, 2023

Ok, I think I got the conflicts fixed up appropriately. I'll try to find someone with merge privileges to review after ensuring CI passes.

@@ -0,0 +1,8 @@
---
"wrangler": patch
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
"wrangler": patch
"wrangler": minor

@penalosa
Copy link
Contributor

penalosa commented Oct 9, 2023

This should be a minor not a patch, and it looks like there are still some conflicts, but otherwise looks good!

Queue events have an "event" section containing two fields -- "queue"
and "batchSize", which contain the queue name and number of messages in
the batch. Queue events can be distinguished from other events by the
presence of the "queue" field, so that's what I do here.

I've followed the example of RequestEvent more closely than either
ScheduledEvent or AlarmEvent here, but am happy to change up the format
if there's a reason to do so.
@a-robinson
Copy link
Member Author

Thanks for the review, @penalosa! Fixed.

@a-robinson
Copy link
Member Author

Looks like CI is happy, should be good to merge whenever you're up for it (I don't have write access or I would myself).

@lrapoport-cf lrapoport-cf added the awaiting Cloudflare response Awaiting response from workers-sdk maintainer team label Oct 10, 2023
@penalosa penalosa merged commit 93833f0 into cloudflare:main Oct 10, 2023
19 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting Cloudflare response Awaiting response from workers-sdk maintainer team queues Relating to queues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants