Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion migrations_lockfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ replays: 0007_organizationmember_replay_access

seer: 0010_drop_legacy_columns

sentry: 1084_delete_dashboardlastvisited
sentry: 1085_remove_groupcommitresolution

social_auth: 0003_social_auth_json_field

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,6 @@ module = [
"sentry.models.files.*",
"sentry.models.group",
"sentry.models.groupbookmark",
"sentry.models.groupcommitresolution",
"sentry.models.groupemailthread",
"sentry.models.groupenvironment",
"sentry.models.grouphash",
Expand Down
1 change: 0 additions & 1 deletion src/sentry/deletions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def load_defaults(manager: DeletionTaskManager) -> None:
manager.register(models.Group, defaults.GroupDeletionTask)
manager.register(models.GroupAssignee, BulkModelDeletionTask)
manager.register(models.GroupBookmark, BulkModelDeletionTask)
manager.register(models.GroupCommitResolution, BulkModelDeletionTask)
manager.register(models.GroupEmailThread, BulkModelDeletionTask)
manager.register(models.GroupEnvironment, BulkModelDeletionTask)
manager.register(models.GroupHash, defaults.GroupHashDeletionTask)
Expand Down
12 changes: 3 additions & 9 deletions src/sentry/deletions/defaults/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ def get_query_filter(self) -> Q:
2. Not referenced by any ReleaseHeadCommit (not a head commit of any release)
3. Not referenced by any GroupReaction (not reacted to by any group)
4. Not referenced by any CommitComparison (not part of any comparison)
5. Not referenced by any GroupCommitResolution (not resolving any group)
6. Not referenced by any GroupLink (not linked to any group)
7. Not referenced by any LatestRepoReleaseEnvironment.commit_id
8. Older than 90 days
5. Not referenced by any GroupLink (not linked to any group)
6. Not referenced by any LatestRepoReleaseEnvironment.commit_id
7. Older than 90 days
"""
from sentry.models.commitcomparison import CommitComparison
from sentry.models.groupcommitresolution import GroupCommitResolution
from sentry.models.grouplink import GroupLink
from sentry.models.groupreaction import GroupReaction
from sentry.models.latestreporeleaseenvironment import LatestRepoReleaseEnvironment
Expand All @@ -42,9 +40,6 @@ def get_query_filter(self) -> Q:
commitcomparison_base_exists = Exists(
CommitComparison.objects.filter(base_commit_id=OuterRef("id"))
)
groupcommitresolution_exists = Exists(
GroupCommitResolution.objects.filter(commit_id=OuterRef("id"))
)
grouplink_exists = Exists(
GroupLink.objects.filter(
project__organization_id=OuterRef("organization_id"),
Expand All @@ -62,7 +57,6 @@ def get_query_filter(self) -> Q:
| groupreaction_exists
| commitcomparison_head_exists
| commitcomparison_base_exists
| groupcommitresolution_exists
| grouplink_exists
| latestrepo_exists
)
Expand Down
1 change: 0 additions & 1 deletion src/sentry/deletions/defaults/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
# XXX: We could remove GroupHash from here since we call delete_group_hashes() in the _delete_children() method.
models.GroupHash,
models.GroupAssignee,
models.GroupCommitResolution,
models.GroupLink,
models.GroupHistory,
models.GroupBookmark,
Expand Down
33 changes: 33 additions & 0 deletions src/sentry/migrations/1085_remove_groupcommitresolution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.2.12 on 2026-05-07 17:51


from sentry.new_migrations.migrations import CheckedMigration
from sentry.new_migrations.monkey.models import SafeDeleteModel
from sentry.new_migrations.monkey.state import DeletionAction


class Migration(CheckedMigration):
# This flag is used to mark that a migration shouldn't be automatically run in production.
# This should only be used for operations where it's safe to run the migration after your
# code has deployed. So this should not be used for most operations that alter the schema
# of a table.
# Here are some things that make sense to mark as post deployment:
# - Large data migrations. Typically we want these to be run manually so that they can be
# monitored and not block the deploy for a long period of time while they run.
# - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to
# run this outside deployments so that we don't block them. Note that while adding an index
# is a schema change, it's completely safe to run the operation after the code has deployed.
# Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment

is_post_deployment = False

dependencies = [
("sentry", "1084_delete_dashboardlastvisited"),
]

operations = [
SafeDeleteModel(
name="GroupCommitResolution",
deletion_action=DeletionAction.MOVE_TO_PENDING,
),
]
1 change: 0 additions & 1 deletion src/sentry/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from .group import * # NOQA
from .groupassignee import * # NOQA
from .groupbookmark import * # NOQA
from .groupcommitresolution import * # NOQA
from .groupemailthread import * # NOQA
from .groupenvironment import * # NOQA
from .grouphash import * # NOQA
Expand Down
25 changes: 0 additions & 25 deletions src/sentry/models/groupcommitresolution.py

This file was deleted.

9 changes: 0 additions & 9 deletions tests/sentry/deletions/test_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from sentry.deletions.defaults.commit import CommitDeletionTask
from sentry.models.commit import Commit
from sentry.models.commitcomparison import CommitComparison
from sentry.models.groupcommitresolution import GroupCommitResolution
from sentry.models.grouplink import GroupLink
from sentry.models.groupreaction import GroupReaction, GroupReactionType
from sentry.models.latestreporeleaseenvironment import LatestRepoReleaseEnvironment
Expand Down Expand Up @@ -99,14 +98,6 @@ def test_get_query_filter_does_not_select_commit_in_comparison(self) -> None:
assert head_commit not in commits_to_delete
assert base_commit not in commits_to_delete

def test_get_query_filter_does_not_select_commit_resolving_group(self) -> None:
"""Test that commits in GroupCommitResolution are NOT selected"""
commit = self._create_old_commit()
group = self.create_group(project=self.project)
GroupCommitResolution.objects.create(group_id=group.id, commit_id=commit.id)
commits_to_delete = self._get_filtered_commits()
assert commit not in commits_to_delete

def test_get_query_filter_does_not_select_latest_repo_commit(self) -> None:
"""Test that commits in LatestRepoReleaseEnvironment are NOT selected"""
commit = self._create_old_commit()
Expand Down
Loading