Bringing Sentry to your Pull Requests #49996
Replies: 13 comments 27 replies
-
Where can we set this up? |
Beta Was this translation helpful? Give feedback.
-
Would be great if Sentry could even let me know about what potential issues were resolved by my PR |
Beta Was this translation helpful? Give feedback.
-
Sounds promising. Does this need the git codebase to be copied over to Sentry/CodeCov servers? Or will the GitHub PR API be enough? |
Beta Was this translation helpful? Give feedback.
-
Excited to see this implemented! I rarely associate Sentry issues w/ Github issues, but the "suspect commits" functionality is often useful to me for triaging a bug - I hope it's not too false-positive prone though when the stacktrace doesn't point to the true culprit 💜 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Is this only for github ? How about bitbucket ? |
Beta Was this translation helpful? Give feedback.
-
Hey there @Dhrumil-Sentry, We love this feature! I think there is a small edge case/configuration missing which would help some users. Here is a concrete example. Let's say this code exists on the main branch: https://codesandbox.io/p/sandbox/nextjs-sentry-v6-4-1-example-forked-vxynxs If I dev this code locally and made the following changes: @@ -10,6 +10,7 @@ export default function IndexPage() {
}
function MyComponent() {
+ example_syntax_error;
return (
<div>
Hello World.{" "} The syntax error from the dev environment would trigger an error. That error is configured to be sent to Sentry. At this point, we are seeing the suspect commit comments on the previous pull which did not add the code (as the code came from a dev environment). Some notes:
My initial thought was to look for a way to configure certain sentry environments to not comment on pulls. In this case, we want to send errors in our dev environments to Sentry's dev environment, but also not hear about the errors that came from a dev environment on pulls. Note: I can't seem to reliably reproduce the comment bug from the dev environment, but have reproduced it once (see the second link on the GH comment) |
Beta Was this translation helpful? Give feedback.
-
@Dhrumil-Sentry This overall idea is great! The security problemOne thing we're running into with Sentry and Github, is that for security reasons we don't want to give you read access to source code, nor write access to repo hooks. Issue read access and ability to post comments to PRs could be alright, but probably also something we'd like to avoid. My suggestionA great approach is to leverage Github Actions and CLI tools (you already have an excellent one) to push data to Sentry, instead of you pulling. The benefit with running your CLI tool in our CI is that we can pin the version to a SHA hash, so if you get hacked your hackers still can't do anything. For example, a PR check (Github Actions) could ask Sentry for what's described above:
And a scheduled job running in Github Actions could use your CLI to ask for "Post-Merge PR Comments". That way, you wouldn't need read access to our source code. Is this something you have considered internally? Prior artBugsnag has this approach for Github source code linking. We just tell them about our repo URL, branch name and they'll generate links automatically, without having source code access. |
Beta Was this translation helpful? Give feedback.
-
Can we possibly opt-out of receiving issues for certain kind of errors? We just got a comment from the Sentry app o our backend Python-based service on a line that raises a Receiving a comment on GitHub that our backend services handles 404 certainly seems overkill, and we would gladly opt-out from receiving comments from these kind of errors that we consider more to be warnings, while keeping this functionality. |
Beta Was this translation helpful? Give feedback.
-
We're using the post-merge monitoring and it's magical! I have a feature request though: I'd like to be able to exclude info-level errors from notifying people on their PRs. We use info level errors to track events that we want to know about but that aren't actually causing problems. |
Beta Was this translation helpful? Give feedback.
-
This looks incredible and something we would absolutely want to have. However we use gitlab, are there plans to bring this feature to Gitlab anytime soon. Is there a way to do this using releases and your api? Every commit is a release for us, it would be great if automate issues by hitting sentry by release and adding them as comments to our PRs. Thanks |
Beta Was this translation helpful? Give feedback.
-
We're very excited to share that we've GA'd Comments on Open PRs!! When you open a pull request in GitHub, Sentry will comment and inform you if there are any unhandled issues being caused by the functions you are modifying in your PR so that you can fix issues while you already have the necessary context. This works for Javascript and Python platforms today. We plan on extending support to more languages and source code integrations in the future Please read our docs to learn more. We've provided an option to disable these as well |
Beta Was this translation helpful? Give feedback.
-
I created a ticket specifically for new language support: And yes I did this because I use C# and it's not supported yet 😅 |
Beta Was this translation helpful? Give feedback.
-
Developers leverage Sentry for triage in one of two ways:
In both scenarios, the developer notes important issues, creates a Jira/Linear ticket for them, and adds this to their to-do list. Minor bugs often fall through the cracks in such a workflow.
We believe Sentry can better serve developers by enabling a more proactive, context-specific triage workflow by becoming part of the development process. Specifically, by surfacing insights within Pull Requests (PRs), Sentry can help developers spot, consider, and address issues more effectively.
PRs offer a critical point in a developer's workflow, where proposed code changes undergo scrutiny and present an opportunity to catch potential problems before they reach the main codebase.
Sentry in Pull Requests
Typically, a PR goes through these stages
By surfacing context about existing issues, Sentry can enable a proactive workflow that continuously improves code quality.
Improving PR Reviews with Sentry
Sentry can analyze open PRs and comment on any existing issues related to the areas of code being modified. This approach alerts developers and reviewers to potential pitfalls and helps them resolve existing issues while they're working on the same areas of code.
Using Codecov with Sentry
When developers utilize both Sentry and Codecov, they can identify untested code and existing errors in the functions they're updating. Developers can then use this information to expand their test coverage.
Post-Merge Monitoring
Even with comprehensive testing and review, sometimes code changes can introduce errors that only appear in the live production environment. Sentry can track these code changes' impacts right back to the PR.
Using Suspect Commits, Sentry can identify issues likely caused by a merged PR and comment with a summary of these new issues. This approach provides a consolidated record for developers investigating incidents or bugs.
We want your feedback
We’d love to hear what matters to you. Please share your thoughts in the comments below:
Beta Was this translation helpful? Give feedback.
All reactions