diff --git a/src/bin/release-please.ts b/src/bin/release-please.ts index 593a5f0ac..b8da00af0 100644 --- a/src/bin/release-please.ts +++ b/src/bin/release-please.ts @@ -497,7 +497,7 @@ const createReleasePullRequestCommand: yargs.CommandModule< } if (argv.dryRun) { - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); logger.debug(`Would open ${pullRequests.length} pull requests`); logger.debug('fork:', manifest.fork); logger.debug('changes branch:', manifest.changesBranch); @@ -632,7 +632,7 @@ const createManifestPullRequestCommand: yargs.CommandModule< ); if (argv.dryRun) { - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); logger.debug(`Would open ${pullRequests.length} pull requests`); logger.debug('fork:', manifest.fork); for (const pullRequest of pullRequests) { diff --git a/src/github.ts b/src/github.ts index 859626633..7e2883c09 100644 --- a/src/github.ts +++ b/src/github.ts @@ -1495,6 +1495,7 @@ export class GitHub { release: Release, options: ReleaseOptions = {} ): Promise => { + this.logger.debug({tag: release.tag}); const resp = await this.octokit.repos.createRelease({ name: release.name, owner: this.repository.owner, @@ -1751,7 +1752,7 @@ export class GitHub { branchName: string, branchSha: string ): Promise { - this.logger.debug(`Creating new branch: '${branchName}' at $'{branchSha}'`); + this.logger.debug(`Creating new branch: '${branchName}' at '${branchSha}'`); const { data: { object: {sha}, diff --git a/src/manifest.ts b/src/manifest.ts index b2d1c5f36..61fff60e3 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -264,6 +264,7 @@ export const DEFAULT_RELEASE_LABELS = ['autorelease: tagged']; export const DEFAULT_SNAPSHOT_LABELS = ['autorelease: snapshot']; export const SNOOZE_LABEL = 'autorelease: snooze'; export const DEFAULT_PRERELEASE_LABELS = ['autorelease: pre-release']; +export const DEFAULT_USEREDITED_LABEL = 'autorelease: user edited'; const DEFAULT_RELEASE_SEARCH_DEPTH = 400; const DEFAULT_COMMIT_SEARCH_DEPTH = 500; @@ -505,7 +506,10 @@ export class Manifest { * * @returns {ReleasePullRequest[]} The candidate pull requests to open or update. */ - async buildPullRequests(): Promise { + async buildPullRequests( + openPullRequests: PullRequest[], + snoozedPullRequests: PullRequest[] + ): Promise { this.logger.info('Building pull requests'); const pathsByComponent = await this.getPathsByComponent(); const strategiesByPath = await this.getStrategiesByPath(); @@ -733,11 +737,18 @@ export class Manifest { const strategy = strategies[path]; const latestRelease = releasesByPath[path]; + + const branchName = (await strategy.getBranchName()).toString(); + const existingPR = + openPullRequests.find(pr => pr.headBranchName === branchName) || + snoozedPullRequests.find(pr => pr.headBranchName === branchName); + const releasePullRequest = await strategy.buildReleasePullRequest( pathCommits, latestRelease, config.draftPullRequest ?? this.draftPullRequest, - this.labels + this.labels, + existingPR ); this.logger.debug(`path: ${path}`); this.logger.debug( @@ -840,11 +851,6 @@ export class Manifest { // register all possible labels to make them available to users through GitHub label dropdown await this.registerLabels(); - const candidatePullRequests = await this.buildPullRequests(); - if (candidatePullRequests.length === 0) { - return []; - } - // if there are any merged, pending release pull requests, don't open // any new release PRs const mergedPullRequestsGenerator = this.findMergedReleasePullRequests(); @@ -859,6 +865,15 @@ export class Manifest { const openPullRequests = await this.findOpenReleasePullRequests(); const snoozedPullRequests = await this.findSnoozedReleasePullRequests(); + // prepare releases pull requests + const candidatePullRequests = await this.buildPullRequests( + openPullRequests, + snoozedPullRequests + ); + if (candidatePullRequests.length === 0) { + return []; + } + if (this.sequentialCalls) { const pullRequests: PullRequest[] = []; for (const pullRequest of candidatePullRequests) { @@ -1019,13 +1034,23 @@ export class Manifest { existing: PullRequest, pullRequest: ReleasePullRequest ): Promise { + const userEditedExistingPR = existing.labels.find( + label => label === DEFAULT_USEREDITED_LABEL + ); + + this.logger.debug({userEditedExistingPR, existing}); + // If unchanged, no need to push updates - if (existing.body === pullRequest.body.toString()) { + if ( + !userEditedExistingPR && + existing.body === pullRequest.body.toString() + ) { this.logger.info( `PR https://github.com/${this.repository.owner}/${this.repository.repo}/pull/${existing.number} remained the same` ); return undefined; } + const updatedPullRequest = await this.github.updatePullRequest( existing.number, pullRequest, @@ -1037,6 +1062,12 @@ export class Manifest { pullRequestOverflowHandler: this.pullRequestOverflowHandler, } ); + + await this.github.removeIssueLabels( + [DEFAULT_USEREDITED_LABEL], + existing.number + ); + return updatedPullRequest; } diff --git a/src/release-pull-request.ts b/src/release-pull-request.ts index d7ec27078..9949cc47d 100644 --- a/src/release-pull-request.ts +++ b/src/release-pull-request.ts @@ -20,7 +20,7 @@ import {PullRequestTitle} from './util/pull-request-title'; export interface ReleasePullRequest { readonly title: PullRequestTitle; readonly body: PullRequestBody; - readonly labels: string[]; + labels: string[]; readonly headRefName: string; readonly version?: Version; readonly draft: boolean; diff --git a/src/strategies/base.ts b/src/strategies/base.ts index 4941aae96..0de004ad1 100644 --- a/src/strategies/base.ts +++ b/src/strategies/base.ts @@ -146,6 +146,17 @@ export abstract class BaseStrategy implements Strategy { this.initialVersion = options.initialVersion; this.extraLabels = options.extraLabels || []; } + async getBranchName(): Promise { + const branchComponent = await this.getBranchComponent(); + const branchName = branchComponent + ? BranchName.ofComponentTargetBranch( + branchComponent, + this.targetBranch, + this.changesBranch + ) + : BranchName.ofTargetBranch(this.targetBranch, this.changesBranch); + return branchName; + } /** * Specify the files necessary to update in a release pull request. @@ -258,7 +269,8 @@ export abstract class BaseStrategy implements Strategy { commits: ConventionalCommit[], latestRelease?: Release, draft?: boolean, - labels: string[] = [] + labels: string[] = [], + existingPullRequest?: PullRequest ): Promise { const conventionalCommits = await this.postProcessCommits(commits); this.logger.info(`Considering: ${conventionalCommits.length} commits`); @@ -267,10 +279,41 @@ export abstract class BaseStrategy implements Strategy { return undefined; } - const newVersion = await this.buildNewVersion( - conventionalCommits, - latestRelease + const releaseAsCommit = conventionalCommits.find(conventionalCommit => + conventionalCommit.notes.find(note => note.title === 'RELEASE AS') + ); + const releaseAsNote = releaseAsCommit?.notes.find( + note => note.title === 'RELEASE AS' ); + + const existingPRTitleVersion = + existingPullRequest && + PullRequestTitle.parse(existingPullRequest.title)?.getVersion(); + const userEditedExistingPR = + existingPullRequest && + existingPullRequest.labels.find( + label => label === 'autorelease: user edited' + ); + + let newVersion: Version; + if (existingPRTitleVersion && userEditedExistingPR) { + newVersion = existingPRTitleVersion; + } else if (this.releaseAs) { + this.logger.warn( + `Setting version for ${this.path} from release-as configuration` + ); + newVersion = Version.parse(this.releaseAs); + } else if (releaseAsNote) { + newVersion = Version.parse(releaseAsNote.text); + } else if (latestRelease) { + newVersion = await this.versioningStrategy.bump( + latestRelease.tag.version, + conventionalCommits + ); + } else { + newVersion = this.initialReleaseVersion(); + } + const versionsMap = await this.updateVersionsMap( await this.buildVersionsMap(conventionalCommits), conventionalCommits, @@ -298,15 +341,6 @@ export abstract class BaseStrategy implements Strategy { this.pullRequestTitlePattern ); - const branchComponent = await this.getBranchComponent(); - const branchName = branchComponent - ? BranchName.ofComponentTargetBranch( - branchComponent, - this.targetBranch, - this.changesBranch - ) - : BranchName.ofTargetBranch(this.targetBranch, this.changesBranch); - const releaseNotesBody = await this.buildReleaseNotes( conventionalCommits, newVersion, @@ -346,7 +380,7 @@ export abstract class BaseStrategy implements Strategy { body: pullRequestBody, updates: updatesWithExtras, labels: [...labels, ...this.extraLabels], - headRefName: branchName.toString(), + headRefName: (await this.getBranchName()).toString(), version: newVersion, draft: draft ?? false, }; @@ -463,45 +497,12 @@ export abstract class BaseStrategy implements Strategy { for (const [component, version] of versionsMap.entries()) { versionsMap.set( component, - await this.versioningStrategy.bump(version, conventionalCommits) + this.versioningStrategy.bump(version, conventionalCommits) ); } return versionsMap; } - protected async buildNewVersion( - conventionalCommits: ConventionalCommit[], - latestRelease?: Release - ): Promise { - if (this.releaseAs) { - this.logger.warn( - `Setting version for ${this.path} from release-as configuration` - ); - return Version.parse(this.releaseAs); - } - - const releaseAsCommit = conventionalCommits.find(conventionalCommit => - conventionalCommit.notes.find(note => note.title === 'RELEASE AS') - ); - if (releaseAsCommit) { - const note = releaseAsCommit.notes.find( - note => note.title === 'RELEASE AS' - ); - if (note) { - return Version.parse(note.text); - } - } - - if (latestRelease) { - return await this.versioningStrategy.bump( - latestRelease.tag.version, - conventionalCommits - ); - } - - return this.initialReleaseVersion(); - } - protected async buildVersionsMap( _conventionalCommits: ConventionalCommit[] ): Promise { diff --git a/src/strategy.ts b/src/strategy.ts index 91486f85c..62ae6edf9 100644 --- a/src/strategy.ts +++ b/src/strategy.ts @@ -19,6 +19,7 @@ import {Commit} from './commit'; import {VersioningStrategy} from './versioning-strategy'; import {ChangelogNotes} from './changelog-notes'; import {Version} from './version'; +import {BranchName} from './util/branch-name'; export interface BuildReleaseOptions { groupPullRequestTitlePattern?: string; @@ -39,15 +40,17 @@ export interface Strategy { * component if available. * @param {boolean} draft Optional. Whether or not to create the pull * request as a draft. Defaults to `false`. - * @returns {ReleasePullRequest | undefined} The release pull request to - * open for this path/component. Returns undefined if we should not - * open a pull request. + * @param {string[]} labels Optional. + * @param {PullRequest} existingPullRequest Optional. A pull request already existing for this branch. + * @returns {ReleasePullRequest | undefined} The release pull request to open for this path/component. Returns + * undefined if we should not open a pull request. */ buildReleasePullRequest( commits: Commit[], latestRelease?: Release, draft?: boolean, - labels?: string[] + labels?: string[], + existingPullRequest?: PullRequest ): Promise; /** @@ -84,6 +87,8 @@ export interface Strategy { */ getBranchComponent(): Promise; + getBranchName(): Promise; + /** * Validate whether version is a valid release. * @param version Released version. diff --git a/test/manifest.ts b/test/manifest.ts index 0548140ab..030dd735c 100644 --- a/test/manifest.ts +++ b/test/manifest.ts @@ -1517,7 +1517,7 @@ describe('Manifest', () => { '.': Version.parse('1.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.version?.toString()).to.eql('1.0.1'); @@ -1554,7 +1554,7 @@ describe('Manifest', () => { undefined, 'non/default/path/manifest.json' ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; assertHasUpdate(pullRequest.updates, 'non/default/path/manifest.json'); @@ -1574,7 +1574,7 @@ describe('Manifest', () => { '.': Version.parse('1.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.draft).to.be.true; @@ -1596,7 +1596,7 @@ describe('Manifest', () => { draftPullRequest: true, } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.draft).to.be.true; @@ -1618,7 +1618,7 @@ describe('Manifest', () => { labels: ['some-special-label'], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.labels).to.eql(['some-special-label']); @@ -1638,7 +1638,7 @@ describe('Manifest', () => { '.': Version.parse('1.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.title.toString()).to.eql('release: 1.0.1'); @@ -1658,7 +1658,7 @@ describe('Manifest', () => { '.': Version.parse('1.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.body.header.toString()).to.eql( @@ -1722,7 +1722,7 @@ describe('Manifest', () => { '.': Version.parse('1.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.version?.toString()).to.eql('1.0.1'); @@ -1811,7 +1811,7 @@ describe('Manifest', () => { 'path/b': Version.parse('0.2.3'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); expect(pullRequests[0].labels).to.eql(['autorelease: pending']); snapshot(dateSafe(pullRequests[0].body.toString())); @@ -1900,7 +1900,7 @@ describe('Manifest', () => { separatePullRequests: true, } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(2); snapshot(dateSafe(pullRequests[0].body.toString())); snapshot(dateSafe(pullRequests[1].body.toString())); @@ -1993,7 +1993,7 @@ describe('Manifest', () => { .withArgs('.release-please-manifest.json', 'main') .resolves(buildGitHubFileRaw(JSON.stringify(versions))); const manifest = await Manifest.fromManifest(github, 'main'); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(2); expect(pullRequests[0].version?.toString()).to.eql('1.0.1'); expect(pullRequests[1].version?.toString()).to.eql('3.3.3'); @@ -2086,7 +2086,7 @@ describe('Manifest', () => { .withArgs('.release-please-manifest.json', 'main') .resolves(buildGitHubFileRaw(JSON.stringify(versions))); const manifest = await Manifest.fromManifest(github, 'main'); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(2); expect(pullRequests[0].version?.toString()).to.eql('3.3.3'); expect(pullRequests[1].version?.toString()).to.eql('3.3.3'); @@ -2142,7 +2142,7 @@ describe('Manifest', () => { .withArgs('.release-please-manifest.json', 'main') .resolves(buildGitHubFileRaw(JSON.stringify(versions))); const manifest = await Manifest.fromManifest(github, 'main'); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); expect(pullRequests[0].version?.toString()).to.eql('1.0.0'); }); @@ -2235,7 +2235,7 @@ describe('Manifest', () => { .withArgs('.release-please-manifest.json', 'main') .resolves(buildGitHubFileRaw(JSON.stringify(versions))); const manifest = await Manifest.fromManifest(github, 'main'); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); expect(pullRequests[0].version?.toString()).to.eql('1.0.0'); }); @@ -2347,7 +2347,7 @@ describe('Manifest', () => { 'chore${scope}: release${component} v${version}', } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.title.toString()).to.eql( @@ -2446,7 +2446,7 @@ describe('Manifest', () => { 'chore${scope}: release${component} v${version}', } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); expect(pullRequests[0].title.toString()).to.eql('chore(main): release v'); }); @@ -2489,7 +2489,7 @@ describe('Manifest', () => { .withArgs('.release-please-manifest.json', 'main') .resolves(buildGitHubFileRaw(JSON.stringify(versions))); const manifest = await Manifest.fromManifest(github, 'main'); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); expect(pullRequests[0].body.releaseData).lengthOf(1); expect(pullRequests[0].body.releaseData[0].component).to.eql('pkg1'); @@ -2536,7 +2536,7 @@ describe('Manifest', () => { '.': Version.parse('1.2.3'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.version?.toString()).to.eql('1.2.4-SNAPSHOT'); @@ -2571,7 +2571,7 @@ describe('Manifest', () => { '.': Version.parse('1.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(0); }); @@ -2601,7 +2601,7 @@ describe('Manifest', () => { '.': Version.parse('1.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.version?.toString()).to.eql('1.0.1-SNAPSHOT'); @@ -2659,7 +2659,7 @@ describe('Manifest', () => { 'pkg/c': Version.parse('1.0.1'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); expect(pullRequests[0].updates).to.be.an('array'); expect(pullRequests[0].updates.map(update => update.path)) @@ -2733,7 +2733,7 @@ describe('Manifest', () => { draftPullRequest: true, } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; safeSnapshot(pullRequest.body.toString()); @@ -2837,7 +2837,7 @@ describe('Manifest', () => { plugins: ['node-workspace'], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).not.empty; sinon.assert.calledOnce(mockPlugin.run); }); @@ -2881,7 +2881,7 @@ describe('Manifest', () => { plugins: ['node-workspace', 'cargo-workspace'], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).not.empty; sinon.assert.calledOnce(mockPlugin.run); sinon.assert.calledOnce(mockPlugin2.run); @@ -2912,7 +2912,7 @@ describe('Manifest', () => { plugins: ['sentence-case'], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).not.empty; // This assertion verifies that conventional commit parsing // was applied before calling the processCommits plugin hook: @@ -2999,7 +2999,7 @@ describe('Manifest', () => { '.': Version.parse('1.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.version?.toString()).to.eql('1.0.1'); @@ -3089,7 +3089,7 @@ describe('Manifest', () => { 'path/b': Version.parse('0.2.3'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); expect(pullRequests[0].labels).to.eql(['autorelease: pending']); snapshot(dateSafe(pullRequests[0].body.toString())); @@ -3153,7 +3153,7 @@ describe('Manifest', () => { } ); expect(manifest.releaseSearchDepth).to.eql(1); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.version?.toString()).to.eql('1.0.1'); @@ -3224,7 +3224,7 @@ describe('Manifest', () => { } ); expect(manifest.commitSearchDepth).to.eql(1); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; expect(pullRequest.version?.toString()).to.eql('1.0.1'); @@ -3318,7 +3318,7 @@ describe('Manifest', () => { separatePullRequests: true, } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(3); const pullRequestB = pullRequests[0]; expect(pullRequestB.headRefName).to.eql( @@ -3359,7 +3359,7 @@ describe('Manifest', () => { 'pkg/d': Version.parse('3.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(2); const pullRequest = pullRequests[0]; expect(pullRequest.headRefName).to.eql( @@ -3397,7 +3397,7 @@ describe('Manifest', () => { 'pkg/d': Version.parse('3.0.0'), } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(2); const pullRequest = pullRequests[0]; expect(pullRequest.headRefName).to.eql( diff --git a/test/plugins/compatibility/linked-versions-group-title.ts b/test/plugins/compatibility/linked-versions-group-title.ts index 978fa2049..b3eed176e 100644 --- a/test/plugins/compatibility/linked-versions-group-title.ts +++ b/test/plugins/compatibility/linked-versions-group-title.ts @@ -147,7 +147,7 @@ describe('Plugin compatibility', () => { groupPullRequestTitlePattern: 'chore: Release${component} ${version}', } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; safeSnapshot(pullRequest.body.toString()); diff --git a/test/plugins/compatibility/linked-versions-workspace.ts b/test/plugins/compatibility/linked-versions-workspace.ts index a7c57fae8..d938dbad0 100644 --- a/test/plugins/compatibility/linked-versions-workspace.ts +++ b/test/plugins/compatibility/linked-versions-workspace.ts @@ -164,7 +164,7 @@ describe('Plugin compatibility', () => { ], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; safeSnapshot(pullRequest.body.toString()); diff --git a/test/plugins/linked-versions.ts b/test/plugins/linked-versions.ts index ec45729e8..f439f8f79 100644 --- a/test/plugins/linked-versions.ts +++ b/test/plugins/linked-versions.ts @@ -166,7 +166,7 @@ describe('LinkedVersions plugin', () => { ], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(1); const pullRequest = pullRequests[0]; const packageData2 = pullRequest.body.releaseData.find( @@ -214,7 +214,7 @@ describe('LinkedVersions plugin', () => { ], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(2); const singlePullRequest = pullRequests[0]; safeSnapshot(singlePullRequest.body.toString()); @@ -266,7 +266,7 @@ describe('LinkedVersions plugin', () => { ], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); for (const pullRequest of pullRequests) { safeSnapshot(pullRequest.body.toString()); } @@ -315,7 +315,7 @@ describe('LinkedVersions plugin', () => { ], } ); - const pullRequests = await manifest.buildPullRequests(); + const pullRequests = await manifest.buildPullRequests([], []); expect(pullRequests).lengthOf(2); const groupPullRequest1 = pullRequests[1]; const packageData1 = groupPullRequest1.body.releaseData.find(