Repository navigation
Conversation
GroupLink.linked_id holds an ExternalIssue id for issue links but a Commit id for commit links. get_groups_by_external_issue matched on linked_id alone, so a group whose commit link happened to share an id with the synced ExternalIssue was returned as well. Inbound status and assignee sync and the Jira issue panel then acted on that unrelated group in the same organization.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
GroupLinkrow ties an issue in Sentry (a group) to something outside it: a ticket in an issue tracker (stored as anExternalIssue, such as a Jira ticket), a commit, or a pull request.linked_idholds the id of the linked row andlinked_typesays which kind of row that is. Commits and external issues are numbered independently, so a commit id can equal anExternalIssueid.Group.objects.get_groups_by_external_issuefinds the groups linked to a tracker ticket by matchinglinked_idagainst the ticket'sExternalIssueids, but never checkslinked_type. So a group that only references a commit with that same id is returned too. Inbound status and assignee sync (Jira, GitHub, GitLab, Azure DevOps) then resolves or reassigns that unrelated group, and the Jira issue panel lists it. Since #126011 scoped the lookup by organization, the stray group is always in the same organization.The fix adds
linked_type=issueto theGroupLinkfilter. The existing(linked_id, linked_type)index covers both conditions; the query plan uses it with both as the index condition.#126319 fixes the same mix-up in
Project.transfer_to.