Skip to content

feat(sourcemaps): Add has_debug_ids flag to ProjectArtifactBundle - #130421

Merged
jan-auer merged 2 commits into
masterfrom
feat/artifact-bundle-has-debug-ids-schema
Nov 13, 2026
Merged

jan-auer merged 2 commits into
masterfrom
feat/artifact-bundle-has-debug-ids-schema

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

The source map debugger shows if a project uploaded any file with a debug ID. It runs this check when no debug ID of the event matches an upload. The check queries sentry_debugidartifactbundle. This table has one row for each debug ID in each bundle. When the project has no debug IDs, the query reads all debug-ID rows of the organization.

A bundle gets its debug-ID rows only at its first upload. The rows are deleted only together with the bundle. So a boolean gives the same answer.

This PR adds the has_debug_ids column to ProjectArtifactBundle, not to ArtifactBundle. A later PR adds a partial index on project_id that contains only the links with the flag. With this index, the check is one index lookup for each project. A flag on ArtifactBundle cannot do this, because that table has no project column.

The column is NOT NULL with a database default of false. Postgres adds this column without a table rewrite, so this is a normal deployment migration:

ALTER TABLE "sentry_projectartifactbundle" ADD COLUMN "has_debug_ids" boolean DEFAULT false NOT NULL;

Nothing writes or reads the column yet.

Stack:

  1. feat(sourcemaps): Add has_debug_ids flag to ProjectArtifactBundle #130421 (this PR): add the column.
  2. feat(sourcemaps): Set has_debug_ids when linking an artifact bundle to a project #130422: set the flag on new links.
  3. feat(sourcemaps): Backfill and index has_debug_ids on project artifact bundles #130424: backfill the flag and add the index. Both are post-deployment migrations.
  4. ref(sourcemaps): Read has_debug_ids in the source map debugger #130425: read the flag in the source map debugger.

via @jan-auer.

--

View Session [Sentry]

@sentry-junior
sentry-junior Bot requested review from a team as code owners November 9, 2026 14:00
@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/1259_add_projectartifactbundle_has_debug_ids.py

for 1259_add_projectartifactbundle_has_debug_ids in sentry

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

vgrozdanic
vgrozdanic previously approved these changes Nov 9, 2026
lcian
lcian previously approved these changes Nov 9, 2026
@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 previously approved these changes Nov 9, 2026
@sentry-junior
sentry-junior Bot force-pushed the feat/artifact-bundle-has-debug-ids-schema branch from a2c190a to fc533b4 Compare November 10, 2026 15:32
@sentry-junior sentry-junior Bot changed the title feat(sourcemaps): Add has_debug_ids flag to ArtifactBundle feat(sourcemaps): Add has_debug_ids flag to ProjectArtifactBundle Nov 10, 2026
@sentry-junior
sentry-junior Bot dismissed stale reviews from vgrozdanic, lcian, and wedamija November 10, 2026 15:33

The stack changed: has_debug_ids moved from ArtifactBundle to ProjectArtifactBundle with a partial index on project_id, and the PRs are rebased on master. Please review again.

@sentry-junior
sentry-junior Bot force-pushed the feat/artifact-bundle-has-debug-ids-schema branch 3 times, most recently from c8a5176 to 76ffea5 Compare November 12, 2026 21:50
Comment thread src/sentry/models/artifactbundle.py Resolved
sentry-junior Bot and others added 2 commits November 13, 2026 09:14
Adds a column that says whether the linked bundle has any DebugIdArtifactBundle rows, so checking whether a project uploaded any file with a debug ID can read only the project's links instead of the organization's debug-ID rows. The column is on the link and not on the bundle, so that a partial index on project_id can answer the check with one lookup. Nothing writes or reads it yet.

Co-Authored-By: Jan Michael Auer <1433023+jan-auer@users.noreply.github.com>
@sentry-junior
sentry-junior Bot force-pushed the feat/artifact-bundle-has-debug-ids-schema branch from 76ffea5 to 7d74144 Compare November 13, 2026 09:15
@jan-auer
jan-auer merged commit 8220226 into master Nov 13, 2026
99 checks passed
@jan-auer
jan-auer deleted the feat/artifact-bundle-has-debug-ids-schema branch November 13, 2026 09:24
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.

5 participants