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

Port sentry logic #5570

Merged
merged 34 commits into from
Aug 22, 2024
Merged

Port sentry logic #5570

merged 34 commits into from
Aug 22, 2024

Conversation

ChristopherDedominici
Copy link
Contributor

No description provided.

@ChristopherDedominici ChristopherDedominici added the status:ready This issue is ready to be worked on label Aug 3, 2024
@ChristopherDedominici ChristopherDedominici self-assigned this Aug 3, 2024
Copy link

vercel bot commented Aug 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 4:23pm

Copy link

changeset-bot bot commented Aug 3, 2024

⚠️ No Changeset found

Latest commit: 2f2cc1b

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

…:NomicFoundation/hardhat into features/port-sentry-to-V3
errorMessage = this.#anonymizeMnemonic(errorMessage);

// the \\ before path.sep is necessary for this to work on windows
const pathRegex = /\S+[\/\\]\S+/g;
Copy link
Member

Choose a reason for hiding this comment

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

Note: This is a bit different, it accepts \ or / in any platform. Previously it used path.sep.

}

#isHardhatFile(filename: string): boolean {
const nomicFoundationPath = path.join("node_modules", "@nomicfoundation");
Copy link
Member

Choose a reason for hiding this comment

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

Note: this has also changed

* (https://develop.sentry.dev/sdk/event-payloads/exception/), return an
* anonymized version of the event.
*/
public async anonymize(event: any): Promise<either.Either<string, Event>> {
Copy link
Member

Choose a reason for hiding this comment

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

Let's replace this with something like:

type AnonymizeResult = {success: true, Event} | {success: false, error:string}

so that we don't add fp-ts as a dependency.

Copy link
Member

@alcuadrado alcuadrado left a comment

Choose a reason for hiding this comment

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

I left a small comment about fp-ts

Base automatically changed from feature/add-logic-to-send-telemetry-data to v-next August 20, 2024 12:16
v-next/hardhat/package.json Outdated Show resolved Hide resolved
@kanej
Copy link
Member

kanej commented Aug 21, 2024

I was able to get Sentry exceptions through on the test environment with manual testing.

It did throw up that our anonymizing is not setup for the @ignored org and namespace, nor will it work with the ./v-next/example-project (the paths don't meet the anonymizer expectations).

I think we deal with this issue when we add Sentry to the CLI's uncaught exception handler.

@ChristopherDedominici
Copy link
Contributor Author

I left a small comment about fp-ts

Done here


interface WordMatch {
index: number;
word: string;
}

type AnonymizeResult =
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 export this type as its part of the Anonymizer API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@ChristopherDedominici ChristopherDedominici added this pull request to the merge queue Aug 22, 2024
Merged via the queue into v-next with commit 17ba161 Aug 22, 2024
114 checks passed
@ChristopherDedominici ChristopherDedominici deleted the features/port-sentry-to-V3 branch August 22, 2024 19:50
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Port and test the integration with Sentry
4 participants