Skip to content

feat(cells): Compare locality not cell name in fork locality restriction#112883

Open
lynnagara wants to merge 1 commit intomasterfrom
lyn/cells/fix-fork-locality-check
Open

feat(cells): Compare locality not cell name in fork locality restriction#112883
lynnagara wants to merge 1 commit intomasterfrom
lyn/cells/fix-fork-locality-check

Conversation

@lynnagara
Copy link
Copy Markdown
Member

CANNOT_FORK_FROM_REGION contained locality names (e.g. "de") but was compared against cell names. This works now while cells and localities are 1:1 named, but will not work in the future when we allow localities to grow to contain multiple cells (e.g. "us1", "us2" cells in "us" locality).

Now we resolve the replying cell name to its locality via get_global_directory().get_locality_for_cell() before comparing, with a fallback to the cell name for test environments without locality config. Rename CANNOT_FORK_FROM_REGION -> CANNOT_FORK_FROM_LOCALITY and the error constant accordingly.

CANNOT_FORK_FROM_REGION contained locality names (e.g. "de") but was
compared against cell names. This works now while cells and localities
are 1:1 named, but will break as a locality grows to contain multiple
cells (e.g. "us1", "us2").

Now we resolve the replying cell name to its locality via
get_global_directory().get_locality_for_cell() before comparing, with a
fallback to the cell name for test environments without locality config.
Rename CANNOT_FORK_FROM_REGION -> CANNOT_FORK_FROM_LOCALITY and the
error constant accordingly.
@lynnagara lynnagara requested review from a team as code owners April 13, 2026 23:39
@lynnagara lynnagara requested a review from a team April 13, 2026 23:39
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 13, 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.

1 participant