Skip to content

ref(cells): Add cell_name support to rpc dataclasses#111169

Merged
lynnagara merged 9 commits intomasterfrom
accept-cell-name-on-rpc-data
Mar 24, 2026
Merged

ref(cells): Add cell_name support to rpc dataclasses#111169
lynnagara merged 9 commits intomasterfrom
accept-cell-name-on-rpc-data

Conversation

@lynnagara
Copy link
Member

@lynnagara lynnagara commented Mar 19, 2026

Same idea as #111039 for the rest of the rpc dataclasses

merge only after successful deploy on #111039 first

Same idea as #111039 for the rest of the
rpc models
@lynnagara lynnagara requested a review from a team as a code owner March 19, 2026 22:43
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 19, 2026
@lynnagara lynnagara requested a review from a team March 19, 2026 22:43


# TODO(cells): Tmp support for cell_name as well as region_name in Rpc classes.
# Remove once all callers pass region_name directly.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Remove once all callers pass region_name directly.
# Remove once all callers pass cell_name directly.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

Backend Test Failures

Failures on 636b424 in this run:

tests/sentry/explore/migrations/test_0007_update_numeric_attrs_to_bools.py::UpdateNumericToBooleanTest::test_migrationlog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/explore/migrations/test_0007_update_numeric_attrs_to_bools.py:16: in setup_before_migration
    span1 = self.create_span(start_ts=before_now(days=0, minutes=10))
src/sentry/testutils/cases.py:3315: in create_span
    organization = self.organization
.venv/lib/python3.13/site-packages/django/utils/functional.py:47: in __get__
    res = instance.__dict__[self.name] = self.func(instance)
src/sentry/testutils/fixtures.py:105: in organization
    return self.create_organization(name="baz", slug="baz", owner=self.user)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_exhaustive.py::ExhaustiveTests::test_exhaustive_dirty_pkslog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exhaustive.py:37: in test_exhaustive_dirty_pks
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_exhaustive.py::ExhaustiveTests::test_uniquenesslog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exhaustive.py:43: in test_uniqueness
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_exports.py::ScopingTests::test_config_export_scopinglog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exports.py:318: in test_config_export_scoping
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_exports.py::ScopingTests::test_global_export_scopinglog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exports.py:388: in test_global_export_scoping
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_exports.py::ScopingTests::test_organization_export_scopinglog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exports.py:252: in test_organization_export_scoping
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_exports.py::ScopingTests::test_user_export_scopinglog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exports.py:188: in test_user_export_scoping
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_exports.py::FilteringTests::test_export_filter_orgs_emptylog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exports.py:722: in test_export_filter_orgs_empty
    org_a = self.create_exhaustive_organization("org-a", a, a_b, [a_b_c])
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
... (26 more lines)
tests/sentry/backup/test_exports.py::FilteringTests::test_export_filter_orgs_multiplelog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exports.py:630: in test_export_filter_orgs_multiple
    org_a = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
