From 337c90144540a4451f11e7a1fee8240cc36751a1 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Fri, 20 Feb 2026 18:01:43 +0100 Subject: [PATCH 1/2] fix: pass header and footer through in Java snapshot PRs The `buildSnapshotPullRequest()` method in the Java strategy was constructing a `PullRequestBody` without passing the configured `pullRequestHeader` and `pullRequestFooter`, causing these options to be silently ignored for Java snapshot PRs. This is especially visible for single-package repos where `separatePullRequests` defaults to `true` and the Merge plugin (which would otherwise apply the footer) does not run. Fixes the TODO comment that was already in the code asking about this. Signed-off-by: Gregor Zeitlinger --- src/strategies/java.ts | 19 ++++++++++++------- test/strategies/java.ts | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/strategies/java.ts b/src/strategies/java.ts index 1b7f14923..2c6cce4c4 100644 --- a/src/strategies/java.ts +++ b/src/strategies/java.ts @@ -123,14 +123,19 @@ export class Java extends BaseStrategy { : BranchName.ofTargetBranch(this.targetBranch); const notes = '### Updating meta-information for bleeding-edge SNAPSHOT release.'; - // TODO use pullrequest header here? - const pullRequestBody = new PullRequestBody([ + const pullRequestBody = new PullRequestBody( + [ + { + component, + version: newVersion, + notes, + }, + ], { - component, - version: newVersion, - notes, - }, - ]); + header: this.pullRequestHeader, + footer: this.pullRequestFooter, + } + ); const updates = await this.buildUpdates({ newVersion, versionsMap, diff --git a/test/strategies/java.ts b/test/strategies/java.ts index 63245b504..ff505b21a 100644 --- a/test/strategies/java.ts +++ b/test/strategies/java.ts @@ -230,6 +230,31 @@ describe('Java', () => { expect(release?.labels).to.eql(['bot', 'custom:snapshot']); }); + it('includes header and footer in snapshot PR', async () => { + const strategy = new Java({ + targetBranch: 'main', + github, + pullRequestHeader: 'My custom header', + pullRequestFooter: 'My custom footer', + }); + + const latestRelease = { + tag: new TagName(Version.parse('2.3.3')), + sha: 'abc123', + notes: 'some notes', + }; + const release = await strategy.buildReleasePullRequest( + COMMITS_NO_SNAPSHOT, + latestRelease, + false, + DEFAULT_LABELS + ); + + const body = release?.body.toString(); + expect(body).to.include('My custom header'); + expect(body).to.include('My custom footer'); + }); + it('creates draft snapshot PR', async () => { const strategy = new Java({ targetBranch: 'main', From f116531914bdd23432859c2c9a030dc6b0e88f89 Mon Sep 17 00:00:00 2001 From: Gregor Zeitlinger Date: Wed, 18 Mar 2026 14:14:23 +0000 Subject: [PATCH 2/2] chore: retrigger CI Signed-off-by: Gregor Zeitlinger