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

Update wonder-stuff-sentry to Sentry v9 #1122

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

jeremywiebe
Copy link
Contributor

@jeremywiebe jeremywiebe commented Feb 28, 2025

Summary:

This PR updates the @khanacademy/wonder-stuff-sentry package to be compatible with @sentry/browser v8. The major difference is that in v8 and on integrations are no longer classes, simply objects. The pattern I saw in other samples is to write a function that initializes the Sentry integration with whatever options provided.

The other big difference is that we no longer need to use addGlobalEventProcessor. In fact, that function no longer exists. In v8 though we can simplify the integration considerably by implementing the processEvent hook on the Integration. This accomplishes pretty much exactly what the setupOnce() logic was doing previously (see https://github.com/getsentry/sentry-javascript/blob/5060542296ead088486e7cc2472508a595a7190b/packages/core/src/integration.ts#L121-L126).

Issue: FEI-6242

Test plan:

I plan to integrate this into a consuming app and test it there to make sure the integration works. Also, all existing tests passed after updating them to the new integration (or deleting tests which no longer applied - ones relating to integration setup).

@jeremywiebe jeremywiebe self-assigned this Feb 28, 2025
Copy link

changeset-bot bot commented Feb 28, 2025

🦋 Changeset detected

Latest commit: d602916

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

This PR includes changesets to release 1 package
Name Type
@khanacademy/wonder-stuff-sentry Major

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

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.85%. Comparing base (d19a309) to head (5773e97).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1122      +/-   ##
==========================================
- Coverage   99.85%   99.85%   -0.01%     
==========================================
  Files          97       97              
  Lines        1392     1390       -2     
  Branches      358      350       -8     
==========================================
- Hits         1390     1388       -2     
  Misses          1        1              
  Partials        1        1              
Files with missing lines Coverage Δ
...ackages/wonder-stuff-sentry/src/kind-error-data.ts 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d19a309...5773e97. Read the comment docs.

Copy link
Contributor

github-actions bot commented Feb 28, 2025

Size Change: -63 B (-1.36%)

Total Size: 4.56 kB

Filename Size Change
packages/wonder-stuff-sentry/dist/browser/es/index.js 1.59 kB -63 B (-3.82%)
ℹ️ View Unchanged
Filename Size
packages/wonder-stuff-core/dist/browser/es/index.js 1.85 kB
packages/wonder-stuff-testing/dist/browser/es/index.js 1.12 kB

compressed-size-action

@jeremywiebe jeremywiebe marked this pull request as ready for review February 28, 2025 20:26
@khan-actions-bot khan-actions-bot requested a review from a team February 28, 2025 20:27
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Feb 28, 2025

Gerald

Required Reviewers
  • @Khan/frontend-infra for changes to .eslintignore, yarn.lock, .changeset/shaggy-mugs-wave.md, packages/wonder-stuff-sentry/package.json, packages/wonder-stuff-sentry/src/index.ts, packages/wonder-stuff-sentry/src/kind-error-data-integration.ts, packages/wonder-stuff-sentry/src/types.ts, packages/wonder-stuff-sentry/src/__tests__/kind-error-data-integration.test.ts, packages/wonder-stuff-sentry/src/__tests__/__snapshots__/kind-error-data-integration.test.ts.snap

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Member

@somewhatabstract somewhatabstract left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on. See the epic I raised (FEI-6239) for this stuff. I think we should go straight to v9 and skip v8.

Some changes requested inline but just housekeeping really.

Copy link
Member

@somewhatabstract somewhatabstract left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on. See the epic I raised (FEI-6239) for this stuff. I think we should go straight to v9 and skip v8.

Some changes requested inline but just housekeeping really.

(Sorry for the double review post; finger slipped and hit request changes and I hit the other button before it finished...seems to have done both :D )

@jeremywiebe jeremywiebe changed the title Update wonder-stuff-sentry to Sentry v8 Update wonder-stuff-sentry to Sentry v9 Feb 28, 2025
Copy link
Member

Choose a reason for hiding this comment

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

question: I would expect this to be a moved file also? Is the other snapshot not deleted?

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