Repository navigation
fix(vercel): stop preview deployments for branches with a slash - #261
Merged
Merged
Conversation
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>
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.
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:
mainmainfeat/,fix/,docs/,claude/…)data/*bot previewsThe 28 previews exist because
git.deploymentEnabledkeys are minimatch patterns (per Vercel's git configuration docs), and in minimatch*does not match across/. Checked locally with minimatch 9:*matchesmainandhotfix, but notfeat/td-pbp-featuresordata/odds-freshness-…;**matches all of them.What changed
vercel.json:"*": false→"**": false."main": truestays. Vercel deploys a branch when any matching rule is true, somainstill deploys.test/vercel-git-config.test.mjspins"**": false, rejects a bare"*", and requiresmainto be the only enabled branch.What this does not fix
main. They come from data commits that change nothing served.scripts/vercel_ignore.shcancels 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
mainshould deploy as before.Testing
npm test: 214 passed, 0 failed, 3 skipped (Chrome-only; these pass in CI).🤖 Generated with Claude Code