Skip to content

feat(spans-migration): self hosted spans migration for discover saved queries - #106018

Closed
nikkikapadia wants to merge 9 commits into
masterfrom
nikki/discover-self-hosted-migration
Closed

nikkikapadia wants to merge 9 commits into
masterfrom
nikki/discover-self-hosted-migration

Conversation

@nikkikapadia

@nikkikapadia nikkikapadia commented Jan 9, 2026 •

Copy link
Copy Markdown
Member

We've migrated all discover queries on all regions (including single tenant) and are looking to migrate self hosted queries as well. This migration utilizes the migration function that we made and applies it to all the queries here.

NOTE: i won't be merging this until some feature flags are put into the next self-hosted release. Don't worry if it's sitting unmerged for a while :)

Closes EXP-552

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 9, 2026
@getsantry

getsantry Bot commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Jan 31, 2026
@getsantry

getsantry Bot commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@nikkikapadia nikkikapadia removed the Stale label Feb 2, 2026
@getsantry getsantry Bot added the Stale label Feb 24, 2026
@getsantry

getsantry Bot commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry

getsantry Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Mar 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1056_discover_to_explore_queries_self_hosted.py

for 1056_discover_to_explore_queries_self_hosted in sentry

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

@nikkikapadia nikkikapadia changed the title chore(spans-migration): self hosted spans migration for discover saved queries feat(spans-migration): self hosted spans migration for discover saved queries Mar 24, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Typo in migration hints table name breaks routing
    • Fixed typo by changing 'explpre_exploresavedquery' to 'explore_exploresavedquery' to match the actual db_table name in the ExploreSavedQuery model.

Create PR

Or push these changes by commenting:

@cursor push 0a731ce614
Preview (0a731ce614)
diff --git a/src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py b/src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py
--- a/src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py
+++ b/src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py
@@ -92,7 +92,7 @@ class Migration(CheckedMigration):
                     "sentry_discoversavedquery",
                     "sentry_discoversavedqueryproject",
                     "explore_exploresavedqueryproject",
-                    "explpre_exploresavedquery",
+                    "explore_exploresavedquery",
                 ]
             },
         )

@@ -92,7 +92,7 @@ class Migration(CheckedMigration):
                     "sentry_discoversavedquery",
                     "sentry_discoversavedqueryproject",
                     "explore_exploresavedqueryproject",
-                    "explpre_exploresavedquery",
+                    "explore_exploresavedquery",
                 ]
             },
         )

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3929c59. Configure here.

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1064_discover_to_explore_queries_self_hosted.py

for 1064_discover_to_explore_queries_self_hosted in sentry

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

@nikkikapadia
nikkikapadia marked this pull request as ready for review April 7, 2026 17:59
@nikkikapadia
nikkikapadia requested review from a team as code owners April 7, 2026 17:59
@linear-code

linear-code Bot commented Apr 7, 2026

Copy link
Copy Markdown

@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.

Similar feedback to #104803

tl;dr is that you should copy/paste translate_discover_query_to_explore_query into this migration and not import the external models (use DiscoverSavedQuery = apps.get_model("sentry", "DiscoverSavedQuery"))

@getsantry

getsantry Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

This branch was successfully deployed

1 active deployment
Preview — 8320b3a3 Deployed Apr 7, 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 WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants