Skip to content

ref(seer): Route AI gates through the Seer access helpers - #125162

Open
NicoHinderling wants to merge 3 commits into
ref/seer-availability-helpersfrom
ref/migrate-gen-ai-features-call-sites
Open

NicoHinderling wants to merge 3 commits into
ref/seer-availability-helpersfrom
ref/migrate-gen-ai-features-call-sites

Conversation

@NicoHinderling

Copy link
Copy Markdown
Contributor

Moves every call site that inlined the gen-ai-features check onto the shared helpers from the previous PR. Four backend sites that checked the flag and the hide_ai_features option separately now call has_seer_access, keeping any other flags they test. Twelve components and hooks now call areAiFeaturesAllowed. The explorer index and Night Shift bulk tasks keep their batch flag lookups and gain an early return on is_seer_available(), so their per-org cost is unchanged.

No behavior changes on SaaS. On self-hosted the migrated sites now uniformly evaluate false, which they already did whenever the flag was unset. Four sites that return distinct "flag off" versus "hidden" reasons (autofix trigger, issue summary, and the two trace explorer AI endpoints) keep their two-step structure until the flag is deleted, and the org settings form keeps reading the flag directly because it renders the toggle that controls hideAiFeatures.

@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 Sep 21, 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.

@sentry

sentry Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 518 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@NicoHinderling
NicoHinderling marked this pull request as ready for review September 22, 2026 02:41
@NicoHinderling
NicoHinderling requested review from a team as code owners September 22, 2026 02:41
@NicoHinderling
NicoHinderling force-pushed the ref/seer-availability-helpers branch from 96145dd to 3832781 Compare September 22, 2026 02:46
@NicoHinderling
NicoHinderling requested review from a team as code owners September 22, 2026 02:46
@NicoHinderling
NicoHinderling force-pushed the ref/migrate-gen-ai-features-call-sites branch from 4ec49fc to 738f341 Compare September 22, 2026 02:47
Four sites inlined the gen-ai-features check next to the hide_ai_features
opt-out. Point them at has_seer_access so the self-hosted rule from the
helper applies everywhere. Tests that reach the real helper are pinned
to SaaS mode, matching the earlier helper tests.
Explorer indexing and Night Shift keep their batch flag lookups for now
and gain an early return on is_seer_available(), so self-hosted installs
never iterate orgs for a product they cannot use.
Twelve components and hooks computed the same flag-plus-hideAiFeatures
expression inline. Use the shared util so the self-hosted check applies
uniformly. The org settings form keeps reading the flag directly because
it renders the toggle that controls hideAiFeatures.
Comment on lines +582 to +583
if not is_seer_available():
return []

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.

new condition

Comment on lines +52 to +53
if not is_seer_available():
return

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.

new condition

@ryan953 ryan953 left a comment

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.

different combos of
!organization.features.includes('gen-ai-features') || organization.hideAiFeatures or organization.features.includes('gen-ai-features') && !organization.hideAiFeatures look converted to the helper 👍

This branch was successfully deployed

1 active deployment
Preview — e36ada2d Deployed Sep 22, 2026 by vercel[bot]
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.

2 participants