From 2ff289866d040e607b770288e02afbdacf70776d Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Jul 2026 01:31:01 -0700 Subject: [PATCH] fix(release): suppress overridden release PR subjects --- .../scripts/verify-release-notes.mjs | 25 +++++++++++++++++-- test/scripts/verify-release-notes.test.ts | 9 +++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.agents/skills/openclaw-changelog-update/scripts/verify-release-notes.mjs b/.agents/skills/openclaw-changelog-update/scripts/verify-release-notes.mjs index 2c686b2a2ddb..5d204a4940ff 100644 --- a/.agents/skills/openclaw-changelog-update/scripts/verify-release-notes.mjs +++ b/.agents/skills/openclaw-changelog-update/scripts/verify-release-notes.mjs @@ -810,6 +810,21 @@ export function resolvedReleasePullRequests( ); } +export function releasePullRequestReferencesToSuppress( + currentPullRequests, + subject, + associatedPullRequests, + hasProvenanceOverride, +) { + const candidates = new Set(currentPullRequests); + if (hasProvenanceOverride) { + for (const match of subject.matchAll(/\(#(\d+)\)\s*$/g)) { + candidates.add(Number(match[1])); + } + } + return [...candidates].filter((number) => !associatedPullRequests.includes(number)); +} + function changedPathsForCommit(hash) { return new Set( git(["diff-tree", "--root", "--no-commit-id", "--name-only", "-r", hash, "--"]) @@ -1187,15 +1202,21 @@ function sourceCommits(base, target, mainRef) { (hash) => canonicalMainPullRequests.get(hash) ?? [], ); const matchedMainCommits = canonicalMainCommitsByReleaseCommit.get(commit.hash) ?? []; + const provenanceOverride = provenanceOverrides.get(commit.hash); const associatedPullRequests = resolvedReleasePullRequests( currentPullRequests, mainPullRequests, matchedMainCommits.length > 0, - provenanceOverrides.get(commit.hash), + provenanceOverride, ); commit.pullRequests = associatedPullRequests; const suppressedBackportPullRequests = new Set( - currentPullRequests.filter((number) => !associatedPullRequests.includes(number)), + releasePullRequestReferencesToSuppress( + currentPullRequests, + commit.subject, + associatedPullRequests, + provenanceOverride !== undefined, + ), ); commit.references = commit.references.filter( (number) => !suppressedBackportPullRequests.has(number), diff --git a/test/scripts/verify-release-notes.test.ts b/test/scripts/verify-release-notes.test.ts index bfb888ec6db2..83b42a0b171d 100644 --- a/test/scripts/verify-release-notes.test.ts +++ b/test/scripts/verify-release-notes.test.ts @@ -16,6 +16,7 @@ import { highlightCountError, persistGithubSnapshot, releaseNoteReferences, + releasePullRequestReferencesToSuppress, releaseProvenanceMarkers, renderedContributionRecordReferences, resolvedReleasePullRequests, @@ -67,6 +68,14 @@ describe("release-note verification", () => { expect(resolvedReleasePullRequests([104939], [], false, [104905, 102980, 104956])).toEqual([ 104905, 102980, 104956, ]); + expect( + releasePullRequestReferencesToSuppress( + [], + "test(live): harden GPT-5.6 nonce retries for July (#104939)", + [104905, 102980, 104956], + true, + ), + ).toEqual([104939]); }); it("rejects malformed, out-of-range, or conflicting release provenance markers", () => {