Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/strategies/java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
25 changes: 25 additions & 0 deletions test/strategies/java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading