Skip to content

ref(cells): Region -> cell migration in integrations modules#111130

Merged
lynnagara merged 4 commits intomasterfrom
integrations-cells
Mar 20, 2026
Merged

ref(cells): Region -> cell migration in integrations modules#111130
lynnagara merged 4 commits intomasterfrom
integrations-cells

Conversation

@lynnagara
Copy link
Member

No description provided.

@lynnagara lynnagara requested review from a team as code owners March 19, 2026 19:08
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 19, 2026
# TODO(cells): This is broken for a multi-cell locality as the router cannot identify
# the correct cell silo for routing. The endpoint should be moved to the control silo.
url_prefix=(
generate_locality_url() if SiloMode.get_current_mode() == SiloMode.CELL else None
Copy link
Member Author

Choose a reason for hiding this comment

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

What if we just pass None here in all cases? Does that force the view through apigateway and to the correct cell?

@lynnagara lynnagara requested a review from a team March 19, 2026 19:10
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 is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

raise NotImplementedError("Integration requires an identity")
default_auth_id = identity_model.id
if self.provider.is_region_restricted and is_violating_cell_restriction(
if self.provider.is_cell_restricted and is_violating_cell_restriction(
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Tests in test_pipeline.py were not updated to use the new is_cell_restricted attribute, instead referencing the old is_region_restricted, breaking test coverage for this feature.
Severity: HIGH

Suggested Fix

Update the tests in tests/sentry/integrations/test_pipeline.py to use the new attribute name is_cell_restricted instead of is_region_restricted. This applies to patch.multiple calls and direct attribute assignments like self.provider.is_cell_restricted = True.

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/integrations/pipeline.py#L301

Potential issue: The production code correctly renamed the `is_region_restricted`
attribute to `is_cell_restricted` on the `IntegrationProvider` base class and updated
the integration pipeline to check this new attribute. However, tests in
`tests/sentry/integrations/test_pipeline.py` were not updated. They continue to patch
and set the old `is_region_restricted` attribute. Because the production code now checks
`self.provider.is_cell_restricted`, which remains `False` during tests, the cell
restriction logic is never actually executed. This breaks the tests and creates a gap in
test coverage for the cell restriction feature, meaning bugs in this logic may not be
caught.

Did we get this right? 👍 / 👎 to inform future reviews.

@lynnagara lynnagara merged commit ef19c99 into master Mar 20, 2026
76 checks passed
@lynnagara lynnagara deleted the integrations-cells branch March 20, 2026 18:39
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