feat(web): gate deploy behind PostHog feature flag - #6045
Merged
Conversation
Replace the static `ENABLE_DEPLOY_FEATURE` constant with a dynamic feature access system. The new implementation evaluates deployment feature visibility based on PostHog feature flags and the presence of existing deployments for both users and organizations. - Add `feature-access` logic to determine deployment visibility - Implement `isDeployFeatureEnabled` for server-side route protection - Add `hasExistingDeployments` query to check for existing user/org deployments - Update sidebars (Personal and Organization) to conditionally show Deploy and Integrations links - Protect deployment and integration routes with dynamic feature checks - Add unit tests for deployment feature access logic
Remove the complex logic that checked for existing deployments to determine feature access. Instead, the deployment feature is now controlled strictly by the 'deploy-feature' PostHog flag, while still allowing access in development environments. This change involves: - Deleting `feature-access.ts`, `is-deploy-feature-enabled.ts`, and `feature-access.test.ts`. - Removing `hasExistingDeployments` from `deployments-service.ts` and the corresponding TRPC routers. - Updating sidebar components and deployment pages to use the simplified feature flag check.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (8 files)
Reviewed by grok-4.6 · Input: 85K · Output: 10.2K · Cached: 450.4K Review guidance: REVIEW.md from base branch |
iscekic
approved these changes
Sep 10, 2026
This was referenced Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deploy-featurePostHog flag, matching App Builder (app-builder-feature)./deploy) and organization (/organizations/[id]/deploy) pages returnnotFound()when the flag is off. Development bypasses the flag.useFeatureFlagEnabled('deploy-feature').ENABLE_DEPLOY_FEATUREconstant.Create the
deploy-featureflag in PostHog (off by default) and add existing Deploy users as a release condition so they keep access.Verification
/deployand hide the sidebar item; development and flag-on should keep the current Deploy UI.Visual Changes
N/A — flag-on rendering is unchanged; flag-off hides the sidebar entry and 404s the routes.
Reviewer Notes