Skip to content
Open
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 @@ releases: 0004_cleanup_failed_safe_deletes

replays: 0007_organizationmember_replay_access

sentry: 1026_remove_group_open_period_event_id
sentry: 1027_delete_group_open_period_event_id
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: The migrations_lockfile.txt references migration 1027_delete_group_open_period_event_id, but the corresponding migration file is missing from the repository, which will cause the CI check to fail.
Severity: CRITICAL

Suggested Fix

Add the missing migration file for 1027_delete_group_open_period_event_id. This file should contain the DeletionAction.DELETE operation, which is the second step of the SafeRemoveField pattern initiated in the preceding migration.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: migrations_lockfile.txt#L34

Potential issue: The `migrations_lockfile.txt` has been updated to reference migration
`1027_delete_group_open_period_event_id`, but the corresponding migration file is not
present in the repository. The CI workflow runs a script that validates the lockfile
against the actual migration files on disk using `sentry django makemigrations --check`.
This check will fail because the referenced migration file does not exist, which will
block the pull request from being merged and prevent deployment.

Did we get this right? 👍 / 👎 to inform future reviews.


social_auth: 0003_social_auth_json_field

Expand Down
33 changes: 33 additions & 0 deletions src/sentry/migrations/1027_delete_group_open_period_event_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 5.2.8 on 2026-02-09 23:27

from sentry.new_migrations.migrations import CheckedMigration
from sentry.new_migrations.monkey.fields import SafeRemoveField
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", "1026_remove_group_open_period_event_id"),
]

operations = [
SafeRemoveField(
model_name="groupopenperiod",
name="event_id",
deletion_action=DeletionAction.DELETE,
),
]
Loading