Skip to content

ref(organizations): list orgs from control silo in a single call - #1212

Merged
betegon merged 3 commits into
mainfrom
ref/org-list-control-silo
Jul 9, 2026
Merged

ref(organizations): list orgs from control silo in a single call#1212
betegon merged 3 commits into
mainfrom
ref/org-list-control-silo

Conversation

@betegon

@betegon betegon commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

GET /organizations/ is now served from the control silo and returns every org the user belongs to across all regions in one paginated response (getsentry/sentry#112622, getsentry/sentry#115513). This replaces the /users/me/regions/ discovery + per-region fan-out in listOrganizationsUncached() with a single call, routing subsequent org-scoped requests using each org's own links.regionUrl from the response.

  • Self-hosted/monolith instances serve the same endpoint from the same base URL, so the separate fallback branch is gone — one less code path to maintain.
  • Removes the multi-region 403 partial-success bookkeeping (CLI-89's Promise.allSettled tracking) since there's only one auth check now instead of N per-region ones.
  • Updated the multi-region e2e mock server to model the control silo's combined org listing (it previously only modeled per-region listings, which is what the real backend replaced).

Mirrors the same change the Rust sentry-cli just made in getsentry/sentry-cli#3352.

Test plan

  • pnpm exec tsc --noEmit
  • pnpm exec biome check
  • pnpm vitest run test/lib/api-client.multiregion.test.ts test/lib/api/organizations.test.ts test/e2e/multiregion.test.ts — rewrote the fan-out-specific unit tests and confirmed the e2e suite (US + EU orgs, region routing for org view/project list/issue list, self-hosted fallback) still passes end to end
  • Full pnpm vitest run — no new failures vs. main (confirmed via git stash comparison)

Made with Cursor

GET /organizations/ is now served from the control silo and returns
every org the user belongs to across all regions in one paginated
response (getsentry/sentry#112622, #115513). Replace the
/users/me/regions/ discovery + per-region fan-out with a single call,
routing subsequent org-scoped requests using each org's own
links.regionUrl. Self-hosted/monolith deployments serve the same
endpoint, so the separate fallback branch is no longer needed.

Updates the multi-region mock server to model the control silo's
combined org listing (previously it only modeled per-region listings),
and rewrites the fan-out-specific unit tests accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1212/

Built to branch gh-pages at 2026-07-09 11:47 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 5336 uncovered lines.
✅ Project coverage is 81.81%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.81%    81.81%        —%
==========================================
  Files          423       423         —
  Lines        29358     29338       -20
  Branches     19126     19113       -13
==========================================
+ Hits         24019     24002       -17
- Misses        5339      5336        -3
- Partials      1988      1987        -1

Generated by Codecov Action

betegon and others added 2 commits July 9, 2026 13:33
…ate lore

orgRole is already typed directly on SentryOrganization, so the
Record<string, unknown> cast in the new regionEntries mapping was dead
weight left over from before that field existed. Also add missing
@param/@returns/@throws to listOrganizationsPage.

Updates the now-stale .lore.md entry that documented the
Promise.allSettled/hasSuccessfulRegion fan-out pattern removed in the
previous commit, so it doesn't mislead future sessions searching for
that logic.

Co-authored-by: Cursor <cursoragent@cursor.com>
listOrganizationsInRegion had zero production callers left after the
control-silo refactor -- listOrganizationsPage (the paginated
primitive it wrapped) is the only thing anything still needs. Removed
it and its barrel re-export; repointed its dedicated CLI-1CQ guard
tests and the multiregion describe block at listOrganizationsPage
directly. listOrganizationsPage is now a normal public export (not
@internal) since it fills that role.

Also reverts the .lore.md edit from the previous commit -- that file
is meant to be read for context, not edited by hand.

Co-authored-by: Cursor <cursoragent@cursor.com>
@betegon
betegon marked this pull request as ready for review July 9, 2026 11:47
@betegon
betegon merged commit 6e16e09 into main Jul 9, 2026
33 checks passed
@betegon
betegon deleted the ref/org-list-control-silo branch July 9, 2026 12:02
betegon added a commit that referenced this pull request Jul 9, 2026
The Promise.allSettled/hasSuccessfulRegion pattern this entry
documented no longer exists in listOrganizationsUncached. Update it
to point at the control-silo refactor (#1212) instead of leaving
stale guidance that references removed code.

Co-authored-by: Cursor <cursoragent@cursor.com>
betegon added a commit that referenced this pull request Jul 9, 2026
## Summary

Follow-up to #1212 (already merged) — that PR removed the
`Promise.allSettled`/`hasSuccessfulRegion`/`lastScopeError` fan-out
logic this `.lore.md` entry documented, but the entry landed in a commit
pushed after the PR had already merged, so it never made it into `main`.

Updates the entry to point at the control-silo refactor instead of
leaving guidance that references removed code.

## Test plan

- N/A (docs-only change to `.lore.md`)

Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant