Skip to content

ref: Begin deprecating category from localities - #123250

Open
lynnagara wants to merge 4 commits into
masterfrom
locality-category
Open

ref: Begin deprecating category from localities#123250
lynnagara wants to merge 4 commits into
masterfrom
locality-category

Conversation

@lynnagara

Copy link
Copy Markdown
Member

No longer required, visibility is controlled via visible and signup_visible parameters

No longer required, visibility is controlled via `visible` and `signup_visible`
parameters
@lynnagara
lynnagara requested review from a team as code owners August 31, 2026 21:24
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 31, 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.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 61ca126. Configure here.

Comment thread src/sentry/core/endpoints/organization_index.py
Comment thread src/sentry/core/endpoints/organization_index.py
Comment thread src/sentry/types/cell.py
Comment on lines 498 to +499
"""
return [
loc.name
for loc in get_global_directory().localities
if loc.category == RegionCategory.MULTI_TENANT and loc.visible
]
return [loc.name for loc in get_global_directory().localities if loc.visible]

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.

Bug: Removing the category check in find_all_multitenant_locality_names may incorrectly expose single-tenant localities in the UI if they are configured with visible=True.
Severity: HIGH

Suggested Fix

Verify that all production configurations for single-tenant localities have been updated to set visible=False. To mitigate risk, consider adding logging to detect and alert on any single-tenant localities with visible=True during a transition period. Ensure the breaking nature of this change is clearly communicated.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/sentry/types/cell.py#L498-L499

Potential issue: The function `find_all_multitenant_locality_names` was changed to
filter localities solely based on the `visible` flag, removing the previous check for
`category == RegionCategory.MULTI_TENANT`. This change assumes that all single-tenant
localities in production configurations have been updated to `visible=False`. If any
single-tenant locality is configured with `visible=True`, it will now be incorrectly
exposed in the frontend UI and included in DNS prefetching. This represents a breaking
change and a migration risk, as the required configuration updates are not mentioned or
enforced, potentially leading to unintended exposure of single-tenant environments.

Also affects:

  • src/sentry/web/client_config.py:367~372

Comment thread src/sentry/core/endpoints/organization_index.py
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.

1 participant