Skip to content

feat(webapp): hide self-serve billing UI for managed-billing orgs#3898

Open
kathiekiwi wants to merge 1 commit into
mainfrom
feature/self-serve-updates
Open

feat(webapp): hide self-serve billing UI for managed-billing orgs#3898
kathiekiwi wants to merge 1 commit into
mainfrom
feature/self-serve-updates

Conversation

@kathiekiwi

Copy link
Copy Markdown
Collaborator

Summary

Self-serve billing UI is now hidden for managed-billing organizations.

Plan pickers, upgrade actions, billing alerts, and related upgrade prompts are replaced with a "Contact us" option where appropriate.

Uses the new showSelfServe subscription flag, defaulting to true for existing self-serve organizations.

Testing

  • billing pages render correctly for self-serve organizations.
  • managed-billing organizations no longer see self-serve upgrade flows.
  • "Contact us" actions are shown instead of upgrade actions where applicable.

Changelog

Hide self-serve billing flows for managed-billing organizations behind the new showSelfServe subscription flag.

@changeset-bot

changeset-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: aff5beb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 49552152-4682-4904-b5fd-1745131a8bbf

📥 Commits

Reviewing files that changed from the base of the PR and between 1d82c4b and aff5beb.

📒 Files selected for processing (13)
  • .server-changes/hide-self-serve-billing-ui.md
  • apps/webapp/app/components/BlankStatePanels.tsx
  • apps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsx
  • apps/webapp/app/hooks/useShowSelfServe.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.limits/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.roles/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.team/route.tsx
  • apps/webapp/app/services/platform.v3.server.ts
✅ Files skipped from review due to trivial changes (1)
  • .server-changes/hide-self-serve-billing-ui.md
🚧 Files skipped from review as they are similar to previous changes (12)
  • apps/webapp/app/hooks/useShowSelfServe.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.alerts/route.tsx
  • apps/webapp/app/components/navigation/OrganizationSettingsSideMenu.tsx
  • apps/webapp/app/components/BlankStatePanels.tsx
  • apps/webapp/app/services/platform.v3.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.roles/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.team/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.limits/route.tsx

Walkthrough

This PR implements self-serve billing UI gating for organizations that do not have self-serve subscriptions enabled. A new useShowSelfServe hook checks whether an organization's plan allows self-serve, defaulting to true. The hook is used across billing pages, settings navigation, project pages (alerts, limits, schedules), branches and team purchase flows, and modals to either show upgrade/pricing UI when allowed or replace those CTAs with Feedback/contact prompts when disabled. Routes and server actions block or redirect purchase/alerts access for managed-billing orgs.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.90% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: hiding self-serve billing UI for managed-billing organizations, which aligns with the core feature introduced across multiple files.
Description check ✅ Passed The description covers key aspects including summary, testing steps, and changelog. However, it omits the issue reference and does not fully follow the provided template structure with all required sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/self-serve-updates

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@kathiekiwi kathiekiwi force-pushed the feature/self-serve-updates branch from fa3c3e5 to 6abeffd Compare June 11, 2026 08:49
coderabbitai[bot]

This comment was marked as resolved.

@kathiekiwi kathiekiwi force-pushed the feature/self-serve-updates branch 3 times, most recently from c9e3470 to 1d82c4b Compare June 12, 2026 16:44
@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@175ca93

trigger.dev

npm i https://pkg.pr.new/trigger.dev@175ca93

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@175ca93

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@175ca93

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@175ca93

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@175ca93

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@175ca93

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@175ca93

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@175ca93

commit: 175ca93

@kathiekiwi kathiekiwi force-pushed the feature/self-serve-updates branch 2 times, most recently from 175ca93 to 3162d60 Compare June 12, 2026 21:53
Self-serve billing UI is now hidden for managed-billing organizations.
Uses the new `showSelfServe` subscription flag, defaulting to `true` for
existing self-serve organizations.
@kathiekiwi kathiekiwi force-pushed the feature/self-serve-updates branch from 3162d60 to aff5beb Compare June 12, 2026 22:05
@kathiekiwi kathiekiwi marked this pull request as ready for review June 12, 2026 22:30
@kathiekiwi kathiekiwi requested review from matt-aitken and samejr June 12, 2026 22:30

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Schedules action missing server-side self-serve purchase guard

The branches action (routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx:161-174) and team action (routes/_app.orgs.$organizationSlug.settings.team/route.tsx:216-229) both added getSelfServePurchaseBlockReason checks to block managed-billing orgs from purchasing add-ons server-side. However, the schedules action at routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules/route.tsx:144-187 does not have this guard. While the UI is hidden (the PurchaseSchedulesModal returns a Feedback component when !showSelfServe), a direct POST request to the schedules endpoint would bypass the UI and allow a managed-billing org to purchase extra schedules through the SetSchedulesAddOnService.

(Refers to lines 160-165)

Prompt for agents
The schedules action function (around line 144-187) is missing the server-side guard that was added to the branches action and team action. After finding the project and before parsing the PurchaseSchema submission, add a getCurrentPlan + getSelfServePurchaseBlockReason check, returning a 403 JSON response for managed_billing and a 503 for plan_unavailable. Import getCurrentPlan and getSelfServePurchaseBlockReason from ~/services/platform.v3.server. The pattern to follow is identical to what was done in the branches route action (lines 161-174 of that file).
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

apply. The not-supported empty state below makes the
absence of role infrastructure clear instead. */}
{isUsingPlugin && !isEnterprise ? <CreateRoleUpsell /> : null}
{isUsingPlugin && showSelfServe ? <CreateRoleUpsell /> : null}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 CreateRoleUpsell shown for self-serve Enterprise orgs due to changed condition semantics

The old condition was {isUsingPlugin && !isEnterprise ? <CreateRoleUpsell /> : null} — it hid the upsell for Enterprise-plan orgs since they already have access to custom roles. The new condition {isUsingPlugin && showSelfServe ? <CreateRoleUpsell /> : null} shows the upsell whenever showSelfServe is true, which includes self-serve Enterprise orgs. These orgs will now incorrectly see a "Create role" button that opens a dialog saying "Custom roles are an Enterprise feature" and prompts them to contact sales — even though they're already on Enterprise.

Suggested change
{isUsingPlugin && showSelfServe ? <CreateRoleUpsell /> : null}
{isUsingPlugin && showSelfServe && !assignableRoleIds.length ? <CreateRoleUpsell /> : null}
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant