From f441676b2f57ce716e8a0b2b34ecc300dfee1f90 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 17 Dec 2020 15:57:17 -0800 Subject: [PATCH] fix(go): submodules should bump patch (#661) --- __snapshots__/yoshi-go.js | 4 ++-- src/releasers/go-yoshi.ts | 11 +++++++---- .../releasers/fixtures/yoshi-go/cloud-go-commits.json | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/__snapshots__/yoshi-go.js b/__snapshots__/yoshi-go.js index 77d518417..7d6ec0fa5 100644 --- a/__snapshots__/yoshi-go.js +++ b/__snapshots__/yoshi-go.js @@ -56,7 +56,7 @@ filename: pubsublite/CHANGES.md # Changelog -## [0.124.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.123.4...v0.124.0) (1983-10-10) -### Features +### Bug Fixes +### [0.123.5](https://www.github.com/googleapis/google-cloud-go/compare/v0.123.4...v0.123.5) (1983-10-10) * **pubsublite:** start generating v1 ([1d9662c](https://www.github.com/googleapis/google-cloud-go/commit/1d9662cf08ab1cf3b68d95dee4dc99b7c4aac371)) ` diff --git a/src/releasers/go-yoshi.ts b/src/releasers/go-yoshi.ts index 19b242f38..95ecfaf22 100644 --- a/src/releasers/go-yoshi.ts +++ b/src/releasers/go-yoshi.ts @@ -129,10 +129,13 @@ export class GoYoshi extends ReleasePR { githubRepoUrl: this.repoUrl, bumpMinorPreMajor: this.bumpMinorPreMajor, }); - const candidate: ReleaseCandidate = await this.coerceReleaseCandidate( - cc, - latestTag - ); + const candidate: ReleaseCandidate = + this.monorepoTags || + !(this.isMultiClientRepo(repo) || this.isGapicRepo(repo)) + ? // Submodules use conventional commits to bump major/minor/patch: + await super.coerceReleaseCandidate(cc, latestTag) + : // Root module always bumps minor: + await this.coerceReleaseCandidate(cc, latestTag); // "closes" is a little presumptuous, let's just indicate that the // PR references these other commits: diff --git a/test/releasers/fixtures/yoshi-go/cloud-go-commits.json b/test/releasers/fixtures/yoshi-go/cloud-go-commits.json index d7755d2d1..be20427c7 100644 --- a/test/releasers/fixtures/yoshi-go/cloud-go-commits.json +++ b/test/releasers/fixtures/yoshi-go/cloud-go-commits.json @@ -195,7 +195,7 @@ }, { "node": { - "message": "feat(pubsublite): start generating v1", + "message": "fix(pubsublite): start generating v1", "oid": "1d9662cf08ab1cf3b68d95dee4dc99b7c4aac371", "associatedPullRequests": { "edges": [