Skip to content

Conversation

@miriambudayr
Copy link
Contributor

@miriambudayr miriambudayr commented Jul 8, 2024

This adds Sentry to the repository in a similar manner as we have done with the logger and mixpanel.

I instrumented the Playwright reporter as well so we can start getting errors in production.

We will still need to use Sentry in other packages (test-utils, cypress, etc.) and this lays a foundation for that work.

Note: I think I have become a bit paranoid about missing dependencies, so I installed the Sentry packages in all the other packages. I think there is probably a more methodical/logical way to do this, but since I don't trust the build step locally, I don't know how to test this methodically.

@changeset-bot
Copy link

changeset-bot bot commented Jul 8, 2024

⚠️ No Changeset found

Latest commit: 8ec95cc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security
Copy link

socket-security bot commented Jul 8, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@opentelemetry/[email protected] None 0 164 kB pichlermarc
npm/@opentelemetry/[email protected] None 0 1.22 MB pichlermarc
npm/@opentelemetry/[email protected] unsafe 0 59.5 kB pichlermarc
npm/@opentelemetry/[email protected] environment, unsafe 0 877 kB pichlermarc
npm/@opentelemetry/[email protected] None 0 53.5 kB dyladan
npm/@opentelemetry/[email protected] None 0 90 kB dyladan
npm/@opentelemetry/[email protected] None 0 70.6 kB dyladan
npm/@opentelemetry/[email protected] None 0 126 kB dyladan
npm/@opentelemetry/[email protected] None 0 85.7 kB dyladan
npm/@opentelemetry/[email protected] None 0 175 kB pichlermarc
npm/@opentelemetry/[email protected] None 0 56.6 kB dyladan
npm/@opentelemetry/[email protected] None 0 58.6 kB dyladan
npm/@opentelemetry/[email protected] None 0 130 kB dyladan
npm/@opentelemetry/[email protected] None 0 65.9 kB dyladan
npm/@opentelemetry/[email protected] None 0 74.9 kB dyladan
npm/@opentelemetry/[email protected] None 0 55.3 kB dyladan
npm/@opentelemetry/[email protected] None 0 52.1 kB dyladan
npm/@opentelemetry/[email protected] None 0 104 kB dyladan
npm/@opentelemetry/[email protected] None 0 82.2 kB dyladan
npm/@opentelemetry/[email protected] None 0 369 kB pichlermarc
npm/@opentelemetry/[email protected] None 0 24.6 kB dyladan
npm/@opentelemetry/[email protected] environment, filesystem, shell 0 557 kB pichlermarc
npm/@opentelemetry/[email protected] None 0 1.91 MB pichlermarc
npm/@opentelemetry/[email protected] None 0 775 kB pichlermarc
npm/@opentelemetry/[email protected] None 0 1.66 MB pichlermarc
npm/@opentelemetry/[email protected] None 0 31 kB dyladan
npm/@prisma/[email protected] environment 0 35.6 kB prismabot
npm/@sentry/[email protected] network 0 1.87 MB sentry-bot
npm/@sentry/[email protected] environment, unsafe 0 2.35 MB sentry-bot
npm/@sentry/[email protected] None 0 881 kB sentry-bot
npm/@sentry/[email protected] environment, filesystem, shell 0 3.34 MB sentry-bot
npm/@sentry/[email protected] None 0 324 kB sentry-bot
npm/@sentry/[email protected] network 0 1.14 MB sentry-bot
npm/@types/[email protected] None 0 7.01 kB types
npm/@types/[email protected] None 0 6.48 kB types
npm/@types/[email protected] None 0 9.24 kB types
npm/@types/[email protected] None 0 6.19 kB types
npm/@types/[email protected] None 0 3.3 kB types
npm/@types/[email protected] None 0 20.9 kB types
npm/@types/[email protected] None 0 7.73 kB types
npm/@types/[email protected] None 0 25.5 kB types
npm/@types/[email protected] None 0 25.8 kB types
npm/@types/[email protected] None 0 5 kB types
npm/@types/[email protected] None 0 16.1 kB types
npm/@types/[email protected] None 0 4.12 kB types
npm/[email protected] filesystem, shell 0 23.6 kB lovell
npm/[email protected] unsafe 0 41.4 kB datadog
npm/[email protected] None 0 4.47 kB watson
npm/[email protected] None 0 16 kB electron-cfa
npm/[email protected] network 0 79.6 kB djmax
npm/[email protected] None 0 3.19 kB charmander
npm/[email protected] None 0 4.17 kB charmander
npm/[email protected] None 0 188 kB brianc
npm/[email protected] None 0 35.3 kB bendrucker
npm/[email protected] None 0 4.9 kB bendrucker
npm/[email protected] None 0 3.06 kB bendrucker
npm/[email protected] None 0 5.92 kB bendrucker
npm/[email protected] None 0 6.73 kB bendrucker
npm/[email protected] None 0 10.1 kB martianboy
npm/[email protected] unsafe 0 16.9 kB trentm
npm/[email protected] None 0 24.7 kB othiym23
npm/[email protected] None 0 6.46 kB raynos

