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: check permissions on authentication error with API token set #4597

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Dec 12, 2023

Fixes #4078.

What this PR solves / how to test:

The API tokens set with the CLOUDFLARE_API_TOKEN environment variable may not include all required permissions for Wrangler. This change ensures the error message for authentication errors includes a suggestion to check token permissions. Ideally, authentication errors would inclusion the name of the required permission that was missing, but they don't. 🙁

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: this is an improvement to error messaging

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 December 12, 2023 21:50
Copy link

changeset-bot bot commented Dec 12, 2023

🦋 Changeset detected

Latest commit: a8acdb0

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 Dec 12, 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/7387050874/npm-package-wrangler-4597

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

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

Or you can use npx with this latest build directly:

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

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 workspace:* 3.20231030.4
workerd 1.20231030.0 1.20231030.0
workerd --version 1.20231030.0 2023-10-30

|

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

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (850c4d6) 75.54% compared to head (a8acdb0) 75.22%.
Report is 33 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4597      +/-   ##
==========================================
- Coverage   75.54%   75.22%   -0.32%     
==========================================
  Files         242      242              
  Lines       12905    13027     +122     
  Branches     3318     3348      +30     
==========================================
+ Hits         9749     9800      +51     
- Misses       3156     3227      +71     
Files Coverage Δ
packages/wrangler/src/index.ts 89.23% <100.00%> (+0.15%) ⬆️

... and 18 files with indirect coverage changes

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Minor textual change suggestion. Otherwise LGTM.

packages/wrangler/src/index.ts Outdated Show resolved Hide resolved
@petebacondarwin petebacondarwin added the error-messaging Improving user facing error messages label Dec 22, 2023
@mrbbot mrbbot force-pushed the bcoll/suggest-checking-permissions branch from 92cee0a to a8acdb0 Compare January 2, 2024 14:41
@mrbbot mrbbot merged commit e1d5040 into main Jan 2, 2024
17 checks passed
@mrbbot mrbbot deleted the bcoll/suggest-checking-permissions branch January 2, 2024 14:53
@workers-devprod workers-devprod mentioned this pull request Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messaging Improving user facing error messages
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

🐛 BUG: Failure to report Authentication Error
3 participants