Skip to content

fix(vercel): stop preview deployments for branches with a slash - #261

Merged
NickAltstein merged 1 commit into
mainfrom
fix/vercel-preview-glob
Nov 24, 2026
Merged

NickAltstein merged 1 commit into
mainfrom
fix/vercel-preview-glob

Conversation

@NickAltstein

Copy link
Copy Markdown
Owner

Why

The project hit Vercel's Hobby limit of 100 deployments per day ("Deployment rate limited — retry in 24 hours" on #260). Breaking down the last 24 hours with Vercel's deployments API, 81 deployments in total:

Source Count State
Bot commits to main 43 31 cancelled, 12 built
Human commits to main 10 3 cancelled, 7 built
Feature-branch previews (feat/, fix/, docs/, claude/…) 25 all cancelled
data/* bot previews 3 all cancelled

The 28 previews exist because git.deploymentEnabled keys are minimatch patterns (per Vercel's git configuration docs), and in minimatch * does not match across /. Checked locally with minimatch 9: * matches main and hotfix, but not feat/td-pbp-features or data/odds-freshness-…; ** matches all of them.

What changed

  • vercel.json: "*": false → "**": false. "main": true stays. Vercel deploys a branch when any matching rule is true, so main still deploys.
  • test/vercel-git-config.test.mjs pins "**": false, rejects a bare "*", and requires main to be the only enabled branch.

What this does not fix

  • The 34 cancelled deployments on main. They come from data commits that change nothing served. scripts/vercel_ignore.sh cancels them only after the deployment exists, and Vercel's docs don't say whether those count toward the daily limit. The follow-up is to turn off automatic git deployments and deploy from a workflow through a deploy hook, only when served paths change and at most hourly for odds.
  • [vercel skip] in commit messages. It isn't documented by Vercel and didn't help: 12 heartbeat commits carrying it still created cancelled deployments in the same window.

How to verify

After merge, push any branch with a slash in its name: no preview deployment should appear in Vercel. Pushes to main should deploy as before.

Testing

  • npm test: 214 passed, 0 failed, 3 skipped (Chrome-only; these pass in CI).

🤖 Generated with Claude Code

git.deploymentEnabled keys are minimatch patterns, and "*" does not match
across "/". The "*": false rule therefore never applied to feat/*, fix/*,
data/* or claude/* branches, so each push to them created a preview
deployment. In the last 24 hours that was 28 of 81 deployments, all
cancelled by scripts/vercel_ignore.sh but still counted toward the Hobby
limit of 100 per day, which PR 260's preview just hit.

"**" matches every branch name. main keeps "main": true; Vercel deploys a
branch when any matching rule is true. A test pins both rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NickAltstein
NickAltstein merged commit 1c28908 into main Nov 24, 2026
5 checks passed
@NickAltstein
NickAltstein deleted the fix/vercel-preview-glob branch November 24, 2026 20:18
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