View full report↗︎

@socket-security
Copy link

socket-security bot commented Jul 8, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Install scripts npm/@sentry/[email protected]
  • Install script: install
  • Source: node scripts/check-build.js
🚫
Native code npm/@sentry/[email protected] 🚫

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

What's wrong with native code?

Contains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs.

Ensure that native code bindings are expected. Consumers may consider pure JS and functionally similar alternatives to avoid the challenges and risks associated with native code bindings.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@replay-io
Copy link

replay-io bot commented Jul 8, 2024

Status Complete ↗︎
Commit f131a81
Results
2 Failed
  • clicks a disappearing button
  • should fail on this test
  • 42 Passed
  • adds items
  • adds new items using a custom command
  • adds todos following the fixture
  • adds todos following the fixture
  • adds todos following the fixture
  • adds todos following the fixture
  • calls inform
  • complete all checkbox should update state when items are completed / cleared
  • gets a number
  • only gets a number
  • only gets a number
  • should allow me to add todo items
  • should allow me to clear the complete state of all items
  • should allow me to display active items
  • should allow me to display all items
  • should allow me to display completed items
  • should allow me to edit an item
  • should allow me to mark all items as completed
  • should allow me to mark items as complete
  • should allow me to un-mark items as complete
  • should append new items to the bottom of the list
  • should be hidden when there are no items that are completed
  • should cancel edits on escape
  • should clear text input field when an item is added
  • should display the correct text
  • should display the current number of todo items
  • should focus on the todo input field
  • should hide #main and #footer
  • should hide other controls when editing
  • should highlight the currently applied filter
  • should intercept postman
  • should invoke some commands that have exceptional option handling
  • should log
  • should persist its data
  • should remove completed items when clicked
  • should remove the item if an empty text string was entered
  • should respect the back button
  • should save edits on blur
  • should show #main and #footer when items added
  • should trim entered text
  • should trim text input
  • yields a number
  • @miriambudayr
    Copy link
    Contributor Author

    1.14 MB

    That's a lot of dependencies. What size increase normally raises red flags for you? @Andarist @callingmedic911 @bvaughn

    Copy link
    Contributor

    @bvaughn bvaughn left a comment

    Choose a reason for hiding this comment

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

    Wow, Yarn lock files are so chatty.

    ...test.source.scope,
    test.source.title,
    ].join("-");
    return withSentrySync("GetTestExecutionId", () => {
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    I don't think this makes sense> There's no function to wrap here, just an inline array.

    title: test.title,
    scope: test.titlePath().slice(3, -1),
    };
    return withSentrySync("GetSource", () => {
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    I don't think this makes sense either (same reason as above)

    @miriambudayr
    Copy link
    Contributor Author

    Wow, Yarn lock files are so chatty.

    I agree. It surprised me too.

    },
    "dependencies": {
    "@sentry/node": "^8.13.0",
    "@sentry/profiling-node": "^8.13.0",
    Copy link
    Member

    Choose a reason for hiding this comment

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

    ideally, we'd be using the same version range everywhere but right now we are using a mix of ^8.13.0 and ^8.15.0 in this PR

    this.authInfo = authInfo;
    }

    async close() {
    Copy link
    Member

    Choose a reason for hiding this comment

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

    we should add a call to this to exitTasks here:

    export const exitTasks: ExitTask[] = [

    };

    return this.fixtureData[id];
    return withSentrySync("GetFixtureData", () => {
    Copy link
    Member

    Choose a reason for hiding this comment

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

    it could be nice to have some withSentryTracking that could wrap a whole class automatically

    this.initialized = true;
    }

    identify(authInfo: AuthInfo) {
    Copy link
    Member

    Choose a reason for hiding this comment

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

    this method stays unused - should we be using it somewhere?

    Comment on lines +87 to +89
    export function initSentry(app: string, version: string | undefined) {
    sentry.initialize(app, version);
    }
    Copy link
    Member

    Choose a reason for hiding this comment

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

    I feel like this is redundant. All files importing initSentry end up using sentry too so they end up with both initSentry and sentry and the first one could simply be replaced at call sites with sentry.initialize


    constructor() {
    this.deviceId = getDeviceId();
    this.sessionId = randomUUID();
    Copy link
    Member

    Choose a reason for hiding this comment

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

    It would be great to share this between SentryAPI and the logger, this way we could try to correlate both data sources more easily

    Comment on lines +28 to +31
    Sentry.init({
    dsn: SENTRY_DSN,
    integrations: [nodeProfilingIntegration()],
    });
    Copy link
    Member

    Choose a reason for hiding this comment

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

    I wonder if this alone is enough to send something to Sentry. If yes then perhaps we should not even init this module when process.env.REPLAY_TELEMETRY_DISABLED is truthy

    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