fix(ui): Preserve Seer paths in URL normalization#111317
Conversation
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
|
Looks related to #111279 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
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.
- Updated the backend customer-domain settings path regexes to preserve Seer routes and added a regression test for
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\/)[^/]+\/(.*)/, |
There was a problem hiding this comment.
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).



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