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: sanitise error reports and only report unknown errors #4707

Merged
merged 5 commits into from
Jan 11, 2024

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Jan 5, 2024

Fixes DEVX-1117

What this PR solves / how to test:

This PR tries to remove PII from Sentry error reports, and also ensures we're not reporting user errors that aren't actionable by us. User errors now extend a new UserError base class that doesn't get reported. Annotating user errors is a separate commit for easier reviewing.

To test this, try run wrangler dev i-dont-exist.js (you'll need to use a pre-release build with Sentry enabled). Notice an error is thrown but you're not prompted to report this.

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: changing how error reporting works

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.

Removes PII information from Sentry events
Introduces a new `UserError` base class. Instances of this class won't
be reported to Sentry.
@mrbbot mrbbot requested review from a team as code owners January 5, 2024 16:05
Copy link

changeset-bot bot commented Jan 5, 2024

🦋 Changeset detected

Latest commit: 4b12346

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 5, 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/7424161887/npm-package-wrangler-4707

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7424161887/npm-package-wrangler-4707 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7424161887/npm-package-miniflare-4707
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7424161887/npm-package-cloudflare-pages-shared-4707
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7424161887/npm-package-create-cloudflare-4707 --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 5, 2024

Codecov Report

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

Comparison is base (93e88c4) 75.58% compared to head (4b12346) 75.70%.
Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4707      +/-   ##
==========================================
+ Coverage   75.58%   75.70%   +0.11%     
==========================================
  Files         243      243              
  Lines       13096    13200     +104     
  Branches     3375     3388      +13     
==========================================
+ Hits         9899     9993      +94     
- Misses       3197     3207      +10     
Files Coverage Δ
packages/wrangler/src/api/mtls-certificate.ts 100.00% <100.00%> (ø)
packages/wrangler/src/cfetch/index.ts 90.56% <100.00%> (ø)
packages/wrangler/src/config/index.ts 89.88% <100.00%> (+0.06%) ⬆️
packages/wrangler/src/d1/migrations/helpers.ts 94.73% <100.00%> (+0.09%) ⬆️
packages/wrangler/src/d1/migrations/list.tsx 69.44% <100.00%> (+0.87%) ⬆️
packages/wrangler/src/d1/trimmer.ts 100.00% <100.00%> (ø)
packages/wrangler/src/delete.ts 100.00% <100.00%> (ø)
packages/wrangler/src/deployment-bundle/capnp.ts 94.44% <100.00%> (+0.32%) ⬆️
packages/wrangler/src/deployment-bundle/entry.ts 98.38% <100.00%> (+0.02%) ⬆️
...r/src/deployment-bundle/find-additional-modules.ts 95.65% <100.00%> (+0.06%) ⬆️
... and 49 more

... and 7 files with indirect coverage changes

Copy link
Member

@GregBrimble GregBrimble left a comment

Choose a reason for hiding this comment

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

Pages' stuff looks good

@mrbbot mrbbot merged commit 96a27f3 into main Jan 11, 2024
17 checks passed
@mrbbot mrbbot deleted the bcoll/re-enable-sentry branch January 11, 2024 18: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.

4 participants