Skip to content

ci(router): build the router from git on main only - #336

Merged
nickvigilante merged 1 commit into
mainfrom
vigilante/router-git-main-only
Nov 12, 2026
Merged

nickvigilante merged 1 commit into
mainfrom
vigilante/router-git-main-only

Conversation

@nickvigilante

Copy link
Copy Markdown
Collaborator

Merge order

After #333 (merged), which previews router changes from Actions. Independent of the open PRs.

Summary

Turns off Vercel's Git-triggered builds of apps/router on coder-docs for every branch except main. main still deploys production from Git as today; pull requests get their router preview only from router-pr-preview.yml, behind the docs-preview reviewers.

Fix

Vercel's Git integration built a preview of apps/router for every branch that changed it, running the branch's code with coder-docs's preview environment variables and no reviewer in front of it. Once the repository is public, a fork's pull request would be held back only by Vercel's fork protection, which a single "authorize" click releases. Security asked for those builds to be off before the flip.

apps/router/vercel.json gains "git": { "deploymentEnabled": { "**": false, "main": true } }. Vercel deploys a branch when any matching rule is true, so main matches both rules and keeps deploying, and every other branch matches only "**" and doesn't. "**" rather than "*" so branch names with a slash, such as vigilante/topic, are covered. I chose this over disconnecting the project from Git, which would also stop production deploys from main.

A test in apps/router/lib/vercel-config.test.ts pins the setting. AGENTS.md, the README's project table and the header of router-pr-preview.yml now say a pull request gets no Vercel bot preview, and that router-pr-preview.yml is a router change's only preview.

QA

Nothing to see on the docs site.

  1. In this PR's checks, Vercel builds no deployment for this branch: it reads vercel.json from the commit it builds, so the setting already applies to this PR's own push. The router-pr-preview run does start, because this PR changes files under apps/router/, and its deploy job waits for a docs-preview reviewer.
  2. After merging, the main push still shows a production deployment on the coder-docs deployments page, and coder.com/docs keeps serving.
  3. On the next pull request that changes apps/router, the Vercel bot doesn't post a preview, and the router-pr-preview run's deploy job waits for a docs-preview reviewer as before.

Testing

The new test fails against the current vercel.json and passes with the change. All 184 router tests pass and the router typecheck passes. actionlint reports the workflow clean, and Oxfmt formatted the changed files. The "**"/"main" precedence comes from Vercel's Git configuration docs ("When a branch matches multiple rules and at least one is true, a deployment occurs").

Upstream

No: Vercel project configuration, not Fumadocs.

Linear: DOCS-1486


🤖 Built with AI assistance.

Vercel's Git integration built a preview of apps/router for every branch
that changed it, with coder-docs's preview environment variables and no
reviewer in front of it. Once the repository is public, a fork's branch
would be held only by Vercel's fork protection. router-pr-preview.yml now
previews router changes from Actions behind the docs-preview reviewers,
so git.deploymentEnabled turns the Git builds off for every branch except
main, which still deploys production.

A branch matching both patterns deploys if either is true, so main keeps
deploying; "**" also matches branch names with a slash. A router test
pins the setting, and the docs say a pull request gets no Vercel bot
preview any more.

Assisted-by: AI
@nickvigilante
nickvigilante marked this pull request as ready for review November 12, 2026 19:45
@nickvigilante
nickvigilante requested a review from a team as a code owner November 12, 2026 19:45
@nickvigilante
nickvigilante merged commit 049e9ff into main Nov 12, 2026
28 of 29 checks passed
@nickvigilante
nickvigilante deleted the vigilante/router-git-main-only branch November 12, 2026 19:45

This branch is waiting to be deployed

1 waiting deployment
docs-preview — cc23a721 Waiting Nov 12, 2026 by nickvigilante via deploy router preview #4
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.

1 participant