Skip to content

fix(ui): Preserve Seer paths in URL normalization#111317

Merged
scttcper merged 2 commits intomasterfrom
scttcper/add-seer-to-settings-exceptions
Mar 23, 2026
Merged

fix(ui): Preserve Seer paths in URL normalization#111317
scttcper merged 2 commits intomasterfrom
scttcper/add-seer-to-settings-exceptions

Conversation

@scttcper
Copy link
Member

@scttcper scttcper commented Mar 23, 2026

Normalization treated the first segment after /settings/ as the org slug, which dropped /seer/ from org Seer settings and broke tab links. Exclude seer

scttcper and others added 2 commits March 23, 2026 10:30
Normalization treated the first segment after /settings/ as the org slug,
which dropped /seer/ from org Seer settings and broke tab links. Exclude
seer (and tighten stats matching) in normalizeUrl patterns, pass the
normalized href from Seer settings tabs, and add regression tests.

Co-Authored-By: Cursor <cursor@cursor.com>
Made-with: Cursor
@scttcper scttcper requested review from a team as code owners March 23, 2026 17:32
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 23, 2026
@ryan953
Copy link
Member

ryan953 commented Mar 23, 2026

Looks related to #111279

Copy link
Contributor

@cursor cursor bot left a comment

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.

Fix All in Cursor

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

  • ✅ Fixed: Backend URL patterns not updated to preserve seer paths
    • Updated the backend customer-domain settings path regexes to preserve Seer routes and added a regression test for /settings/seer/ paths.

Create PR

Or push these changes by commenting:

@cursor push cd2cbeb33a
Preview (cd2cbeb33a)
diff --git a/src/sentry/organizations/absolute_url.py b/src/sentry/organizations/absolute_url.py
--- a/src/sentry/organizations/absolute_url.py
+++ b/src/sentry/organizations/absolute_url.py
@@ -12,13 +12,13 @@
     (re.compile(r"\/?organizations\/(?!new)[^/]+\/(.*)"), r"/\1"),
     # For /settings/:orgId/ -> /settings/organization/
     (
-        re.compile(r"\/settings\/(?!account\/|!billing\/|projects\/|teams)[^/]+\/?$"),
+        re.compile(r"\/settings\/(?!account\/|!billing\/|projects\/|teams|seer\/)[^/]+\/?$"),
         "/settings/organization/",
     ),
     # Move /settings/:orgId/:section -> /settings/:section
     # but not /settings/organization or /settings/projects which is a new URL
     (
-        re.compile(r"^\/?settings\/(?!account\/|billing\/|projects\/|teams)[^/]+\/(.*)"),
+        re.compile(r"^\/?settings\/(?!account\/|billing\/|projects\/|teams|seer\/)[^/]+\/(.*)"),
         r"/settings/\1",
     ),
     (re.compile(r"^\/?join-request\/[^/]+\/?.*"), r"/join-request/"),

diff --git a/tests/sentry/organizations/test_absolute_url.py b/tests/sentry/organizations/test_absolute_url.py
--- a/tests/sentry/organizations/test_absolute_url.py
+++ b/tests/sentry/organizations/test_absolute_url.py
@@ -64,6 +64,8 @@
             "/settings/projects/getting-started/abc123/",
         ),
         ("/settings/teams/peeps/", "/settings/teams/peeps/"),
+        ("/settings/seer/", "/settings/seer/"),
+        ("/settings/seer/repos/", "/settings/seer/repos/"),
         # Prevent routes should remain as-is
         ("/prevent/", "/prevent/"),
         ("/prevent/tokens/", "/prevent/tokens/"),

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

// but not /settings/organization or /settings/projects which is a new URL
[
/^\/?settings\/(?!account\/|billing\/|projects\/|teams\/|stats\/)[^/]+\/(.*)/,
/^\/?settings\/(?!account\/|billing\/|projects\/|teams\/|stats\/|seer\/)[^/]+\/(.*)/,
Copy link
Contributor

Choose a reason for hiding this comment

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

Backend URL patterns not updated to preserve seer paths

Medium Severity

Line 5 of this file says "If you change this also update the patterns in sentry.api.utils." The server-side companion patterns in src/sentry/organizations/absolute_url.py (_path_patterns) were not updated with the seer\/ exclusion. If the backend normalizes an already-normalized path like /settings/seer/repos/ via customer_domain_path(), it will treat seer as an org slug and produce /settings/repos/, breaking server-generated Seer settings URLs (e.g. in emails or redirects).

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

added in #111322

scttcper added a commit that referenced this pull request Mar 23, 2026
@scttcper scttcper requested a review from markstory March 23, 2026 17:57
scttcper added a commit that referenced this pull request Mar 23, 2026
@scttcper scttcper merged commit 5d6e653 into master Mar 23, 2026
73 checks passed
@scttcper scttcper deleted the scttcper/add-seer-to-settings-exceptions branch March 23, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants