Repository navigation
fix(cli): drop entitlements lookup at enveloped plan gates - #7395
Conversation
… 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.
|
I ran these from source against a Free-plan project (
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). |
…-drop-enveloped-fallbacks # Conflicts: # apps/cli/src/commands/branches/create/SIDE_EFFECTS.md # apps/cli/src/commands/branches/create/create.command.ts # apps/cli/src/commands/branches/create/create.integration.test.ts # apps/cli/src/commands/vanity-subdomains/activate/SIDE_EFFECTS.md # apps/cli/src/commands/vanity-subdomains/check-availability/SIDE_EFFECTS.md # apps/cli/src/commands/vanity-subdomains/vanity-subdomains.integration.test.ts
There was a problem hiding this comment.
🤖 AI Review
Both independent reviews completed with no findings. Code inspection found no additional defects: the three commands consistently remove fallback entitlement lookups while preserving envelope-based upgrade suggestions and their intended analytics behavior. Permission declarations, documentation, and test coverage match the change.
Findings
No issues found.
Stats
Claude findings: 0 · Codex findings: 0 · Confirmed: 0 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 7 commands. Binary size: 134.0 MB, unchanged. 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 |
avallete
left a comment
There was a problem hiding this comment.
Dogfooded on staging against a free-plan org: branches create (402) and both vanity-subdomains commands (400) return the entitlement_required envelope, print the upgrade hint, and send no project/entitlements follow-up requests. An unrelated 404 now prints no hint and skips the extra project GET that develop makes. Affected integration tests pass.
Non-blocking: the v1 OpenAPI spec doesn't document a 402 body for branch create, so it'd be worth confirming with the API side that every branch plan gate sends the envelope, since a bare 402 would now lose its hint.
good point i will look and see if we can add a decorator specifically for 402s and payment required stuff so it gets added to the spec. but yes i added the envelope to the branch gates before adding this |
branches create,vanity-subdomains activate, andvanity-subdomains check-availabilityran an entitlements lookup (get project, then get organization entitlements) after any 4xx without theentitlement_requiredenvelope. 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 aplan_limitclassification 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_suggestedforbranches createandvanity-subdomains activate(check-availabilitystill suppresses the event), unchanged since #7271.Note: I left
branches updateand thessocommands on the lookup for now: the SAML routes return no envelope yet, and I haven't confirmed that the persistent-branch gate onbranches updatereturns one.Linear