Skip to content

ref(dsyms): Prefer debug ids over code ids #95861

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

Merged
merged 5 commits into from
Jul 21, 2025
Merged

Conversation

Dav1dde
Copy link
Member

@Dav1dde Dav1dde commented Jul 18, 2025

Only fallback to a code id search if there is no 'perfect' match for a debug id.

Example SQL query:

 (
 SELECT     "sentry_projectdsymfile"."id"            AS "col1",
            "sentry_projectdsymfile"."file_id"       AS "col2",
            "sentry_projectdsymfile"."checksum"      AS "col3",
            "sentry_projectdsymfile"."object_name"   AS "col4",
            "sentry_projectdsymfile"."cpu_name"      AS "col5",
            "sentry_projectdsymfile"."project_id"    AS "col6",
            "sentry_projectdsymfile"."uuid"          AS "col7",
            "sentry_projectdsymfile"."code_id"       AS "col8",
            "sentry_projectdsymfile"."data"          AS "col9",
            "sentry_projectdsymfile"."date_accessed" AS "col10",
            "sentry_file"."id"                       AS "col11",
            "sentry_file"."name"                     AS "col12",
            "sentry_file"."type"                     AS "col13",
            "sentry_file"."timestamp"                AS "col14",
            "sentry_file"."headers"                  AS "col15",
            "sentry_file"."size"                     AS "col16",
            "sentry_file"."checksum"                 AS "col17",
            "sentry_file"."blob_id"                  AS "col18",
            "sentry_file"."path"                     AS "col19"
 FROM       "sentry_projectdsymfile"
 INNER JOIN "sentry_file"
 ON         (
                       "sentry_projectdsymfile"."file_id" = "sentry_file"."id")
 WHERE      (
                       "sentry_projectdsymfile"."uuid" = dfb8e43a-f242-3d73-a453-aeb6a777ef75
            AND        "sentry_projectdsymfile"."project_id" = 4556436849360897))
UNION
      (
                 SELECT     "sentry_projectdsymfile"."id"            AS "col1",
                            "sentry_projectdsymfile"."file_id"       AS "col2",
                            "sentry_projectdsymfile"."checksum"      AS "col3",
                            "sentry_projectdsymfile"."object_name"   AS "col4",
                            "sentry_projectdsymfile"."cpu_name"      AS "col5",
                            "sentry_projectdsymfile"."project_id"    AS "col6",
                            "sentry_projectdsymfile"."uuid"          AS "col7",
                            "sentry_projectdsymfile"."code_id"       AS "col8",
                            "sentry_projectdsymfile"."data"          AS "col9",
                            "sentry_projectdsymfile"."date_accessed" AS "col10",
                            "sentry_file"."id"                       AS "col11",
                            "sentry_file"."name"                     AS "col12",
                            "sentry_file"."type"                     AS "col13",
                            "sentry_file"."timestamp"                AS "col14",
                            "sentry_file"."headers"                  AS "col15",
                            "sentry_file"."size"                     AS "col16",
                            "sentry_file"."checksum"                 AS "col17",
                            "sentry_file"."blob_id"                  AS "col18",
                            "sentry_file"."path"                     AS "col19"
                 FROM       "sentry_projectdsymfile"
                 INNER JOIN "sentry_file"
                 ON         (
                                       "sentry_projectdsymfile"."file_id" = "sentry_file"."id")
                 WHERE      (
                                       "sentry_projectdsymfile"."code_id" = ae0459704fc7256
                            AND        "sentry_projectdsymfile"."project_id" = 4556436849360897
                            AND        NOT EXISTS
                                       (
                                              SELECT 1 AS "a"
                                              FROM   "sentry_projectdsymfile" u0
                                              WHERE  (
                                                            u0."uuid" = dfb8e43a-f242-3d73-a453-aeb6a777ef75
                                                     AND    u0."project_id" = 4556436849360897) limit 1)))

Copy link

codecov bot commented Jul 18, 2025

Codecov Report

Attention: Patch coverage is 47.22222% with 19 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/api/endpoints/debug_files.py 55.00% 9 Missing ⚠️
tests/sentry/api/endpoints/test_debug_files.py 30.76% 9 Missing ⚠️
src/sentry/debug_files/debug_files.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #95861      +/-   ##
==========================================
- Coverage   87.74%   80.43%   -7.32%     
==========================================
  Files       10582    10582              
  Lines      610032   610048      +16     
  Branches    23976    23976              
