diff --git a/__snapshots__/manifest.ts.js b/__snapshots__/manifest.ts.js index 8b4589a62..41235aca2 100644 --- a/__snapshots__/manifest.ts.js +++ b/__snapshots__/manifest.ts.js @@ -225,8 +225,3 @@ exports['Manifest buildPullRequests should warn end user via PR comment if versi To set a custom version be sure to use the [semantic versioning format](https://devhints.io/semver), e.g \`1.2.3\`. ` - -exports['Manifest createReleases should throw when release branch is missing and changes-branch not in synced with target-branch 1'] = ` -Errors when aligning pull requests branches: - - Branch 'next' cannot be safely re-aligned with 'main', and will likely result in git conflicts when the next release PR is created. Hint: compare branches 'release-please--branches--main--changes--next', 'next', and 'main' for inconsistencies -` diff --git a/src/manifest.ts b/src/manifest.ts index 24a39c546..e2f7545bc 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -50,6 +50,7 @@ import { } from './util/pull-request-overflow-handler'; import {signoffCommitMessage} from './util/signoff-commit-message'; import {CommitExclude} from './util/commit-exclude'; +import {setupLogger} from 'code-suggester/build/src/logger'; type ExtraJsonFile = { type: 'json'; @@ -444,6 +445,9 @@ export class Manifest { parseConfig(github, configFile, changesBranch, path, releaseAs), parseReleasedVersions(github, manifestFile, changesBranch), ]); + if (manifestOptions.logger) { + setupLogger(manifestOptions.logger); + } return new Manifest( github, targetBranch, @@ -1292,7 +1296,11 @@ export class Manifest { // try to re-align branches to ensure the next release pull request won't face git conflicts. In case of // inconsistencies releases are still created but the command fails and won't force a re-alignment between a PR // ref branch and base branch. - await this.alignPullRequestsChangesBranch(pullRequests); + try { + await this.alignPullRequestsChangesBranch(pullRequests); + } catch (err) { + this.logger.error(err as {}); + } return createdReleases; } diff --git a/test/manifest.ts b/test/manifest.ts index 3b10726d4..26bedc6be 100644 --- a/test/manifest.ts +++ b/test/manifest.ts @@ -8637,7 +8637,7 @@ version = "3.0.0" sinon.assert.calledOnce(unlockBranchStub); }); - it('should throw when release branch is missing and changes-branch not in synced with target-branch', async () => { + it('should not throw when release branch is missing and changes-branch not in synced with target-branch', async () => { mockPullRequests( github, [], @@ -8737,14 +8737,7 @@ version = "3.0.0" } ); - let err: unknown; - try { - await manifest.createReleases(); - } catch (e) { - err = e; - } - expect(err).to.be.instanceOf(Error); - snapshot((err).message); + await manifest.createReleases(); // releases are still created sinon.assert.calledOnce(commentStub);