Skip to content

fix(cli): drop entitlements lookup at enveloped plan gates - #7395

Draft
pamelachia wants to merge 2 commits into
developfrom
pamela/growth-1050-drop-enveloped-fallbacks
Draft

pamelachia wants to merge 2 commits into
developfrom
pamela/growth-1050-drop-enveloped-fallbacks

Conversation

@pamelachia

@pamelachia pamelachia commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

branches create, vanity-subdomains activate, and vanity-subdomains check-availability ran an entitlements lookup (get project, then get organization entitlements) after any 4xx without the entitlement_required envelope. The Management API already returns that envelope on all three gates, so the lookup only ran for errors unrelated to the plan: two extra requests, and on an org without the feature, an upgrade hint and a plan_limit classification for an unrelated error such as a validation failure.

I removed the lookup and its permission declarations at those three commands. The CLI still prints the upgrade hint from the envelope on gated denials and fires cli_upgrade_suggested for branches create and vanity-subdomains activate (check-availability still suppresses the event), unchanged since #7271.

Note: I left branches update and the sso commands on the lookup for now: the SAML routes return no envelope yet, and I haven't confirmed that the persistent-branch gate on branches update returns one.

Linear

  • part of GROWTH-1050

… errors

The branch create gate returns the entitlement_required envelope, so the
upgrade hint and event come from the response body. A 4xx without the
envelope no longer triggers the project and entitlements lookups or an
upgrade hint.
…te errors

The vanity-subdomain activate and check-availability gates return the
entitlement_required envelope, so the upgrade hint comes from the response
body. A 4xx without the envelope no longer triggers the project and
entitlements lookups or an upgrade hint.
@pamelachia pamelachia self-assigned this Oct 29, 2026
@pamelachia

pamelachia commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

I ran these from source against a Free-plan project (<ref>) with --agent no --debug:

  • supabase branches create <name> --project-ref <ref>: one POST /v1/projects/<ref>/branches (402), the upgrade hint printed once, no /organizations/<slug>/entitlements request.
  • supabase vanity-subdomains check-availability --desired-subdomain <name> --project-ref <ref> --experimental: one POST (400), the upgrade hint once, no entitlements request.
  • supabase vanity-subdomains activate --desired-subdomain <name> --project-ref <ref> --experimental: one POST (400), the upgrade hint once, no entitlements request.
  • The same three with --output-format json: error.entitlement carried feature branching_limit / vanity_subdomain and the org billing upgrade_url.

All three gates return the envelope, which skipped the lookup before this change too, so these runs cover the hint and the JSON field. The integration tests cover the lookup removal itself (a 4xx without the envelope makes one request and prints no hint).

This branch has not been deployed

No deployments
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