-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(grouping): Fix project-deletion-triggered GroupHash
deletion
#76572
fix(grouping): Fix project-deletion-triggered GroupHash
deletion
#76572
Conversation
is the deletion of |
So there are two ways a In any case, no, I don't think it's an issue, because if you look at that UPDATE: I decided it actually is cleaner to just let the groups handle the deletion, so I've switched to that approach and updated the PR description. |
5e5026a
to
810370e
Compare
are there appropriate tests to ensure that groups still get deleted when a project is? |
That groups get deleted? Yeah, we test that here. But why would changing what triggers |
sorry, meant |
Yeah, no, I know. That's what you said originally. And we do test for it, in the spot I linked above. I'm just confused why that's a question here, since we're not changing anything about group deletion. |
810370e
to
a3bc7a6
Compare
This is a follow-up to #76312, fixing another bug with grouphash deletion. Currently, when a project is deleted, its associated
GroupHash
records are deleted directly by the project deletion task, using theBulkModelDeletionTask
. Unfortunately, that task doesn't take into account any dependent tables, meaning that the correspondingGroupHashMetadata
records aren't deleted as they should be.This fixes that by allowing
GroupHash
deletions to cascade from group deletions (which themselves are set off by project deletion), rather than having the project deletion task delete the grouphashes directly. (Group deletions already handleGroupHash
/GroupHashMetadata
deletion correctly, using theGroupHash
-specific deletion task registered in the deletion module's__init__.py
.)Note that while the results of this change aren't tested in this PR, they are implicitly tested in #76245, which will directly follow this one and which for the first time will actually create
GroupHashMetadata
records. Without the change in this PR, the presence of that PR's newGroupHashMetadata
records causes the project deletion test to fail, but with this change, they pass.