Skip to content

fix(cli): drop the entitlements lookup from sso commands - #7707

Merged
pamelachia merged 5 commits into
developfrom
pamela/growth-1460-drop-sso-entitlements-lookup
Nov 23, 2026
Merged

pamelachia merged 5 commits into
developfrom
pamela/growth-1460-drop-sso-entitlements-lookup

Conversation

@pamelachia

@pamelachia pamelachia commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

The sso list, add, update and remove commands looked up the organization's entitlements after any 4xx to decide whether to print an upgrade hint. The SSO provider routes had no plan gate when that was written, so the lookup added two requests and printed the hint on unrelated failures. The Management API now answers provider create and update with the entitlement_required error for organizations without SAML (rolling out), and the shared output and telemetry paths already handle that error, so I deleted the lookup. It was the last one in the CLI.

Changed:

  • No upgrade hint on unrelated SSO errors: the four commands make no extra requests after a 4xx. The hint, the JSON error.entitlement and cli_upgrade_suggested come only from a response that carries the entitlement_required error, and only such a failure classifies as plan_limit.
  • 404s report the API error: sso list and sso add reported every 404 as "SAML 2.0 support is not enabled". A 404 there means the project was not found, so they now surface the API's message and classify the failure as invalid input. I removed the SsoListSamlDisabledError and SsoAddSamlDisabledError classes, so their tags leave the error-tag snapshot.
  • Also removed: I deleted suggestUpgrade and its permission block, the upgradeSuggested option of statusCodeActionability and the saml_disabled fingerprint suffix, which only these commands used.

Note: this supersedes #7471, which kept the lookup helper for sso add. Against an API without the gate, sso add for an organization without SAML succeeds and prints no hint, as it does today.

Linear

  • fixes GROWTH-1460

@pamelachia pamelachia self-assigned this Nov 19, 2026
@pamelachia

Copy link
Copy Markdown
Contributor Author

Manual check, run from this branch against an API environment that has the SSO provider gate deployed:

  • supabase sso add --type saml --metadata-file idp.xml --domains example.com --remote=<free-project-ref> --yes --debug on an organization without SAML: one POST that returns 402, then one hint line, "Your organization's plan does not include this feature. Plans and add-ons: ". With --output-format json the error object carries entitlement.feature = "auth.saml_2" and no hint is printed.
  • supabase sso list --remote=<free-project-ref> --debug: one GET, an empty table, no hint.
  • supabase sso remove <unknown-uuid> --remote=<free-project-ref> --yes --debug: one DELETE, "An identity provider with ID "" could not be found.", no hint.
  • supabase sso update <unknown-uuid> --add-domains example.com --remote=<free-project-ref> --yes --debug: one GET, the same not-found message, no hint, no PUT.
  • supabase sso remove <unknown-uuid> --remote=<pro-project-ref> --yes --debug: the same not-found message, no hint.

No run requested /v1/organizations/{slug}/entitlements. The first run in a fresh directory adds one GET /v1/projects/{ref} for the linked-project cache.

@pamelachia
pamelachia marked this pull request as ready for review November 19, 2026 15:50
@pamelachia
pamelachia requested a review from a team as a code owner November 19, 2026 15:50
@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark (Lightweight Commands): no changes found

Commit 12e6eb8 against develop at c810cdc · 10 runs each · report only, never blocks merging

Command Workload Before After Change
supabase --version version 262 ms 251 ms no real change
supabase --help help 262 ms 243 ms no real change (-7%, within normal variation)
supabase init init 221 ms 220 ms no real change
supabase migration new bench migration-new 281 ms 303 ms no real change (+8%, within normal variation)
supabase config convert config-convert 360 ms 363 ms no real change
supabase config validate config-validate 328 ms 337 ms no real change
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 421 ms 410 ms no real change
supabase projects list projects-list 399 ms 417 ms no real change
supabase functions list --project-ref replayfixtureprojref functions-list 349 ms 387 ms no real change (+11%, within normal variation)

API calls: unchanged for all 9 commands.

Binary size: 135.2 MB, down 12.0 KB from 135.2 MB.

Details: timing ranges, API calls per command, slowest phases

Timing ranges

