Skip to content

chore(investigations): Delete unused cell models - #121906

Open
wedamija wants to merge 1 commit into
masterfrom
danf/delete-investigation-cell-models
Open

chore(investigations): Delete unused cell models#121906
wedamija wants to merge 1 commit into
masterfrom
danf/delete-investigation-cell-models

Conversation

@wedamija

Copy link
Copy Markdown
Member

We switched the naming over to blocks, just removing these unused models.

We switched the naming over to blocks, just removing these.
@wedamija
wedamija requested review from a team as code owners August 12, 2026 23:22
@wedamija
wedamija requested a review from arslnb August 12, 2026 23:22
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 12, 2026
@@ -1,205 +0,0 @@
from __future__ import annotations

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were basically just testing the orm, I figured it was better to remove them.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e7d46b7. Configure here.

SafeDeleteModel(name="InvestigationCell", deletion_action=DeletionAction.MOVE_TO_PENDING),
SafeDeleteModel(
name="InvestigationCellExecution", deletion_action=DeletionAction.MOVE_TO_PENDING
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cell deletion migration cannot apply

High Severity

SafeDeleteModel renders the full migration state via from_state.apps.get_model before each pending delete. After InvestigationCellExecutionProject leaves state, InvestigationCellExecution.data_projects still points at that through model, and InvestigationCell / InvestigationCellExecution still hold circular FKs. The next SafeDeleteModel then fails to resolve those relations, so this migration cannot run. The AlterField operations only clear db_constraint; they do not remove the relations from state.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e7d46b7. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/investigations/migrations/0003_remove_investigation_cell_models.py

for 0003_remove_investigation_cell_models in investigations

--
-- Alter field investigation on investigationcell
--
SET CONSTRAINTS "investigations_inves_investigation_id_ea6f5f16_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcell" DROP CONSTRAINT "investigations_inves_investigation_id_ea6f5f16_fk_investiga";
--
-- Alter field content_execution on investigationcell
--
SET CONSTRAINTS "investigations_inves_content_execution_id_34f9e9e5_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcell" DROP CONSTRAINT "investigations_inves_content_execution_id_34f9e9e5_fk_investiga";
--
-- Alter field current_execution on investigationcell
--
SET CONSTRAINTS "investigations_inves_current_execution_id_05ba7f96_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcell" DROP CONSTRAINT "investigations_inves_current_execution_id_05ba7f96_fk_investiga";
--
-- Alter field result_execution on investigationcell
--
SET CONSTRAINTS "investigations_inves_result_execution_id_9eb02114_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcell" DROP CONSTRAINT "investigations_inves_result_execution_id_9eb02114_fk_investiga";
--
-- Alter field cell on investigationcellexecution
--
SET CONSTRAINTS "investigations_inves_cell_id_73cf2e60_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcellexecution" DROP CONSTRAINT "investigations_inves_cell_id_73cf2e60_fk_investiga";
--
-- Alter field seer_run on investigationcellexecution
--
SET CONSTRAINTS "investigations_inves_seer_run_id_c245a578_fk_seer_seer" IMMEDIATE; ALTER TABLE "investigations_investigationcellexecution" DROP CONSTRAINT "investigations_inves_seer_run_id_c245a578_fk_seer_seer";
--
-- Alter field execution on investigationcellexecutionproject
--
SET CONSTRAINTS "investigations_inves_execution_id_7b98d399_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcellexecutionproject" DROP CONSTRAINT "investigations_inves_execution_id_7b98d399_fk_investiga";
--
-- Alter field project on investigationcellexecutionproject
--
SET CONSTRAINTS "investigations_inves_project_id_448c181c_fk_sentry_pr" IMMEDIATE; ALTER TABLE "investigations_investigationcellexecutionproject" DROP CONSTRAINT "investigations_inves_project_id_448c181c_fk_sentry_pr";
--
-- Alter field cell on investigationcellparameter
--
SET CONSTRAINTS "investigations_inves_cell_id_461a689a_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcellparameter" DROP CONSTRAINT "investigations_inves_cell_id_461a689a_fk_investiga";
--
-- Alter field parameter on investigationcellparameter
--
SET CONSTRAINTS "investigations_inves_parameter_id_7c6be561_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcellparameter" DROP CONSTRAINT "investigations_inves_parameter_id_7c6be561_fk_investiga";
--
-- Alter field cell on investigationcelldependency
--
SET CONSTRAINTS "investigations_inves_cell_id_472eb484_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcelldependency" DROP CONSTRAINT "investigations_inves_cell_id_472eb484_fk_investiga";
--
-- Alter field depends_on on investigationcelldependency
--
SET CONSTRAINTS "investigations_inves_depends_on_id_628a1ebb_fk_investiga" IMMEDIATE; ALTER TABLE "investigations_investigationcelldependency" DROP CONSTRAINT "investigations_inves_depends_on_id_628a1ebb_fk_investiga";
--
-- Moved model InvestigationCellDependency to pending deletion state
--
-- (no-op)
--
-- Moved model InvestigationCellParameter to pending deletion state
--
-- (no-op)
--
-- Moved model InvestigationCellExecutionProject to pending deletion state
--
-- (no-op)
--
-- Moved model InvestigationCell to pending deletion state
--
-- (no-op)
--
-- Moved model InvestigationCellExecution to pending deletion state
--
-- (no-op)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant