ref(cells): Add cell_name support to rpc dataclasses#111169
Merged
ref(cells): Add cell_name support to rpc dataclasses#111169
Conversation
Same idea as #111039 for the rest of the rpc models
markstory
approved these changes
Mar 20, 2026
markstory
approved these changes
Mar 23, 2026
|
|
||
|
|
||
| # TODO(cells): Tmp support for cell_name as well as region_name in Rpc classes. | ||
| # Remove once all callers pass region_name directly. |
Member
There was a problem hiding this comment.
Suggested change
| # Remove once all callers pass region_name directly. | |
| # Remove once all callers pass cell_name directly. |
Contributor
Backend Test FailuresFailures on
|
Contributor
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: Mixin root_validator may not be discovered by pydantic v1
- Made
AcceptCellNameMixininherit frompydantic.BaseModelso its root validator is registered andcell_nameinputs correctly populateregion_name, and added a regression test.
- Made
Or push these changes by commenting:
@cursor push 747b2b8a5f
Preview (747b2b8a5f)
diff --git a/src/sentry/hybridcloud/rpc/__init__.py b/src/sentry/hybridcloud/rpc/__init__.py
--- a/src/sentry/hybridcloud/rpc/__init__.py
+++ b/src/sentry/hybridcloud/rpc/__init__.py
@@ -42,7 +42,7 @@
# TODO(cells): Tmp support for cell_name as well as region_name in Rpc classes.
# Remove once all callers pass cell_name directly.
-class AcceptCellNameMixin:
+class AcceptCellNameMixin(pydantic.BaseModel):
region_name: str # must be defined by subclass
@root_validator(pre=True)
diff --git a/tests/sentry/hybridcloud/services/test_control_organization_provisioning.py b/tests/sentry/hybridcloud/services/test_control_organization_provisioning.py
--- a/tests/sentry/hybridcloud/services/test_control_organization_provisioning.py
+++ b/tests/sentry/hybridcloud/services/test_control_organization_provisioning.py
@@ -99,6 +99,19 @@
@all_silo_test(cells=create_test_cells("us"))
class TestControlOrganizationProvisioning(TestControlOrganizationProvisioningBase):
+ def test_slug_reservation_rpc_model_accepts_cell_name(self) -> None:
+ rpc_org_slug = RpcOrganizationSlugReservation(
+ id=1,
+ organization_id=1,
+ user_id=self.provision_user.id,
+ slug="sentry",
+ cell_name="us",
+ reservation_type=OrganizationSlugReservationType.PRIMARY.value,
+ )
+
+ assert rpc_org_slug.region_name == "us"
+ assert rpc_org_slug.cell_name == "us"
+
def test_organization_provisioning_happy_path(self) -> None:
rpc_org_slug = self.provision_organization()
self.assert_slug_reservation_and_org_exist(This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
JoshuaKGoldberg
pushed a commit
that referenced
this pull request
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Same idea as #111039 for the rest of the rpc dataclasses
merge only after successful deploy on #111039 first