Skip to content

ref(cells): clean up dead is_historical_monolith region handling#112053

Closed
lynnagara wants to merge 1 commit intomasterfrom
historic-monolith-region
Closed

ref(cells): clean up dead is_historical_monolith region handling#112053
lynnagara wants to merge 1 commit intomasterfrom
historic-monolith-region

Conversation

@lynnagara
Copy link
Copy Markdown
Member

hybrid cloud migration happened years ago, we shouldn't keep temporary code for the migration around, which special cases the "us" region

hybrid cloud migration happened years ago, we shouldn't keep
temporary code for the migration around, which special cases
the "us" region
@lynnagara lynnagara requested a review from a team April 1, 2026 21:52
@lynnagara lynnagara requested review from a team as code owners April 1, 2026 21:52
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 1, 2026
Copy link
Copy Markdown
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 is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

return invite_context
# The pre-silo migration invite URL format omitted the org ID/slug.
# Those links have long since expired, so we no longer attempt to resolve them.
return None
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.

Dead function stub with unused parameters remains

Low Severity

handle_empty_organization_id_or_slug now unconditionally returns None and none of its three parameters (member_id, user_id, request) are used. This is dead code that outlived the cleanup — the function and its call in get_invite_state could be replaced with a direct return None (with the comment inline), removing an unnecessary layer of indirection.

Additional Locations (1)
Fix in Cursor Fix in Web

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Backend Test Failures

Failures on 598394c in this run:

tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_can_accept_while_authenticatedlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:257: in test_can_accept_while_authenticated
    assert resp.status_code == 204
E   assert 400 == 204
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_can_accept_when_user_has_2falog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:372: in test_can_accept_when_user_has_2fa
    assert resp.status_code == 204
E   assert 400 == 204
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_user_has_2falog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:223: in test_user_has_2fa
    assert resp.status_code == 200
E   assert 400 == 200
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_not_needs_authenticationlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:129: in test_not_needs_authentication
    assert resp.status_code == 200
E   assert 400 == 200
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_multi_region_organizationmember_idlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:185: in test_multi_region_organizationmember_id
    assert resp.status_code == 200
E   assert 400 == 200
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_needs_authenticationlog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:118: in test_needs_authentication
    assert resp.status_code == 200
E   assert 400 == 200
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_member_already_existslog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:331: in test_member_already_exists
    assert resp.status_code == 204
E   assert 400 == 204
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_2fa_cookie_deleted_after_acceptlog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:424: in test_2fa_cookie_deleted_after_accept
    assert resp.status_code == 200
E   assert 400 == 200
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_user_can_use_ssolog
[gw1] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:237: in test_user_can_use_sso
    assert resp.status_code == 200
E   assert 400 == 200
E    +  where 400 = <Response status_code=400, "application/json">.status_code
tests/sentry/api/endpoints/test_accept_organization_invite.py::AcceptInviteTest::test_user_needs_2falog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/sentry/api/endpoints/test_accept_organization_invite.py:144: in test_user_needs_2fa
    assert resp.status_code == 200
E   assert 400 == 200
E    +  where 400 = <Response status_code=400, "application/json">.status_code

lynnagara added a commit that referenced this pull request Apr 2, 2026
this removes the pre-silo organization invite path.

this fundamentally does not work in the regional or cell world
-- all org specific routes need to contain the org identifier
(id or slug) in order to target the correct cell.

since we have not sent invites using this path for many years, it
should be safe to remove

this is a prequisite to #112053
and other codebase cleanups
Copy link
Copy Markdown
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Test failures look relevant

@@ -32,41 +28,9 @@
def handle_empty_organization_id_or_slug(
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.

Do we need to keep this function? It is not used in getsentry.

@lynnagara
Copy link
Copy Markdown
Member Author

lynnagara commented Apr 14, 2026

closing for now, need to wait until may 8th to remove this. after this date all the invite links previously sent to legacy urls would be expired and this can all removed along with a number of other related code paths

@lynnagara lynnagara closed this Apr 14, 2026
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.

2 participants