Skip to content

feat(sourcemaps): Backfill has_debug_ids on artifact bundles - #130424

Open
sentry-junior[bot] wants to merge 4 commits into
feat/artifact-bundle-write-has-debug-idsfrom
feat/backfill-artifact-bundle-has-debug-ids
Open

sentry-junior[bot] wants to merge 4 commits into
feat/artifact-bundle-write-has-debug-idsfrom
feat/backfill-artifact-bundle-has-debug-ids

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Bundles uploaded before #130422 have has_debug_ids = false, even when they have debug-ID rows. This post-deployment migration sets the flag on these bundles.

The migration reads the bundles in batches of 1,000. For each bundle, it checks for one debug-ID row through the artifact_bundle_id index. It only sets the flag to true, so it is safe to run again.

Requires #130422

via @jan-auer.

--

View Session [Sentry]

Sets the flag on every bundle that has DebugIdArtifactBundle rows. Bundles uploaded since the write path deployed already have it, so this has to run after that change is deployed.

Co-Authored-By: Jan Michael Auer <1433023+jan-auer@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner November 9, 2026 14:01
@sentry-junior
sentry-junior Bot added this pull request to stack #130423 November 9, 2026 14:01
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1252_add_artifactbundle_has_debug_ids.py src/sentry/migrations/1253_backfill_artifactbundle_has_debug_ids.py

for 1252_add_artifactbundle_has_debug_ids in sentry

--
-- Add field has_debug_ids to artifactbundle
--
ALTER TABLE "sentry_artifactbundle" ADD COLUMN "has_debug_ids" boolean DEFAULT false NOT NULL;

for 1253_backfill_artifactbundle_has_debug_ids in sentry

--
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL

The backfill prints its own progress lines, so it does not need the
progress bar wrapper.
sentry-junior Bot and others added 2 commits November 9, 2026 16:36
Without the has_debug_ids filter, the range scan over bundles reads
only the primary key index. The update still skips bundles that are
already flagged.
…kfill-artifact-bundle-has-debug-ids

Co-Authored-By: Jan Michael Auer <1433023+jan-auer@users.noreply.github.com>
@mchen-sentry mchen-sentry added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Nov 9, 2026

@wedamija wedamija left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This table has around 100m rows. It'll probably take a while to process this, but I think it should be able to run successfully.

This branch was successfully deployed

1 active deployment
Preview — 4e63fd3c Deployed Nov 9, 2026 by vercel[bot]
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 Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants