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

feat(workers): configure tail consumers #1317

Merged
merged 6 commits into from
Jun 23, 2023
Merged

feat(workers): configure tail consumers #1317

merged 6 commits into from
Jun 23, 2023

Conversation

ndisidore
Copy link
Contributor

Hello from the Workers team 👋

Description

This adds the necessary functionality to the sdk to allow customers to set Tail Workers as consumers on their scripts. Tail Consumers are also included in the response metadata, and the updates the response to reflect that.

Additionally, this does a fairly large refactor to the Workers test suite, moving script response to a variadic parameters setup. Many of the existing hardcoded responses were out of date or half complete, so this ensures an easy way to make changes in 1 spot going forward for consistent & up to date api shapes.

For reviewing purposes these have been broken into separate commits.

Has your change been tested?

A test has been added to cover uploading a Tail Consumer.

Screenshots (if appropriate):

Types of changes

What sort of change does your code introduce/modify?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented in cloudflare/api-schemas
    and relies on stable APIs.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 22, 2023

changelog detected ✅

utils.go Outdated Show resolved Hide resolved
workers_test.go Outdated Show resolved Hide resolved
workers_test.go Outdated Show resolved Hide resolved
workers_test.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #1317 (899550c) into master (74e0b34) will decrease coverage by 0.19%.
The diff coverage is 51.16%.

@@            Coverage Diff             @@
##           master    #1317      +/-   ##
==========================================
- Coverage   48.95%   48.76%   -0.19%     
==========================================
  Files         135      133       -2     
  Lines       13180    12989     -191     
==========================================
- Hits         6452     6334     -118     
+ Misses       5212     5149      -63     
+ Partials     1516     1506      -10     
Impacted Files Coverage Δ
options.go 61.01% <ø> (-3.05%) ⬇️
dns_firewall.go 7.69% <10.00%> (-13.74%) ⬇️
tunnel.go 42.41% <66.66%> (+1.01%) ⬆️
cloudflare.go 66.77% <100.00%> (-0.52%) ⬇️
resource.go 85.18% <100.00%> (+1.85%) ⬆️
workers.go 59.45% <100.00%> (+0.44%) ⬆️

... and 3 files with indirect coverage changes

@jacobbednarz
Copy link
Member

thanks for the PR! ❤️ it. could of minor things i've fixed that we already had available in the library but no biggie.

Additionally, this does a fairly large refactor to the Workers test suite, moving script response to a variadic parameters setup.

i've avoided this sort of setup in the past as it gets hard to read and the output isn't explicit as to what we are testing but i'm happy to give it a whirl and see how this experiment pans out given the repetition we have in these tests.

@jacobbednarz jacobbednarz merged commit 84af07d into cloudflare:master Jun 23, 2023
@github-actions github-actions bot added this to the v0.71.0 milestone Jun 23, 2023
github-actions bot pushed a commit that referenced this pull request Jun 23, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2023

This functionality has been released in v0.71.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants