From 96e996e7fa0678ce943ffcbc0323a1b5b0fa92cd Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Tue, 27 Oct 2026 16:10:50 -0300 Subject: [PATCH] tools: lint first Alpha release proposals The release proposal linter assumed that a changelog without a `### Commits` section belongs to a semver-major release whose proposal contains only the release commit. The first Alpha release of a line has the same changelog layout, but its proposal may carry commits picked into `vN.x-staging` after the branch-off, which made the linter fail with "Cannot find on the list". Look the proposal commits up in the `Semver-*` lists instead, and skip the check that every listed commit is in the proposal, since that list covers every commit since the previous release line. Refs: https://github.com/nodejs/node/pull/67062 Signed-off-by: RafaelGSS --- .../lint-release-proposal-commit-list.mjs | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/tools/actions/lint-release-proposal-commit-list.mjs b/tools/actions/lint-release-proposal-commit-list.mjs index fa5ebf79cdfe..12edd427d27a 100755 --- a/tools/actions/lint-release-proposal-commit-list.mjs +++ b/tools/actions/lint-release-proposal-commit-list.mjs @@ -20,13 +20,19 @@ import { createInterface } from 'node:readline'; const stdinLineByLine = createInterface(process.stdin)[Symbol.asyncIterator](); const changelog = await readFile(CHANGELOG_PATH, 'utf-8'); -const commitListingStart = changelog.indexOf('\n### Commits\n'); +let commitListingStart = changelog.indexOf('\n### Commits\n'); let commitList; +// Whether every commit listed in the changelog must be in the proposal. +let listMustMatchProposal = true; if (commitListingStart === -1) { - // We're preparing a semver-major release. - assert.match(changelog, /\n### Semver-Major Commits\n/); - // The proposal should contain only the release commit. - commitList = ''; + // We're preparing the first release of a new release line: the changelog + // lists every commit since the previous release line, most of them already on + // the release branch, so the proposal only contains a subset of the list. + commitListingStart = changelog.indexOf('\n### Semver-Major Commits\n'); + assert.notStrictEqual(commitListingStart, -1, 'Could not find the commit list'); + const releaseEnd = changelog.indexOf('\n\n