-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Sentry issue link association #106314
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
base: master
Are you sure you want to change the base?
Sentry issue link association #106314
Conversation
Allow users to reference Sentry issues by pasting the full issue URL in addition to the qualified short ID. This supports multiple URL formats: - https://sentry.io/organizations/{org}/issues/{id}/ - https://{domain}/organizations/{org}/issues/{id}/ - https://sentry.sentry.io/issues/{id}/ The ID can be either a numeric group ID or a qualified short ID (e.g., SENTRY-123). Previously, users had to use the exact short ID format (e.g., 'Fixes SENTRY-123'). Now they can simply paste the issue URL from their browser, making it easier to associate PRs and commits with Sentry issues. Examples that now work: - 'Fixes https://sentry.io/organizations/sentry/issues/123456/' - 'n+1 issue\nhttps://sentry.sentry.io/issues/123456/' - 'https://sentry.io/organizations/org/issues/SENTRY-123/' Related: #106312 Co-authored-by: josh.ferge <[email protected]>
|
Cursor Agent can help with this pull request. Just |
|
@sentry review |
|
bugbot review |
|
@cursoragent please fix pr comments |
|
Perfect! I've fixed the critical bug identified by both bots. Here's what was changed: Bug Fix Summary Issue: Line 73 was using Fix: Changed to Before: group = Group.objects.get(id=int(issue_id), organization_id=org_id)After: group = Group.objects.get(id=int(issue_id), project__organization_id=org_id)This fix ensures that when users paste Sentry issue URLs with numeric IDs (like The fix has been committed and pushed to the branch. The tests should continue to work correctly since they create groups with proper project-organization relationships. ✅ |
The Group model doesn't have a direct organization_id field. Groups are related to organizations through their project foreign key. This fixes a FieldError that would occur when looking up groups by numeric ID from Sentry issue URLs. Fixes bug identified by @sentry[bot] and @cursor[bot] Co-authored-by: josh.ferge <[email protected]>
This PR enables Sentry to automatically associate GitHub PRs and commit messages with Sentry issues when a full Sentry issue URL is included in the description.
Why:
Users can now simply paste the Sentry issue URL directly from their browser into PR descriptions or commit messages, improving convenience and discoverability of related issues without needing to manually extract short IDs.
What:
src/sentry/utils/groupreference.pyto parse various Sentry issue URL formats.find_referenced_groupsto extract both numeric and qualified short IDs from these URLs.Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Slack Thread