Skip to content

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

Open
sentry-junior[bot] wants to merge 1 commit into
masterfrom
feat/artifact-bundle-has-debug-ids-schema
Open

sentry-junior[bot] wants to merge 1 commit 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/1256_add_projectartifactbundle_has_debug_ids.py

for 1256_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.

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 fc533b4 to dd66262 Compare November 11, 2026 23:13

This branch was successfully deployed

1 active (outdated) deployment
Preview — a2c190a8 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.

5 participants