Skip to content

ref(cells): update region_name to cell_name in rpc dataclasses#111039

Merged
lynnagara merged 4 commits intomasterfrom
rpc-dataclasses
Mar 20, 2026
Merged

ref(cells): update region_name to cell_name in rpc dataclasses#111039
lynnagara merged 4 commits intomasterfrom
rpc-dataclasses

Conversation

@lynnagara
Copy link
Member

this adds support for cell_name in RpcOrganizationMapping and RpcOrganizationMappingUpdate classes. region_name is still being sent on the wire currently. that will be flipped as the next step.

this adds support for `cell_name` in RpcOrganizationMapping and RpcOrganizationMappingUpdate
classes. `region_name` is still being sent on the wire currently. that will be
flipped as the next step.
@lynnagara lynnagara requested review from a team as code owners March 18, 2026 22:06
@lynnagara lynnagara requested a review from a team March 18, 2026 22:06
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 18, 2026
Comment on lines +38 to +40
if "cell_name" in values and "region_name" not in values:
values["region_name"] = values.pop("cell_name")
return values
Copy link
Member

Choose a reason for hiding this comment

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

Is this intended to be a forwards compatible shim for when the wire format changes to using cell_name?

Copy link
Member Author

@lynnagara lynnagara Mar 19, 2026

Choose a reason for hiding this comment

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

Yes. This is the first step so all we can flip all usages of .region_name to .cell_name first here and in getsentry and support both on the wire

2nd step will be to change the wire format

3rd step would be to remove the shim and fully rename the region_name property to cell_name

Copy link
Member

Choose a reason for hiding this comment

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

That sounds like it will work.

@root_validator(pre=True)
@classmethod
def _accept_cell_name(cls, values: dict[str, Any]) -> dict[str, Any]:
if "cell_name" in values and "region_name" not in values:
Copy link
Member

Choose a reason for hiding this comment

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

Should this also check that values['region_name'] is truthy to handle the removal process where a default value will be sent?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so because:

  • The default value "" isn't really valid here. An org mapping should always have a real cell/region
  • since this runs with pre=True, this is the first step before any other validation or defaults are applied

@lynnagara lynnagara merged commit f1367eb into master Mar 20, 2026
76 checks passed
@lynnagara lynnagara deleted the rpc-dataclasses branch March 20, 2026 16:43
lynnagara added a commit that referenced this pull request Mar 23, 2026
the pydantic models RpcOrganizationMapping and
RpcOrganizationMappingUpdate used for rpc now send `cell_name` instead
of `region_name` on the wire

support for both fields was added in
#111039
lynnagara added a commit that referenced this pull request Mar 24, 2026
Same idea as #111039 for the
rest of the rpc dataclasses

merge only after successful deploy on
#111039 first
JoshuaKGoldberg pushed a commit that referenced this pull request Mar 24, 2026
Same idea as #111039 for the
rest of the rpc dataclasses

merge only after successful deploy on
#111039 first
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