Repository navigation
feat(api): Pass each operation's routing declaration to resolveBaseUrl - #131228
Merged
Merged
Conversation
Copy each operation's x-sentry-routing declaration into
@sentry/api/operations as routing: {silo, organizationParameter?}, and
reject an unsupported silo or an organization parameter that is not in
the path. This is metadata only; request routing does not change.
Refs #131198
Co-Authored-By: BYK <[email protected]>
Generated operations now carry their x-sentry-routing declaration in their request options, and resolveBaseUrl receives it with the organization the operation's declared path parameter names. Hosts can route by Sentry's declarations instead of guessing from path prefixes. routeCellOperations builds a resolver from a host's existing region lookup: cell operations go to their organization's region, and control, both, unknown and raw requests keep the configured base URL. It never discovers a region itself. Refs #131198 Co-Authored-By: BYK <[email protected]>
BYK
approved these changes
Nov 16, 2026
BYK
enabled auto-merge (squash)
November 16, 2026 13:15
2 tasks done
BYK
added a commit
that referenced
this pull request
Nov 16, 2026
#131228 changed the `@sentry/api` README's routing example to read `regionUrls`. #131217 merged a minute later with declarations for the README examples that still define `regionUrlFor`, which no example uses anymore, so the README example on master references an undeclared name. This swaps that declaration for `regionUrls: Map<string, string>`. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A69da19b385017e68b7f9eace56e9477f --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A69da19b385017e68b7f9eace56e9477f) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A69da19b385017e68b7f9eace56e9477f/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
BYK
added a commit
that referenced
this pull request
Nov 16, 2026
…organization (#131245) Part of #131198. `routeCellOperations` (#131228) keeps raw requests on the configured base URL, because they carry no routing declaration. The Sentry CLI's region lookup does more than find a region: it also picks the stored account, and that account's server, that knows the organization. So its `sentry api` raw requests need to go through that lookup to keep reaching an organization whose account is on another server. - `routeCellOperations(lookup, { rawRequests: "lookup" })` sends raw requests whose path names an organization (their `scope`) through `lookup`. If the lookup returns nothing, they keep the configured base. - The default, `rawRequests: "baseUrl"`, keeps today's behavior, so nothing breaks for existing callers. - Generated operations still follow their declarations either way: `cell` goes through the lookup, while `control`, `both` and `unknown` keep the configured base. - The README documents the option with an example. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A69da19b385017e68b7f9eace56e9477f --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A69da19b385017e68b7f9eace56e9477f) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A69da19b385017e68b7f9eace56e9477f/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
This branch was successfully 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.
This is the second slice of #131198, stacked on #131222. Generated operations now carry their
x-sentry-routingdeclaration in their request options.resolveBaseUrlreceives it asrouting, plusorganization, the value of the path parameter the declaration names. Hosts can route by what Sentry declares instead of guessing from path prefixes.routeCellOperations(lookup)in@sentry/api/clientapplies the defaults decided in Make @sentry/api configure-once: auth factories, region routing, progressive accuracy #131198.celloperations go to the region the host's lookup returns for their organization.control,bothandunknownoperations, raw requests, and organizations the lookup doesn't know keep the configured base URL. It never discovers a region, and the host keeps its own locality cache.scopeis still passed, so existing resolvers keep working.prepareRequestall share one resolution per request.baseUrlapart from the configured one. Callers that need a fixed host can pass a per-callresolveBaseUrl, as they can today.The CLI adopts it next, with its existing region resolver and SQLite cache.
via @BYK.
--
View Session [Sentry]