Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sentry/organizations/absolute_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
re.compile(r"^\/?(?!settings)[^/]+\/([^/]+)\/getting-started\/(.*)"),
r"/getting-started/\1/\2",
),
(re.compile(r"^\/?checkout\/[^/]+\/(.*)"), r"/checkout/\1"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Checkout pattern misses paths without trailing slash

The checkout regex pattern requires a slash after the organization slug, so /checkout/acme (without trailing slash) won't match and won't be transformed, while /checkout/acme/ will transform to /checkout/. This creates inconsistent behavior. The pattern should use \/? instead of \/ before the capture group to handle both cases, similar to how the join-request pattern handles optional trailing slashes.

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.

the slash is required, similar to onboarding

]


Expand Down
2 changes: 2 additions & 0 deletions tests/sentry/organizations/test_absolute_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
("/join-request/acme/", "/join-request/"),
("/onboarding/acme/", "/onboarding/"),
("/onboarding/acme/project/", "/onboarding/project/"),
("/checkout/acme/", "/checkout/"),
("/checkout/acme/?query=value", "/checkout/?query=value"),
("/organizations/new/", "/organizations/new/"),
("/organizations/albertos-apples/issues/", "/issues/"),
("/organizations/albertos-apples/issues/?_q=all#hash", "/issues/?_q=all#hash"),
Expand Down
Loading