fix(environments): allow the environments tab in hosted mode - #3615
Conversation
The hosted tab allowlist (hosted-tab-policy.ts) never got an `environments` entry, so hosted deployments bounced /environments with "environments is not available in hosted mode" and redirected to /servers — even for users flagged into `project-environments-enabled`. The tranche PRs were verified flag-on in local mode, where the allowlist doesn't apply, so this only surfaced on hosted smoke testing. Allowlist entry only makes the tab reachable; visibility still comes from the PostHog flag (sidebar item + route guard are flag-gated). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_970f5840-c19f-4ced-ad08-d0c9eab050a0) |
📄 Knowledge reviewDosu skipped reviewing this PR because your organization has used its |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why
Hosted smoke-testing for the environments launch hit "environments is not available in hosted mode" with a redirect to /servers.
App.tsxbounces any tab missing fromHOSTED_SIDEBAR_ALLOWED_TABS/HOSTED_HASH_ALLOWED_TABS(client/src/lib/hosted-tab-policy.ts), andenvironmentswas never added — an independent gate theproject-environments-enabledPostHog flag doesn't control. The tranche PRs were verified flag-on in local mode, where the allowlist doesn't apply.What
environmentstoHOSTED_SIDEBAR_ALLOWED_TABS(flows into the hash allowlist). The entry only makes the tab reachable — visibility remains gated by the PostHog flag (flag-gated sidebar item + route guard, both fail-closed).The
project-environmentssurface manifest already exists with nav segmentenvironmentsand is nothostedBlocked, so the surface-coverage invariants pass unchanged (showInAtlas: falsestays — the static atlas can't read the flag).Tests
37 tests pass across hosted-tab-policy, app-surface-coverage, and ui-actions.hosted.
🤖 Generated with Claude Code
Note
Low Risk
Small allowlist change with tests; feature exposure in hosted mode remains controlled by the existing PostHog flag and route guards.
Overview
Fixes hosted smoke tests that hit "environments is not available in hosted mode" and a redirect to
/servers. HostedApp.tsxonly permits tabs listed inHOSTED_SIDEBAR_ALLOWED_TABS/HOSTED_HASH_ALLOWED_TABS;environmentswas missing even whenproject-environments-enabledwas on.Adds
environmentstoHOSTED_SIDEBAR_ALLOWED_TABSinhosted-tab-policy.ts(and thus the hash allowlist). This only makes the tab reachable in hosted mode—sidebar visibility and route access stay behind the PostHog flag. A unit test mirrors other hosted-nav tabs and asserts the tab is allowed, not blocked.Reviewed by Cursor Bugbot for commit 4510d4f. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Allow the Environments tab in hosted mode so flagged users can access it without being redirected. Visibility remains gated by the
project-environments-enabledflag.environmentstoHOSTED_SIDEBAR_ALLOWED_TABS(and hash allowlist) so the route is reachable; sidebar item and route stay flag-gated.environmentsis allowed in hosted sidebar and hash navigation, and not blocked.Written for commit 4510d4f. Summary will update on new commits.