Skip to content

feat(supergroups): Allow frontend to control RCA source via query param#112708

Open
yuvmen wants to merge 1 commit intomasterfrom
yuvmen/feat/rca-source-toggle
Open

feat(supergroups): Allow frontend to control RCA source via query param#112708
yuvmen wants to merge 1 commit intomasterfrom
yuvmen/feat/rca-source-toggle

Conversation

@yuvmen
Copy link
Copy Markdown
Member

@yuvmen yuvmen commented Apr 10, 2026

Summary

  • Accept rca_source query param (LIGHTWEIGHT or EXPLORER) on both supergroup endpoints, falling back to the -read feature flag when not provided
  • Frontend reads supergroups-lightweight-rca-clustering-read feature flag and passes the corresponding rca_source param
  • Set -read flag to api_expose=True so it's visible to the frontend and toggleable via the Sentry toolbar

Test plan

  • Backend tests for query param override and invalid param fallback (4 new tests)
  • Existing feature flag tests still pass (7 existing tests)
  • Manual: toggle -read flag via toolbar → verify supergroups switch between sources

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Apr 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

Accept rca_source query param on both supergroup endpoints so the
frontend can explicitly request LIGHTWEIGHT or EXPLORER source. Falls
back to the supergroups-lightweight-rca-clustering-read feature flag
when the param is not provided or invalid.

The frontend now reads the -read flag and passes the corresponding
rca_source param. Since the flag is now api_expose=True, it can be
toggled via the Sentry toolbar for testing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yuvmen yuvmen force-pushed the yuvmen/feat/rca-source-toggle branch from 6045f39 to 73c8cff Compare April 10, 2026 20:02
@yuvmen yuvmen marked this pull request as ready for review April 10, 2026 20:02
@yuvmen yuvmen requested a review from a team as a code owner April 10, 2026 20:02
def test_rca_source_invalid_param_falls_back_to_flag(self, mock_seer):
mock_seer.return_value = mock_seer_response({"id": 1, "title": "test"})

with self.feature("organizations:top-issues-ui"):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

up to you but worth adding a test for invalid param with organizations:supergroups-lightweight-rca-clustering-read enabled?

Comment on lines +39 to +42
try:
rca_source = RCASource(rca_source_param) if rca_source_param else None
except ValueError:
rca_source = None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i'm wondering if we need to have a frontend toggle at all honestly, it's pretty trivial to switch internally for testing using the feature flag override

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 Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants