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

[wrangler] R2 jurisdictions support #3775

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

bthwaites
Copy link
Contributor

@bthwaites bthwaites commented Aug 16, 2023

Fixes # R2-1740

What this PR solves / how to test:
This PR adds two things:

  1. Allow wrangler r2 commands to specify the jurisdiction where the bucket resides
  2. Allow publishing a worker with a binding to an R2 bucket in a jurisdiction

Associated docs issue(s)/PR(s):
None

Author has included the following, where applicable:

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

@bthwaites bthwaites requested review from a team as code owners August 16, 2023 19:04
@changeset-bot
Copy link

changeset-bot bot commented Aug 16, 2023

🦋 Changeset detected

Latest commit: 7a158ce

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 Aug 16, 2023

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/6164470821/npm-package-wrangler-3775

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

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

Or you can use npx with this latest build directly:

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

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


wrangler@3.7.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20230904.0 3.20230904.0
workerd 1.20230904.0 1.20230904.0
workerd --version 1.20230904.0 2023-09-04

|

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

@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #3775 (7a158ce) into main (a986f19) will increase coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 80.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3775      +/-   ##
==========================================
+ Coverage   75.10%   75.12%   +0.02%     
==========================================
  Files         195      195              
  Lines       11487    11526      +39     
  Branches     3036     3049      +13     
==========================================
+ Hits         8627     8659      +32     
- Misses       2860     2867       +7     
Files Changed Coverage Δ
packages/wrangler/src/dev.tsx 83.19% <0.00%> (ø)
packages/wrangler/src/init.ts 92.69% <ø> (ø)
packages/wrangler/src/config/validation.ts 89.98% <33.33%> (-0.22%) ⬇️
packages/wrangler/src/r2/helpers.ts 90.00% <70.58%> (-7.68%) ⬇️
packages/wrangler/src/r2/index.ts 86.01% <88.88%> (-1.29%) ⬇️
packages/wrangler/src/config/index.ts 90.44% <100.00%> (+0.12%) ⬆️
...src/deployment-bundle/create-worker-upload-form.ts 88.23% <100.00%> (ø)
packages/wrangler/src/user/user.ts 72.23% <100.00%> (ø)

... and 3 files with indirect coverage changes

@bthwaites bthwaites force-pushed the bradley/r2-jurisdictions branch from a8ae95f to e6d5480 Compare August 16, 2023 19:35
@mrbbot
Copy link
Contributor

mrbbot commented Aug 21, 2023

Hey! 👋 This looks good to me, though I'm not sure what's up with the Windows tests. 😕 I'll try re-run them, but have you got a Windows laptop to try run them locally?

@bthwaites bthwaites force-pushed the bradley/r2-jurisdictions branch 2 times, most recently from fc6227d to aa1371b Compare August 30, 2023 14:33
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.

Looks good to me! One small nit, but that's it

-v, --version Show version number [boolean]

Options:
-J, --jurisdiction The jurisdiction where the new bucket will be created [string]"
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't generally use capitalised flags in Wrangler. For consistency, would it be possible to use -j?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

-j seems to be in use already for --experimental-json-config. Would it be better to use -n?

@penalosa
Copy link
Contributor

Could you rebase on main, and then we can get this in?

@bthwaites bthwaites force-pushed the bradley/r2-jurisdictions branch 2 times, most recently from a4c08fd to 6aca204 Compare September 12, 2023 19:49
@bthwaites
Copy link
Contributor Author

bthwaites commented Sep 12, 2023

The windows tests seem to have failed again after rebase. I don't have a windows machine to test on, but last time this happened it resolved after running again.

@bthwaites bthwaites force-pushed the bradley/r2-jurisdictions branch from 6aca204 to 7a158ce Compare September 12, 2023 20:21
@mrbbot mrbbot merged commit 3af3087 into cloudflare:main Sep 13, 2023
@github-actions github-actions bot mentioned this pull request Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants