Repository navigation
ref(api): Remove api-client-kind-check flag checks - #126847
Merged
Merged
Conversation
Co-Authored-By: Dominik Buszowiecki <dominik.buszowiecki@sentry.io>
DominikB2014
marked this pull request as ready for review
October 8, 2026 13:48
DominikB2014
approved these changes
Oct 8, 2026
edwardgou-sentry
approved these changes
Oct 8, 2026
DominikB2014
added a commit
that referenced
this pull request
Oct 8, 2026
Follow-up to #126847, which removed every read of `organizations:api-client-kind-check`. Nothing references the flag anymore, so this drops its `manager.add(...)` registration in `features/temporary.py`. Safe to merge independently of the automator change: nothing calls `features.has` for this flag, so a leftover flagpole value is ignored. The value itself is removed in getsentry/sentry-options-automator#10093, which should land only after #126847 is deployed. <!-- junior-request-attribution:start --> via **Dominik Buszowiecki**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0BAH48EJL8%3A1791470226.057899 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AD0BAH48EJL8%3A1791470226.057899) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0BAH48EJL8%3A1791470226.057899/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Dominik Buszowiecki <dominik.buszowiecki@sentry.io>
DominikB2014
added a commit
that referenced
this pull request
Oct 9, 2026
…6849) Lets callers of `search-agent/start` declare who they are via an allowlisted `referrer`, the same way the events endpoints validate `referrer` against the `Referrer` enum. Sentry forwards the result to Seer, which uses it to pick the RPC referrer. The main goal is to split MCP traffic out of the search bar referrers. **Changes** - New `SearchAgentReferrer` allowlist: `search_bar` and `mcp`. - `SearchAgentStartSerializer` accepts an optional top-level `referrer`. - `resolve_referrer(request, raw)`: 1. If `get_client_kind(request)` is `mcp` (the `sentry-mcp/` user agent), the result is `mcp`. The server-derived signal wins over whatever the client declares. 2. Otherwise a declared value on the allowlist is used. 3. A missing value gives `None`. An unknown value is logged (`search_agent.unknown_referrer`) and dropped, not rejected, so outdated clients keep working. - `send_search_agent_start_request` forwards the result as `options["source"]`, and the endpoint tags `search_agent.referrer`. - Tests cover forwarding, an allowlisted value, an unknown value being dropped, a missing value, and the MCP user agent overriding a declared `search_bar`. **Related PRs** - getsentry/seer#8741 reads `options.source`. `mcp` maps to `assisted_query.mcp.<strategy>`; `search_bar`, missing and unknown values keep the existing `assisted_query.<strategy>` referrers. - The frontend PR (linked in a comment) sends `referrer: 'search_bar'` from `useAskSeerPolling`. Land this backend PR first. - Either this PR or the Seer PR can deploy first. **Note:** `get_client_kind`'s docstring still says to check `organizations:api-client-kind-check`. That flag is at 100% GA, and #126847 removes the check. Lint and format checked with ruff. Relying on CI for tests. <!-- junior-request-attribution:start --> via **Dominik Buszowiecki**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AD0BAH48EJL8%3A1791464935.912199 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AD0BAH48EJL8%3A1791464935.912199) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AD0BAH48EJL8%3A1791464935.912199/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Dominik Buszowiecki <dominik.buszowiecki@sentry.io>
This was referenced Oct 15, 2026
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.
organizations:api-client-kind-checkis fully rolled out: itsGAsegment insentry-options-automator(options/default/flagpole.yaml) is set torollout: 100with no conditions, and no region-specific overrides exist. This is stage 1 of removing the flag. It drops every read of the flag; the registration stays for now.Changes
api/base.py:Endpoint.dispatchnow callsset_client_kind_attributesfor any endpoint that resolves anOrganization/RpcOrganization, without afeatures.hascheck. With the flag at 100% that's the same behavior as today, and it skips one flagpole evaluation per request. Also drops the now-unusedfeaturesimport.api/client_kind.py: removes theFEATURE_FLAGconstant and the opt-in notes in the docstrings.middleware/access_log.py: comment update.self.feature(...)wrappers and deletes the two flag-off tests,test_records_nothing_when_the_organization_has_not_opted_inandtest_a_declared_kind_does_not_bypass_the_opt_in, plustest_absent_for_an_org_that_has_not_opted_inin the access-log tests.Follow-ups, in order
feature.organizations:api-client-kind-checkfromsentry-options-automator.manager.add(...)registration infeatures/temporary.py.Only syntax-checked locally (
py_compile); relying on CI for the test suite.via Dominik Buszowiecki.
--
View Junior Session [Sentry]