Repository navigation
Conversation
…ect transfer Transferring a project rewrote organization_id on every ExternalIssue its groups linked, even when groups in projects staying behind linked the same issue. Those groups then pointed at a row owned by another org, so anything resolving groups or the org through ExternalIssue.organization_id could no longer reach them from the old org. A shared row now stays put and the moved project's links are repointed to a copy in the new org, or to the new org's existing row for the same issue, which also stops the transfer from violating the (organization, integration_id, key) uniqueness. The lookup now only follows issue links, since commit links store Commit ids in the same linked_id column.
…-issue-group-lookup-review # Conflicts: # src/sentry/models/project.py
…nged An org owner can accept a project transfer into the project's current org. With old and new org equal, every linked ExternalIssue matched itself as the new org's existing row, so rows only this project linked were deleted while its GroupLinks still pointed at them. The other org-bound cleanup in transfer_to is already gated on org_changed.
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.
When a project moves to another organization, the external issues its groups are linked to (a Jira ticket, a GitHub issue, ...) move with it. The old code moved every such issue record, even when groups in projects that stay behind were linked to the same ticket. Those groups were left pointing at a record owned by the new org. So anything that finds groups or the org through the issue record's org stops reaching them: the Jira issue panel, and inbound status/assignee sync once #126011 scopes that lookup by org (Bugbot flagged it there).
Now, for each issue linked to the moved project:
It also stops a commit link from moving an unrelated issue. Links to commits and to issues store their ids in the same column, so a commit id that happened to match an issue id was enough to move that issue.
Tests cover each case and fail without the fix.