... (26 more lines)
tests/sentry/backup/test_exports.py::FilteringTests::test_export_filter_orgs_singlelog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_exports.py:544: in test_export_filter_orgs_single
    org_a = self.create_exhaustive_organization("org-a", a, a_b, [a_b_c])
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
... (26 more lines)
tests/sentry/backup/test_imports.py::SanitizationTests::test_generate_suffix_for_already_taken_organizationlog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:287: in test_generate_suffix_for_already_taken_organization
    self.create_organization(name="some-org", owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
    _old_atomic_exit(self, exc_type, *args, **kwds)
src/sentry/utils/db.py:67: in _exit
    rv = original_exit(self, exc_type, exc_value, traceback)
.venv/lib/python3.13/site-packages/django/db/transaction.py:307: in __exit__
... (22 more lines)
tests/sentry/backup/test_imports.py::SanitizationTests::test_generate_suffix_for_already_taken_organization_with_control_optionlog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:343: in test_generate_suffix_for_already_taken_organization_with_control_option
    self.test_generate_suffix_for_already_taken_organization()
tests/sentry/backup/test_imports.py:287: in test_generate_suffix_for_already_taken_organization
    self.create_organization(name="some-org", owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
    _old_atomic_exit(self, exc_type, *args, **kwds)
src/sentry/utils/db.py:67: in _exit
... (24 more lines)
tests/sentry/backup/test_imports.py::SanitizationTests::test_org_and_project_option_type_preservelog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:690: in test_org_and_project_option_type_preserve
    import_in_organization_scope(tmp_file, printer=NOOP_PRINTER)
src/sentry/backup/imports.py:609: in import_in_organization_scope
    return _import(
src/sentry/backup/imports.py:546: in _import
    resolve_org_slugs_from_pk_map(pk_map)
src/sentry/backup/imports.py:529: in resolve_org_slugs_from_pk_map
    organization_provisioning_service.bulk_create_organization_slugs(
src/sentry/services/organization/provisioning.py:152: in bulk_create_organization_slugs
    control_organization_provisioning_rpc_service.bulk_create_organization_slug_reservations(
src/sentry/hybridcloud/services/control_organization_provisioning/impl.py:296: in bulk_create_organization_slug_reservations
    with outbox_context(transaction.atomic(router.db_for_write(OrganizationSlugReservation))):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
    _old_atomic_exit(self, exc_type, *args, **kwds)
src/sentry/utils/db.py:67: in _exit
    rv = original_exit(self, exc_type, exc_value, traceback)
.venv/lib/python3.13/site-packages/django/db/transaction.py:307: in __exit__
    connection.set_autocommit(True)
.venv/lib/python3.13/site-packages/django/db/backends/base/base.py:491: in set_autocommit
    self.run_and_clear_commit_hooks()
src/sentry/testutils/pytest/stale_database_reads.py:130: in run_and_clear_commit_hooks
    return old_run_and_clear_commit_hooks(*args, **kwargs)
.venv/lib/python3.13/site-packages/django/db/backends/base/base.py:769: in run_and_clear_commit_hooks
... (16 more lines)
tests/sentry/backup/test_imports.py::SignalingTests::test_import_signaling_organizationlog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:731: in test_import_signaling_organization
    self.create_exhaustive_organization("some-org", owner, invited, [member])
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
... (26 more lines)
tests/sentry/backup/test_imports.py::SignalingTests::test_import_signaling_organization_with_control_provisioning_optionlog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:768: in test_import_signaling_organization_with_control_provisioning_option
    self.test_import_signaling_organization()
tests/sentry/backup/test_imports.py:731: in test_import_signaling_organization
    self.create_exhaustive_organization("some-org", owner, invited, [member])
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_imports.py::ScopingTests::test_config_import_scopinglog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:859: in test_config_import_scoping
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_imports.py::ScopingTests::test_global_import_scopinglog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:879: in test_global_import_scoping
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_imports.py::ScopingTests::test_organization_import_scopinglog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:839: in test_organization_import_scoping
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_imports.py::ScopingTests::test_user_import_scopinglog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:824: in test_user_import_scoping
    self.create_exhaustive_instance(is_superadmin=True)
src/sentry/testutils/helpers/backups.py:947: in create_exhaustive_instance
    org = self.create_exhaustive_organization(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
... (28 more lines)
tests/sentry/backup/test_imports.py::DatabaseResetTests::test_clears_existing_models_in_global_scopelog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:917: in test_clears_existing_models_in_global_scope
    create_default_projects()
src/sentry/receivers/core.py:45: in create_default_projects
    create_default_project(
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/receivers/core.py:101: in create_default_project
    organization_provisioning_service.change_organization_slug(
src/sentry/services/organization/provisioning.py:128: in change_organization_slug
    self._control_based_slug_change(organization_id=organization_id, slug=slug)
src/sentry/services/organization/provisioning.py:98: in _control_based_slug_change
    control_organization_provisioning_rpc_service.update_organization_slug(
src/sentry/hybridcloud/services/control_organization_provisioning/impl.py:215: in update_organization_slug
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
    _old_atomic_exit(self, exc_type, *args, **kwds)
src/sentry/utils/db.py:67: in _exit
    rv = original_exit(self, exc_type, exc_value, traceback)
.venv/lib/python3.13/site-packages/django/db/transaction.py:307: in __exit__
    connection.set_autocommit(True)
.venv/lib/python3.13/site-packages/django/db/backends/base/base.py:491: in set_autocommit
    self.run_and_clear_commit_hooks()
src/sentry/testutils/pytest/stale_database_reads.py:130: in run_and_clear_commit_hooks
... (18 more lines)
tests/sentry/backup/test_imports.py::DatabaseResetTests::test_persist_existing_models_in_config_scopelog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 validation error for RpcOrganizationSlugReservation
E   region_name
E     field required (type=value_error.missing)

The above exception was the direct cause of the following exception:
tests/sentry/backup/test_imports.py:960: in test_persist_existing_models_in_config_scope
    self.create_exhaustive_organization("neworg", owner, user, None)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/helpers/backups.py:445: in create_exhaustive_organization
    org = self.create_organization(name=slug, owner=owner)
src/sentry/testutils/fixtures.py:176: in create_organization
    return Factories.create_organization(*args, **kwargs)
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:85: in inner
    return func(*args, **kwds)
src/sentry/testutils/factories.py:409: in create_organization
    ).save(unsafe_write=True)
src/sentry/silo/base.py:158: in override
    return original_method(*args, **kwargs)
src/sentry/models/organizationslugreservation.py:59: in save
    return super().save(*args, **kwds)
src/sentry/hybridcloud/outbox/base.py:258: in save
    with self._maybe_prepare_outboxes(outbox_before_super=False):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/outbox/base.py:238: in _maybe_prepare_outboxes
    with outbox_context(
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/hybridcloud/models/outbox.py:552: in outbox_context
    with unguarded_write(using=inner.using), enforce_constraints(inner):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/contextlib.py:148: in __exit__
    next(self.gen)
src/sentry/db/postgres/transactions.py:115: in enforce_constraints
    with transaction:
src/sentry/testutils/hybrid_cloud.py:225: in new_atomic_exit
... (26 more lines)
tests/sentry/backup/test_imports.py::DatabaseResetTests::test_persist_existing_models_in_organization_scopelog
src/sentry/hybridcloud/models/outbox.py:313: in process
    coalesced.send_signal()
src/sentry/hybridcloud/models/outbox.py:474: in send_signal
    process_control_outbox.send(
.venv/lib/python3.13/site-packages/django/dispatch/dispatcher.py:189: in send
    response = receiver(signal=self, sender=sender, **named)
src/sentry/hybridcloud/outbox/category.py:117: in receiver
    maybe_instance.handle_async_replication(
src/sentry/models/organizationslugreservation.py:78: in handle_async_replication
    serialized = serialize_slug_reservation(self)
src/sentry/hybridcloud/services/control_organization_provisioning/serial.py:10: in serialize_slug_reservation
    return RpcOrganizationSlugReservation(
pydantic/main.py:364: in pydantic.main.BaseModel.__init__
    ???
E   pydantic.error_wrappers.ValidationError: 1 va

... (truncated due to GitHub comment size limit)

Copy link
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 prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Mixin root_validator may not be discovered by pydantic v1
    • Made AcceptCellNameMixin inherit from pydantic.BaseModel so its root validator is registered and cell_name inputs correctly populate region_name, and added a regression test.

Create PR

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.

@lynnagara lynnagara merged commit de9846d into master Mar 24, 2026
85 checks passed
@lynnagara lynnagara deleted the accept-cell-name-on-rpc-data branch March 24, 2026 17:59
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