From 709322075471342ae797a612f31930f72e36ca07 Mon Sep 17 00:00:00 2001 From: Colleen O'Rourke Date: Wed, 26 Nov 2025 09:53:16 -0800 Subject: [PATCH 1/2] fix(ACI): Filter migration and emit logs --- .../0104_action_data_fallthrough_type.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py b/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py index e3bdf5a3406ce0..762244ba75ca8b 100644 --- a/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py +++ b/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py @@ -1,5 +1,7 @@ # Generated by Django 5.2.8 on 2025-11-24 19:57 +import logging + from django.db import migrations from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.migrations.state import StateApps @@ -7,16 +9,28 @@ from sentry.new_migrations.migrations import CheckedMigration from sentry.utils.query import RangeQuerySetWrapper +logger = logging.getLogger(__name__) + def migrate_fallthrough_type(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None: Action = apps.get_model("workflow_engine", "Action") - for action in RangeQuerySetWrapper(Action.objects.all()): + count = 0 + for action in RangeQuerySetWrapper(Action.objects.filter(type="email")): if "fallthroughType" in action.data: new_data = action.data.copy() del new_data["fallthroughType"] new_data["fallthrough_type"] = action.data["fallthroughType"] action.data = new_data action.save() + count += 1 + if count % 1000 == 0: + logger.info( + "Progress update", + extra={ + "count": count, + "current_detector_id": action.id, + }, + ) class Migration(CheckedMigration): From b4253114789a8d9ce0dd82b6f63d68941979aa2b Mon Sep 17 00:00:00 2001 From: Colleen O'Rourke Date: Wed, 26 Nov 2025 11:21:18 -0800 Subject: [PATCH 2/2] rebase ate this --- .../migrations/0104_action_data_fallthrough_type.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py b/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py index 762244ba75ca8b..1ae640319f2964 100644 --- a/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py +++ b/src/sentry/workflow_engine/migrations/0104_action_data_fallthrough_type.py @@ -28,7 +28,7 @@ def migrate_fallthrough_type(apps: StateApps, schema_editor: BaseDatabaseSchemaE "Progress update", extra={ "count": count, - "current_detector_id": action.id, + "current_action_id": action.id, }, )