Repository navigation
fix(cli): drop the entitlements lookup from sso commands - #7707
Conversation
|
Manual check, run from this branch against an API environment that has the SSO provider gate deployed:
No run requested |
CLI benchmark (Lightweight Commands): no changes foundCommit
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 phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
There was a problem hiding this comment.
🤖 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
left a comment
There was a problem hiding this comment.
One classification regression on the 404 path, plus two leftovers from removing the lookup.
jgoux
left a comment
There was a problem hiding this comment.
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.
The
sso list,add,updateandremovecommands 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 theentitlement_requirederror 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:
error.entitlementandcli_upgrade_suggestedcome only from a response that carries theentitlement_requirederror, and only such a failure classifies asplan_limit.sso listandsso addreported 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 theSsoListSamlDisabledErrorandSsoAddSamlDisabledErrorclasses, so their tags leave the error-tag snapshot.suggestUpgradeand its permission block, theupgradeSuggestedoption ofstatusCodeActionabilityand thesaml_disabledfingerprint 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 addfor an organization without SAML succeeds and prints no hint, as it does today.Linear