From de63e9731196d1cdf62bf57bc064f15a2d31c4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sat, 21 Nov 2026 06:59:15 +0000 Subject: [PATCH] fix(ci): a diff is a release only when it bumps versions (#8355) * test(ci): a fix to an earlier release's notes is not a release * fix(ci): a diff is a release only when it bumps versions --- scripts/ci/release-only-diff.mjs | 2 +- scripts/ci/release-only-diff.test.mjs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/ci/release-only-diff.mjs b/scripts/ci/release-only-diff.mjs index 57e43761ea..5b4b44ce7f 100644 --- a/scripts/ci/release-only-diff.mjs +++ b/scripts/ci/release-only-diff.mjs @@ -42,7 +42,7 @@ export function classify(paths, before, after) { if (bumped === null) other.push(path); else versions.set(path, bumped); } - return { releaseOnly: paths.length > 0 && other.length === 0, other, versions }; + return { releaseOnly: versions.size > 0 && other.length === 0, other, versions }; } /** The commits in `commits` ({ sha, subject }) that release notes should list but do not link. */ diff --git a/scripts/ci/release-only-diff.test.mjs b/scripts/ci/release-only-diff.test.mjs index 2c659e4e63..3926f2e2e1 100644 --- a/scripts/ci/release-only-diff.test.mjs +++ b/scripts/ci/release-only-diff.test.mjs @@ -213,6 +213,19 @@ test("the merge queue runs the release checks on a release diff", () => { assert.match(ci, /release-checks:[\s\S]*merge_group[\s\S]*release_diff/); }); +// fails without the fix: a fix to an earlier release's notes counted as a release, so its checks wanted a bump. +test("a diff of only release notes and the changelog is a notes fix, not a release", () => { + const files = { "releases/v1.2.3.md": "# old", "docs/changelog.mdx": "old" }; + const after = { "releases/v1.2.3.md": "# new", "docs/changelog.mdx": "new" }; + const result = classify( + Object.keys(files), + (p) => files[p] ?? null, + (p) => after[p] ?? null, + ); + assert.equal(result.releaseOnly, false); + assert.equal(result.versions.size, 0); +}); + test("classify works on plain data", () => { const files = { "a/package.json": manifest("1"), "plugin.json": manifest("1") }; const after = { "a/package.json": manifest("2"), "plugin.json": manifest("2") };