==========================================
- Hits       535276   490683   -44593     
- Misses      74472   119081   +44609     
  Partials      284      284              

@Dav1dde Dav1dde marked this pull request as ready for review July 18, 2025 09:36
@Dav1dde Dav1dde requested a review from a team as a code owner July 18, 2025 09:36
@Dav1dde Dav1dde requested a review from vgrozdanic July 18, 2025 09:37
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@Dav1dde Dav1dde merged commit 24b30b4 into master Jul 21, 2025
64 checks passed
@Dav1dde Dav1dde deleted the dav1d/prefer-debug-id branch July 21, 2025 06:11
andrewshie-sentry pushed a commit that referenced this pull request Jul 21, 2025
Only fallback to a code id search if there is no 'perfect' match for a
debug id.

Example SQL query:

```sql
 (
 SELECT     "sentry_projectdsymfile"."id"            AS "col1",
            "sentry_projectdsymfile"."file_id"       AS "col2",
            "sentry_projectdsymfile"."checksum"      AS "col3",
            "sentry_projectdsymfile"."object_name"   AS "col4",
            "sentry_projectdsymfile"."cpu_name"      AS "col5",
            "sentry_projectdsymfile"."project_id"    AS "col6",
            "sentry_projectdsymfile"."uuid"          AS "col7",
            "sentry_projectdsymfile"."code_id"       AS "col8",
            "sentry_projectdsymfile"."data"          AS "col9",
            "sentry_projectdsymfile"."date_accessed" AS "col10",
            "sentry_file"."id"                       AS "col11",
            "sentry_file"."name"                     AS "col12",
            "sentry_file"."type"                     AS "col13",
            "sentry_file"."timestamp"                AS "col14",
            "sentry_file"."headers"                  AS "col15",
            "sentry_file"."size"                     AS "col16",
            "sentry_file"."checksum"                 AS "col17",
            "sentry_file"."blob_id"                  AS "col18",
            "sentry_file"."path"                     AS "col19"
 FROM       "sentry_projectdsymfile"
 INNER JOIN "sentry_file"
 ON         (
                       "sentry_projectdsymfile"."file_id" = "sentry_file"."id")
 WHERE      (
                       "sentry_projectdsymfile"."uuid" = dfb8e43a-f242-3d73-a453-aeb6a777ef75
            AND        "sentry_projectdsymfile"."project_id" = 4556436849360897))
UNION
      (
                 SELECT     "sentry_projectdsymfile"."id"            AS "col1",
                            "sentry_projectdsymfile"."file_id"       AS "col2",
                            "sentry_projectdsymfile"."checksum"      AS "col3",
                            "sentry_projectdsymfile"."object_name"   AS "col4",
                            "sentry_projectdsymfile"."cpu_name"      AS "col5",
                            "sentry_projectdsymfile"."project_id"    AS "col6",
                            "sentry_projectdsymfile"."uuid"          AS "col7",
                            "sentry_projectdsymfile"."code_id"       AS "col8",
                            "sentry_projectdsymfile"."data"          AS "col9",
                            "sentry_projectdsymfile"."date_accessed" AS "col10",
                            "sentry_file"."id"                       AS "col11",
                            "sentry_file"."name"                     AS "col12",
                            "sentry_file"."type"                     AS "col13",
                            "sentry_file"."timestamp"                AS "col14",
                            "sentry_file"."headers"                  AS "col15",
                            "sentry_file"."size"                     AS "col16",
                            "sentry_file"."checksum"                 AS "col17",
                            "sentry_file"."blob_id"                  AS "col18",
                            "sentry_file"."path"                     AS "col19"
                 FROM       "sentry_projectdsymfile"
                 INNER JOIN "sentry_file"
                 ON         (
                                       "sentry_projectdsymfile"."file_id" = "sentry_file"."id")
                 WHERE      (
                                       "sentry_projectdsymfile"."code_id" = ae0459704fc7256
                            AND        "sentry_projectdsymfile"."project_id" = 4556436849360897
                            AND        NOT EXISTS
                                       (
                                              SELECT 1 AS "a"
                                              FROM   "sentry_projectdsymfile" u0
                                              WHERE  (
                                                            u0."uuid" = dfb8e43a-f242-3d73-a453-aeb6a777ef75
                                                     AND    u0."project_id" = 4556436849360897) limit 1)))
```
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.

3 participants