diff --git a/.cursor/rules/ci-config.mdc b/.cursor/rules/ci-config.mdc index 10f951be8a12..62fbde22266a 100644 --- a/.cursor/rules/ci-config.mdc +++ b/.cursor/rules/ci-config.mdc @@ -32,3 +32,4 @@ alwaysApply: false - Vercel's ignore step: exit 0 skips, anything else builds, so fail open. Never diff only `HEAD^`: a master merge or multi-commit push makes it wrong. Run `vercel-ignore.test.sh` after changes. - `git.deploymentEnabled: false` doesn't stick (dashboard overrides it); skipped pushes still show as canceled deployments. +- Previews on `renovate/*` skip when the only site changes are website `package.json` or lockfiles; production is unchanged. diff --git a/website/scripts/vercel-ignore.sh b/website/scripts/vercel-ignore.sh index 09a0449af9d5..2c78683a45bb 100755 --- a/website/scripts/vercel-ignore.sh +++ b/website/scripts/vercel-ignore.sh @@ -81,6 +81,14 @@ if [[ "${VERCEL_GIT_COMMIT_REF:-}" =~ ^(master|rest-hooks-site)$ || "${VERCEL_EN build "no previous production deploy to compare" fi +# Renovate previews skip when only website dependency manifests or lockfiles +# changed. Site or docs source changes still build. +if [[ "${VERCEL_GIT_COMMIT_REF:-}" == renovate/* ]]; then + for f in package.json yarn.lock package-lock.json pnpm-lock.yaml npm-shrinkwrap.json; do + SITE_PATHS+=(":(exclude,glob)website/**/$f") + done +fi + # Previews compare the branch's changes, not commits merged in from upstream. # When the tip merges master, diff against the merged master commit: that # counts the branch's site files and any conflict resolutions, not master's. diff --git a/website/scripts/vercel-ignore.test.sh b/website/scripts/vercel-ignore.test.sh index 253880b66554..b42eccc7ab51 100755 --- a/website/scripts/vercel-ignore.test.sh +++ b/website/scripts/vercel-ignore.test.sh @@ -180,4 +180,27 @@ expect build "production env site tip" other-branch "$(parent)" production commit "prod pkg" packages/normalizr/src/index.ts expect skip "production env package tip" other-branch "$(parent)" production +# --- Renovate previews ignore website dependency manifests and lockfiles --- +git -C "$repo" checkout -b renovate/docusaurus master >/dev/null 2>&1 +commit "bump docusaurus" website/package.json +expect skip "renovate website package.json" renovate/docusaurus +expect build "renovate ref in production env" renovate/docusaurus "$(parent)" production +commit "bump lockfiles" website/yarn.lock website/examples/demo/package.json website/examples/demo/pnpm-lock.yaml +expect skip "renovate nested manifests and lockfiles since last deploy" renovate/docusaurus "$(parent)" +git -C "$repo" checkout master >/dev/null 2>&1 +commit "master site for renovate" docs/core/api/Renovate.md +git -C "$repo" checkout renovate/docusaurus >/dev/null 2>&1 +git -C "$repo" merge --no-edit master >/dev/null +expect skip "renovate merge of master" renovate/docusaurus +commit "renovate site source" website/src/pages/index.js +expect build "renovate with site source" renovate/docusaurus "$(parent)" + +git -C "$repo" checkout -b deps master >/dev/null 2>&1 +commit "manual bump" website/package.json +expect build "non-renovate website package.json" deps + +git -C "$repo" checkout master >/dev/null 2>&1 +commit "master bump" website/package.json website/yarn.lock +expect build "master website manifest" master "$(parent)" + echo "all vercel-ignore cases passed"