Repository navigation
Description
Follow-up to #1979 (merged November 7). Reproduced on main at 6aa29057e5b307679c33ac885d42895a51868943 with published @sentry/[email protected].
Reproduction
With a stored account and no cached region:
await prepareRawApiRequest("organizations/example-org/issues/");Preparing this request now sends GET /api/0/organizations/example-org/ to discover the region. The same preparation before #1979 made 0 HTTP requests; current main makes 1, before sending the requested API operation.
This also affects:
sentry api organizations/example-org/issues/ --dry-runThe command prepares the request before checking --dry-run. prepareRawApiRequest() installs the same network-capable resolver used for typed requests. #1979 explicitly documented this new lookup; this issue tracks restoring the previous request budget while preserving its account/server selection improvements.
Acceptance criteria
- Preparing/previewing a cold raw request does not require region discovery; add a regression test that checks 0 fetches, including
--dry-run. - Reuse known locality from existing state. When locality is unknown and the existing configured/gateway route works, avoid mandatory discovery before the real request.
- Preserve fix(cli): Route
sentry apiorg requests to accounts on other servers #1978 account/deployment selection, explicit full URLs, self-hosted/custom hosts, authentication, headers and body behavior. - Cover cold and warm locality, unscoped paths and explicit destinations. Keep this fix independent of SDK metadata routing, new gateway optimizations, or a second cache.
Validation used unmodified CLI modules, real temporary SQLite/cache state and fixture HTTP responses. Executing the real apiCommand.loader() with --dry-run confirmed the discovery call and locality write before emitting the preview. With a fixture 401, it also performed an OAuth refresh and updated the stored credential. Absolute-URL and unscoped dry-run controls made 0 requests. No production traffic or packaged CLI/parser test was run. The measured 0 → 1 delta concerns preparation, not every raw command's total redirects/backend hops. This can ship as a separate CLI fix before SDK metadata-routing adoption.
Activity
linear-code commentedon Nov 9, 2026
MCP-1202
BYK commentedon Nov 9, 2026
What is the ask here exactly?