ref(cells): Update region_name to cell_name in process_control_outbox signature#111571
Conversation
| payload=self.payload, | ||
| region_name=self.cell_name, | ||
| cell_name=self.cell_name, | ||
| object_identifier=self.object_identifier, |
There was a problem hiding this comment.
Bug: Signal receivers process_provision_organization_outbox and update_organization_slug_reservation were not updated to accept cell_name instead of region_name, which will cause a TypeError.
Severity: CRITICAL
Suggested Fix
Update the function signatures for process_provision_organization_outbox and update_organization_slug_reservation in src/sentry/services/organization/provisioning.py. The region_name: str parameter should be changed to cell_name: str to match the updated signal.
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/hybridcloud/models/outbox.py#L478
Potential issue: The `process_control_outbox` signal was updated to send a `cell_name`
keyword argument instead of `region_name`. However, two signal receivers,
`process_provision_organization_outbox` and `update_organization_slug_reservation`, were
not updated to reflect this change. These functions still expect a `region_name`
argument. When an outbox message of type `PROVISION_ORGANIZATION` or
`ORGANIZATION_SLUG_RESERVATION_UPDATE` is processed, the signal dispatcher will call
these receivers without the required `region_name` argument, causing a `TypeError` and a
runtime crash.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Bots are right. There are two receivers in services/organziation/provisioning.py that needs to be updated as well.
Backend Test FailuresFailures on
|
Backend Test FailuresFailures on
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| payload=self.payload, | ||
| region_name=self.cell_name, | ||
| cell_name=self.cell_name, | ||
| object_identifier=self.object_identifier, |
There was a problem hiding this comment.
Bug: The update_organization_slug_reservation function was not updated to use cell_name after the process_control_outbox signal signature changed, causing a runtime TypeError.
Severity: CRITICAL
Suggested Fix
In src/sentry/services/organization/provisioning.py, update the signature of the update_organization_slug_reservation function to accept cell_name: str instead of region_name: str.
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/hybridcloud/models/outbox.py#L478
Potential issue: The `process_control_outbox` signal was updated to rename the
`region_name` parameter to `cell_name`. While most signal receivers were updated
accordingly, the `update_organization_slug_reservation` function in
`src/sentry/services/organization/provisioning.py` was not. Its signature still expects
a `region_name` argument. When this signal is dispatched for an
`ORGANIZATION_SLUG_RESERVATION_UPDATE`, it will send `cell_name`, leading to a
`TypeError` because the required `region_name` argument is missing. This will cause the
outbox processing for organization slug reservation updates to fail at runtime.
Backend Test FailuresFailures on
|

No description provided.