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] fix: don't require auth for wrangler r2 object --local operations #4722

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Jan 8, 2024

What this PR solves / how to test:

Previously, Wrangler would ask you to login when reading or writing from local R2 buckets. This change ensures no login prompt is displayed, as authentication isn't required for these operations. To test this, run wrangler logout, then wrangler r2 object put TEST_BUCKET/a.txt --file <local_file> --local and observe the object is written without a login prompt.

This PR also fixes an issue with mockApiToken() and mockAccountId() where they weren't correctly unsetting API tokens in afterEach() hooks. This was causing some tail tests to erroneously pass.

Author has addressed the following:

  • Tests
    • Included
    • Not necessary because:
  • Changeset (Changeset guidelines)
    • Included
    • Not necessary because:
  • Associated docs
    • Issue(s)/PR(s):
    • Not necessary because: fixing a bug in user expectations

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.

@mrbbot mrbbot requested a review from a team as a code owner January 8, 2024 17:46
Copy link

changeset-bot bot commented Jan 8, 2024

🦋 Changeset detected

Latest commit: 078d8a9

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

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

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

Copy link
Contributor

github-actions bot commented Jan 8, 2024

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/7451209285/npm-package-wrangler-4722

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7451209285/npm-package-wrangler-4722 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7451209285/npm-package-miniflare-4722
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7451209285/npm-package-cloudflare-pages-shared-4722
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7451209285/npm-package-create-cloudflare-4722 --no-auto-update

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


wrangler@3.22.3 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20231218.1
workerd 1.20231218.0 1.20231218.0
workerd --version 1.20231218.0 2023-12-18

|

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

Copy link

codecov bot commented Jan 8, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (df71f26) 75.60% compared to head (078d8a9) 75.66%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4722      +/-   ##
==========================================
+ Coverage   75.60%   75.66%   +0.05%     
==========================================
  Files         243      243              
  Lines       13096    13103       +7     
  Branches     3376     3380       +4     
==========================================
+ Hits         9901     9914      +13     
+ Misses       3195     3189       -6     
Files Coverage Δ
packages/wrangler/src/r2/index.ts 74.86% <100.00%> (ø)
.../wrangler/src/__tests__/helpers/mock-account-id.ts 87.09% <63.63%> (-12.91%) ⬇️

... and 7 files with indirect coverage changes

@mrbbot mrbbot merged commit 5af6df1 into main Jan 10, 2024
17 checks passed
@mrbbot mrbbot deleted the bcoll/no-auth-r2-object-local branch January 10, 2024 10:53
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.

2 participants