Skip to content

ref(node): Refactor node source fetching into integration #3729

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

Merged
merged 45 commits into from
Feb 23, 2022

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Jun 22, 2021

This PR:

  • Moves eventFromException and eventFromMessage into eventbuilder to match browser SDK
  • Moves source context loading/addition into a ContextLines integration
  • frameContextLines option gets copied to ContextLines constructor but also pulls frameContextLines from NodeOptions to avoid a breaking change.
  • frameContextLines in NodeOptions marked as @deprecated so users learn about future migration

@timfish timfish requested a review from kamilogorek as a code owner June 22, 2021 12:31
@kamilogorek
Copy link
Contributor

I like this approach much better. One thing that we might try though is to go even further and move context lines to a separate integration and add it by default. I already implemented it in v7-dev branch so you can basically copy-paste (kinda) my code from here: https://github.com/getsentry/sentry-javascript/blob/v7-dev/packages/integration-node-contextlines/src/index.ts

@timfish

This comment has been minimized.

@kamilogorek
Copy link
Contributor

That's definitely a valid concern, although with a 100 items cache it should be a very minor if any performance issue. wdyt @rhcarvalho @HazAT

@timfish

This comment has been minimized.

@timfish timfish changed the title Feat: Refactor node source fetching into separate step to stack parsing Feat: Refactor node source fetching into integration Jul 20, 2021
@timfish

This comment has been minimized.

@timfish

This comment has been minimized.

@kamilogorek kamilogorek changed the title Feat: Refactor node source fetching into integration ref(node): Refactor node source fetching into integration Sep 14, 2021
@github-actions
Copy link
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@timfish
Copy link
Collaborator Author

timfish commented Oct 14, 2021

I promise, I do intend to finish this when I'm back from my extended vacation.

@timfish
Copy link
Collaborator Author

timfish commented Feb 15, 2022

@lobsterkatie maybe you can advise on these nextjs test failures?

From what I can tell, it's completely expected for captureEvent to be called before the event is rejected by the event processors.

I'm not quite sure why my changes have caused this to start failing 🤔.
My best guess is that it's because this PR removes some async'iness.

@timfish timfish force-pushed the feat/separate-source-reading branch from 03cb320 to e08bcbb Compare February 16, 2022 20:47
Copy link
Member

@lobsterkatie lobsterkatie left a comment

Choose a reason for hiding this comment

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

This is going to be a good change!

@lobsterkatie
Copy link
Member

@lobsterkatie maybe you can advise on these nextjs test failures?

Seems like you figured it out, but LMK if you still need help!

@timfish
Copy link
Collaborator Author

timfish commented Feb 17, 2022

Yep worked it out in the end. Thanks for the code review.

This theoretically means that a load of async can be removed from the browser/node SDKs because it was only there to cater for the node code context loading!

/**
* Sets the number of context lines for each frame when loading a file.
*
* @deprecated Context lines configuration has moved to the `ContextLines` integration, and can be used like this:
Copy link
Member

Choose a reason for hiding this comment

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

Nice 👍. We'll need to update docs for this as well.

@timfish timfish force-pushed the feat/separate-source-reading branch from 09f27da to ef7d423 Compare February 17, 2022 19:47
@timfish

This comment was marked as outdated.

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

We can only merge once we have the docs PR ready to go

@timfish
Copy link
Collaborator Author

timfish commented Feb 18, 2022

Docs PR done 🎉🎉🎉

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) February 23, 2022 12:09
@AbhiPrasad AbhiPrasad merged commit c60556f into getsentry:master Feb 23, 2022
@AbhiPrasad AbhiPrasad added this to the Pre 7.0.0 Work milestone Feb 23, 2022
@timfish timfish deleted the feat/separate-source-reading branch February 24, 2022 12:29
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