ref(seer): Gate Seer access on not being self-hosted - #125161
Open
NicoHinderling wants to merge 4 commits into
Open
NicoHinderling wants to merge 4 commits into
NicoHinderling wants to merge 4 commits into
Conversation
Add is_seer_available(), which is false on self-hosted installs, and fold it into has_seer_access and has_seer_access_with_detail next to the existing gen-ai-features flag check. The flag is already false on self-hosted because no flagpole config exists there, so nothing changes yet; this puts the rule in one place ahead of removing the flag.
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 |
NicoHinderling
marked this pull request as ready for review
September 22, 2026 02:41
Both useAiConfig and useOrganizationSeerSetup computed the same flag-plus-hideAiFeatures expression. Move it into one util that also checks ConfigStore.isSelfHosted, and point both hooks at it. No behavior change: the flag is already off on self-hosted.
The sentry test suite runs in self-hosted mode by default, and has_seer_access now returns False there. The test classes that call the real helper rather than patching it need SENTRY_SELF_HOSTED=False, the same way acceptance tests already pin it.
A sweep of every caller of the Seer access helpers found sixteen more test classes that reach the real helper indirectly, through the agent client, the autofix operator, Night Shift, PR metrics, and the seer workflows endpoint. Pin them all to SaaS mode. The workflows endpoint class also neutralizes the endpoint rate limiter, which the middleware skips on self-hosted but enforces once the class runs as SaaS. Also give the self-hosted denial its own message in has_seer_access_with_detail instead of reporting a missing flag.
NicoHinderling
force-pushed
the
ref/seer-availability-helpers
branch
from
September 22, 2026 02:46
96145dd to
3832781
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
is_seer_available(), which is false on self-hosted installs, and folds it intohas_seer_accessandhas_seer_access_with_detailnext to the existingorganizations:gen-ai-featurescheck. On the frontend, the flag-plus-hideAiFeaturesexpression thatuseAiConfiganduseOrganizationSeerSetupeach computed inline moves into one util,areAiFeaturesAllowed, which also checksConfigStore.isSelfHosted.This is the first of three PRs replacing
gen-ai-featureswith an explicit "not self-hosted" rule. The flag is on for every SaaS and single-tenant cell and false on self-hosted only because no flagpole config exists there, so on SaaS nothing changes, and a self-hosted install that never set the flag sees no difference either. Single-tenant settings setSENTRY_SELF_HOSTEDto False, so those cells keep Seer.Sentry's test suite runs in self-hosted mode by default, so every test class that reaches the real helper rather than patching it now pins
SENTRY_SELF_HOSTED=False, the same way acceptance tests already do. A sweep of every helper caller found sixteen such classes beyond the obvious ones. The seer workflows endpoint tests also neutralize the endpoint rate limiter, which the middleware skips on self-hosted but enforces once the class runs as SaaS. The self-hosted denial now reports "Seer is not available on this installation." instead of a missing flag.