Skip to content

ci(vercel): deploy only main and opted-in branches instead of skipping builds - #1509

Merged
scttbnsn merged 5 commits into
dev/v1.8from
fix/v1.8-vercel-preview-scope
Oct 29, 2026
Merged

scttbnsn merged 5 commits into
dev/v1.8from
fix/v1.8-vercel-preview-scope

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

The team's Vercel Hobby plan caps deploys at 100 a day. On 2026-10-26 the team hit 124, and drydock's two projects were 43 of those, mostly previews on pushes that can't change the site or demo (backend fixes, Renovate, merges into dev). That held another project's production deploy back about 11 hours.

An ignore step doesn't fix this. Vercel counts a build that ignoreCommand cancels as a full deployment against the quota (project settings docs, Ignored Build Step). The only lever is not creating the deployment, so both vercel.json files now set git.deploymentEnabled:

  • off for **
  • on for main, so production is unchanged
  • on for branches that opt in by name: -web- for the site (fix/v1.8-web-mobile-nav), -demo- for the demo

Vercel deploys a branch when any matching rule is true (git configuration docs), which is why main still deploys under the ** rule.

The trade-off is that a site or demo change on a branch without the tag gets no preview. CI's site build still runs on it, and renaming the branch brings the preview back.

scripts/vercel-deploy-branches.test.mjs checks the rules against a set of real branch names using Vercel's any-true matching, and asserts there's no ignoreCommand. It fails without the config.

Verify:

node --test scripts/*.test.mjs

Done when: main still deploys both projects, a -web- or -demo- branch previews the right one, and other pushes create no Vercel deployment.

Changelog

  • ✨ Added tests for main, project-specific branch patterns, non-matching branches, and the absence of ignoreCommand.
  • 🔧 Changed both Vercel configs to disable deployments by default and enable them for main and matching -web- or -demo- branches.

Concerns

  • Review finding counts: unavailable; no current review findings were supplied.
  • Test results: unavailable; the test command was not run.

Nearly every PR adds a changelog line, so counting it previewed the site on almost every push. Production still builds the changelog page.
…g builds

Vercel counts a build cancelled by ignoreCommand as a deployment against the daily cap, so the ignore step saved minutes but not quota. Turn git deployments off for every branch except main and branches named -web- (site) or -demo- (demo), and drop the ignore script.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 349fb3c and 3d25594.

Files ignored due to path filters: 1
  • CHANGELOG.md is excluded by !CHANGELOG.md
Files selected for processing: 3
  • apps/demo/vercel.json
  • apps/web/vercel.json
  • scripts/vercel-deploy-branches.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The web and demo Vercel configurations disable deployments by default and enable them for main and project-specific branch patterns. Tests check matching branches, quiet branches, cross-project branches, and the absence of ignoreCommand.

Priority: Normal

Change: Other

Merge Risk: Minimal · up to 3d255

Tagged branches retain previews while other branch pushes are excluded; no material merge risk is evident.

Pre-merge checks: Passed 2
Check name Status Explanation
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.
Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn
scttbnsn merged commit 282f9db into dev/v1.8 Oct 29, 2026
34 of 35 checks passed
@scttbnsn
scttbnsn deleted the fix/v1.8-vercel-preview-scope branch October 29, 2026 00:36
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