Command Workload Before range After range Change Verdict
supabase --version version 221-283 ms 216-428 ms -11 ms (-4%) within noise
supabase --help help 210-329 ms 220-326 ms -19 ms (-7%) within noise
supabase init init 205-252 ms 192-256 ms -1 ms (0%) within noise
supabase migration new bench migration-new 208-385 ms 244-433 ms +23 ms (+8%) within noise
supabase config convert config-convert 285-577 ms 294-512 ms +3 ms (+1%) within noise
supabase config validate config-validate 308-373 ms 323-708 ms +9 ms (+3%) within noise
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 363-621 ms 363-646 ms -11 ms (-3%) within noise
supabase projects list projects-list 334-483 ms 338-517 ms +19 ms (+5%) within noise
supabase functions list --project-ref replayfixtureprojref functions-list 313-406 ms 310-492 ms +38 ms (+11%) within noise

API calls per command

Command Workload Before After Endpoint changes
supabase --version version 0 0
supabase --help help 0 0
supabase init init 0 0
supabase migration new bench migration-new 0 0
supabase config convert config-convert 0 0
supabase config validate config-validate 0 0
supabase gen types --lang typescript --project-id replayfixtureprojref gen-types 2 2
supabase projects list projects-list 1 1
supabase functions list --project-ref replayfixtureprojref functions-list 2 2

Slowest phases

No command moved beyond noise, so there are no phase deltas.

Workflow run

Comment /bench to run the lightweight benchmark (this comment) again on the latest commit, or /bench full to also run the integration-heavy benchmark, which posts in its own comment.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

CLI reference prose guidance: snapshot supabase/supabase@4c4112f supplied to reviewers (advisory, not a style pass).

Confirmed six findings after merging one duplicate. The PR changes the 404 error codes shipped in v3.2.0 for sso list and sso add, drops plan-gate information on 404s from the sso update preflight and sso remove, and leaves three inaccuracies in the internal side-effect docs. The review base resolves to develop. The PR title was unavailable for independent verification. The diff changes no CLI reference prose.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/src/commands/sso/list/list.handler.ts:48 breaking-change claude sso list and sso add now return SsoListUnexpectedStatusError and SsoAddUnexpectedStatusError on HTTP 404. This changes the JSON and stream-json error.code and the fixed SAML-disabled message, breaking scripts that match the released output. Please use a fix(cli)!: title, add a BREAKING CHANGE: line to the PR description, and retarget the PR to next.
🟡 MINOR apps/cli/src/commands/sso/list/list.handler.ts:48 error-handling claude The Management API spec documents HTTP 404 when SAML is disabled for a project. On those responses without a valid entitlement envelope, sso list and sso add now rely on the response body for guidance and record the failure as api_status, removing the CLI's built-in Dashboard instructions and SAML-disabled classification.
🟡 MINOR apps/cli/src/commands/sso/update/update.handler.ts:135 error-handling codex A valid entitlement_required envelope on the sso update preflight GET or sso remove DELETE is discarded on HTTP 404. The command reports a missing provider, omits the billing guidance from the response, and records the failure as invalid input.
🟡 MINOR apps/cli/src/commands/sso/add/SIDE_EFFECTS.md:101 internal-docs claude+codex The add and update profile notes still say that upgrade-gate fallback GETs target the reconciled host, even though the PR removes those requests.
🟡 MINOR apps/cli/src/commands/sso/update/SIDE_EFFECTS.md:79 internal-docs codex The telemetry tables omit cli_upgrade_suggested for valid entitlement envelopes from the sso update preflight GET, the sso list GET, and the sso remove DELETE.
⚪ NIT apps/cli/src/commands/sso/list/SIDE_EFFECTS.md:46 internal-docs codex The add and list exit-code tables still say “other non-2xx” after deleting their separate 404 cases.

Stats

Claude findings: 3 · Codex findings: 4 · Confirmed: 6 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

@jgoux jgoux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One classification regression on the 404 path, plus two leftovers from removing the lookup.

Comment thread apps/cli/src/commands/sso/sso.errors.ts Resolved
@pamelachia
pamelachia requested a review from jgoux November 23, 2026 13:19

@jgoux jgoux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three earlier points are addressed: the 404s classify as invalid input with tests asserting it, the unused entitlements fixtures are gone, and the billing-URL mention is dropped. A 404 on these routes comes from the unknown-project resource lookup, so surfacing the API error is right.

@pamelachia
pamelachia added this pull request to the merge queue Nov 23, 2026
Merged via the queue into develop with commit c25e926 Nov 23, 2026
65 checks passed
@pamelachia
pamelachia deleted the pamela/growth-1460-drop-sso-entitlements-lookup branch November 23, 2026 15:04
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.

2 participants