Skip to content

chore(launchpad): actually delete preprodartifact.analysis_file_id #94658

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NicoHinderling
Copy link
Contributor

@NicoHinderling NicoHinderling commented Jun 30, 2025

must wait until #94657 is fully deployed to merge

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 30, 2025
@NicoHinderling NicoHinderling marked this pull request as ready for review June 30, 2025 20:54
@NicoHinderling NicoHinderling requested a review from a team as a code owner June 30, 2025 20:54
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/preprod/migrations/0008_make_preprod_analysis_file_id_in_size_metrics_table.py src/sentry/preprod/migrations/0009_drop_preprod_artifact_analysis_file_id_col.py src/sentry/preprod/migrations/0010_actual_drop_preprod_artifact_analysis_file_id_col.py

for 0008_make_preprod_analysis_file_id_in_size_metrics_table in preprod

--
-- Add field analysis_file_id to preprodartifactsizemetrics
--
ALTER TABLE "sentry_preprodartifactsizemetrics" ADD COLUMN "analysis_file_id" bigint NULL;
CREATE INDEX CONCURRENTLY "sentry_preprodartifactsizemetrics_analysis_file_id_f7c6d67f" ON "sentry_preprodartifactsizemetrics" ("analysis_file_id");

for 0009_drop_preprod_artifact_analysis_file_id_col in preprod

--
-- Moved preprodartifact.analysis_file_id field to pending deletion state
--
-- (no-op)

for 0010_actual_drop_preprod_artifact_analysis_file_id_col in preprod

--
-- Remove field analysis_file_id from preprodartifact
--
ALTER TABLE "sentry_preprodartifact" DROP COLUMN "analysis_file_id" CASCADE;

cursor[bot]

This comment was marked as outdated.

@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_soft_delete_preprodartifact.analysis_file_id branch from cb9742a to 320a058 Compare June 30, 2025 21:08
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_actually_delete_preprodartifact.analysis_file_id branch from d407355 to 5e7da81 Compare June 30, 2025 21:08
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_soft_delete_preprodartifact.analysis_file_id branch from 320a058 to fd64ede Compare June 30, 2025 21:12
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_actually_delete_preprodartifact.analysis_file_id branch from 5e7da81 to 88efe9f Compare June 30, 2025 21:12
cursor[bot]

This comment was marked as outdated.

@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_soft_delete_preprodartifact.analysis_file_id branch from fd64ede to 423ccba Compare June 30, 2025 21:17
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_actually_delete_preprodartifact.analysis_file_id branch from 88efe9f to 8d38f6e Compare June 30, 2025 21:17
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_soft_delete_preprodartifact.analysis_file_id branch from 423ccba to 14a8e46 Compare June 30, 2025 22:19
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_actually_delete_preprodartifact.analysis_file_id branch from 8d38f6e to 7f23f18 Compare June 30, 2025 22:19
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/preprod/migrations/0009_drop_preprod_artifact_analysis_file_id_col.py src/sentry/preprod/migrations/0010_actual_drop_preprod_artifact_analysis_file_id_col.py

for 0009_drop_preprod_artifact_analysis_file_id_col in preprod

--
-- Moved preprodartifact.analysis_file_id field to pending deletion state
--
-- (no-op)

for 0010_actual_drop_preprod_artifact_analysis_file_id_col in preprod

--
-- Remove field analysis_file_id from preprodartifact
--
ALTER TABLE "sentry_preprodartifact" DROP COLUMN "analysis_file_id" CASCADE;

@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_actually_delete_preprodartifact.analysis_file_id branch from 7f23f18 to c4a1864 Compare June 30, 2025 22:22
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_soft_delete_preprodartifact.analysis_file_id branch from 14a8e46 to 7b6eff2 Compare June 30, 2025 22:22
cursor[bot]

This comment was marked as outdated.

@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_actually_delete_preprodartifact.analysis_file_id branch from c4a1864 to 75e612e Compare June 30, 2025 22:43
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_soft_delete_preprodartifact.analysis_file_id branch from 7b6eff2 to 60fed41 Compare June 30, 2025 22:43
cursor[bot]

This comment was marked as outdated.

Base automatically changed from 06-30-chore_launchpad_soft_delete_preprodartifact.analysis_file_id to master June 30, 2025 23:02
@NicoHinderling NicoHinderling force-pushed the 06-30-chore_launchpad_actually_delete_preprodartifact.analysis_file_id branch from 75e612e to 1e776c5 Compare June 30, 2025 23:06
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/preprod/migrations/0010_actual_drop_preprod_artifact_analysis_file_id_col.py

for 0010_actual_drop_preprod_artifact_analysis_file_id_col in preprod

--
-- Remove field analysis_file_id from preprodartifact
--
ALTER TABLE "sentry_preprodartifact" DROP COLUMN "analysis_file_id" CASCADE;

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Migration Timing Error: Incorrect `is_post_deployment` Setting

The migration 0010_actual_drop_preprod_artifact_analysis_file_id_col incorrectly sets is_post_deployment = False. This migration drops the analysis_file_id column from preprodartifact. As a schema alteration, and critically, due to an explicit dependency on PR #94657 (which removes code references to this field) being fully deployed, this setting creates a timing issue. The column could be dropped during deployment before the code changes are deployed, potentially causing runtime errors. is_post_deployment should be True to ensure the migration runs only after the code is deployed.

src/sentry/preprod/migrations/0010_actual_drop_preprod_artifact_analysis_file_id_col.py#L20-L21

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

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.

2 participants