Skip to content

fix(webapp): hide and reject native (Git-based) deployments in self-hosted instances - #5064

Closed
khoap1220-hue wants to merge 1 commit into
triggerdotdev:mainfrom
khoap1220-hue:fix/hide-native-deployments-self-hosted-4835
Closed

khoap1220-hue wants to merge 1 commit into
triggerdotdev:mainfrom
khoap1220-hue:fix/hide-native-deployments-self-hosted-4835

Conversation

@khoap1220-hue

Copy link
Copy Markdown

Summary

Fixes #4835

Problem

Native (Git-based) deployments depend on the cloud build service via BillingClient (isBillingConfigured() in apps/webapp/app/services/platform.v3.server.ts). In self-hosted instances where the platform build client is not configured:

  1. GitHubSettingsPresenter only checked env.GITHUB_APP_ENABLED === "1", leaving the GitHub deployment UI accessible.
  2. enqueueBuild in apps/webapp/app/services/platform.v3.server.ts silently returned undefined when !client, causing native builds initialized on a self-hosted instance to stay in PENDING forever.
  3. InitializeDeploymentService did not reject isNativeBuild payloads when !isBillingConfigured().

Changes

  • Gate UI & Presenters (GitHubSettingsPresenter.server.ts, DeploymentListPresenter.server.ts, resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.github.tsx): Require isBillingConfigured() alongside env.GITHUB_APP_ENABLED === "1" so self-hosted instances do not offer native Git-based deployments or native redeploy actions.
  • Guard enqueueBuild (apps/webapp/app/services/platform.v3.server.ts): Throw new Error("Platform client not configured") when !client (matching createPrivateLink / deletePrivateLink), ensuring any unconfigured build enqueue fails immediately and cancels the deployment cleanly.
  • API Validation (apps/webapp/app/v3/services/initializeDeployment.server.ts): Throw a ServiceValidationError (400) with a clear message when payload.isNativeBuild && !isBillingConfigured().

@changeset-bot

changeset-bot Bot commented Oct 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d61db95

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 Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown
Contributor

Hi @khoap1220-hue, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Oct 25, 2026

@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 3 potential issues.

Devin Review

Comment on lines +153 to +158
if (payload.isNativeBuild && !isBillingConfigured()) {
throw new ServiceValidationError(
"Native builds are not supported on self-hosted instances. Deploy with the CLI or GitHub Actions instead.",
400
);
}

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.

🟡 Self-hosted deployment fix lacks release note

When self-hosted users upgrade, isBillingConfigured() now blocks native builds without a server change note. They receive no release notice explaining the new deployment restriction.

Learn more

The repository requires a .server-changes/ entry for user-facing, server-only behavior changes. This change rejects native deployment requests on self-hosted instances and directs users to other deployment methods. Without an entry, that upgrade behavior is absent from the published release notes. The PR changes only webapp files, so a server change note is the required format.

Example: A self-hosted user upgrades and runs trigger deploy --native-build. The API now rejects the request, but the release notes do not warn them to switch deployment methods.

Recommended fix: Add a .server-changes/ Markdown file with area: webapp, type: fix, and a one-line user-facing description of the self-hosted native deployment change.

Devin Review


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

export class GitHubSettingsPresenter extends BasePresenter {
public call({ projectId, organizationId }: GitHubSettingsOptions) {
const githubAppEnabled = env.GITHUB_APP_ENABLED === "1";
const githubAppEnabled = env.GITHUB_APP_ENABLED === "1" && isBillingConfigured();

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.

🔍 Git settings section remains visible on self-hosted instances

With GITHUB_APP_ENABLED=1, the integrations page still renders Git settings through ProjectSettingsPresenter. The nested panel now renders nothing, leaving an empty section. Align the parent gate if the entire section must disappear.

Devin Review


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

Comment on lines +244 to +249
if (env.GITHUB_APP_ENABLED !== "1" || !isBillingConfigured()) {
return json(
{ ok: false, error: "Native GitHub deployments are not available on self-hosted instances." },
{ status: 403 }
);
}

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.

🔍 Deploy-now endpoint retains its separate availability gate

The new GitHub action gate does not cover deploy-now. With onboarding enabled and an existing repository, that endpoint still reaches the platform trigger on self-hosted instances. Check whether it needs an explicit unavailable response.

Devin Review


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

khoap1220-hue added a commit to khoap1220-hue/trigger.dev that referenced this pull request Oct 25, 2026
…gConfigured and add server-change note

Addresses all 3 Devin Review comments on triggerdotdev#5064 (Fixes triggerdotdev#4835).
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.

Hide native (Git-based) deployments in self-hosted instances

1 participant