release-please
Advanced tools
Comparing version 6.4.4 to 6.5.0
@@ -86,3 +86,3 @@ import { Octokit } from '@octokit/rest'; | ||
private getBaseLabel; | ||
private getDefaultBranch; | ||
getDefaultBranch(): Promise<string>; | ||
closePR(prNumber: number): Promise<void>; | ||
@@ -89,0 +89,0 @@ static qualifyRef(refName: string): string; |
@@ -7,4 +7,6 @@ import { ReleasePR, ReleaseCandidate } from '../release-pr'; | ||
protected _run(): Promise<void>; | ||
private isGapicRepo; | ||
private isMultiClientRepo; | ||
protected coerceReleaseCandidate(cc: ConventionalCommits, latestTag: GitHubTag | undefined): Promise<ReleaseCandidate>; | ||
protected defaultInitialVersion(): string; | ||
} |
@@ -23,2 +23,4 @@ "use strict"; | ||
const changelog_1 = require("../updaters/changelog"); | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const parseGithubRepoUrl = require('parse-github-repo-url'); | ||
// Commits containing a scope prefixed with an item in this array will be | ||
@@ -36,8 +38,10 @@ // ignored when generating a release PR for the parent module. | ||
]; | ||
const GAPIC_PR_REGEX = /.*auto-regenerate gapics.*/; | ||
const REGEN_PR_REGEX = /.*auto-regenerate.*/; | ||
const SCOPE_REGEX = /^\w+\((?<scope>.*)\):/; | ||
class GoYoshi extends release_pr_1.ReleasePR { | ||
async _run() { | ||
const scopeRe = /^\w+\((?<scope>.*)\):/; | ||
const latestTag = await this.gh.latestTag(this.monorepoTags ? `${this.packageName}-` : undefined); | ||
let gapicPR; | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const [_owner, repo] = parseGithubRepoUrl(this.repoUrl); | ||
let regenPR; | ||
let sha = null; | ||
@@ -49,16 +53,18 @@ const commits = (await this.commits({ | ||
var _a, _b, _c, _d; | ||
// Filter commits that don't have a scope as we don't know where to put | ||
// them. | ||
const scope = (_b = (_a = commit.message.match(scopeRe)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.scope; | ||
if (!scope) { | ||
return false; | ||
} | ||
// Skipping commits related to sub-modules as they are not apart of the | ||
// parent module. | ||
for (const subModule of SUB_MODULES) { | ||
if (scope === subModule || scope.startsWith(subModule + '/')) { | ||
// TODO(codyoss): eventually gather these commits into a map so we can | ||
// purpose releases for sub-modules. | ||
if (this.isGapicRepo(repo)) { | ||
const scope = (_b = (_a = commit.message.match(SCOPE_REGEX)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.scope; | ||
// Filter commits that don't have a scope as we don't know where to put | ||
// them. | ||
if (!scope) { | ||
return false; | ||
} | ||
// Skipping commits related to sub-modules as they are not apart of the | ||
// parent module. | ||
for (const subModule of SUB_MODULES) { | ||
if (scope === subModule || scope.startsWith(subModule + '/')) { | ||
// TODO(codyoss): eventually gather these commits into a map so we can | ||
// purpose releases for sub-modules. | ||
return false; | ||
} | ||
} | ||
} | ||
@@ -70,10 +76,10 @@ // Store the very first SHA returned, this represents the HEAD of the | ||
} | ||
// Only have a single entry of the nightly regen listed in the changelog. | ||
// If there are more than one of these commits, append associated PR. | ||
if (GAPIC_PR_REGEX.test(commit.message)) { | ||
if (this.isMultiClientRepo(repo) && REGEN_PR_REGEX.test(commit.message)) { | ||
// Only have a single entry of the nightly regen listed in the changelog. | ||
// If there are more than one of these commits, append associated PR. | ||
const issueRe = /(?<prefix>.*)\((?<pr>.*)\)(\n|$)/; | ||
if (gapicPR) { | ||
if (regenPR) { | ||
const match = commit.message.match(issueRe); | ||
if ((_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.pr) { | ||
gapicPR.message += `\nRefs ${match.groups.pr}`; | ||
regenPR.message += `\nRefs ${match.groups.pr}`; | ||
} | ||
@@ -85,6 +91,6 @@ return false; | ||
commit.sha = null; | ||
gapicPR = commit; | ||
regenPR = commit; | ||
const match = commit.message.match(issueRe); | ||
if ((_d = match === null || match === void 0 ? void 0 : match.groups) === null || _d === void 0 ? void 0 : _d.pr) { | ||
gapicPR.message = `${match.groups.prefix}\n\nRefs ${match.groups.pr}`; | ||
regenPR.message = `${match.groups.prefix}\n\nRefs ${match.groups.pr}`; | ||
} | ||
@@ -133,2 +139,8 @@ } | ||
} | ||
isGapicRepo(repo) { | ||
return repo === 'google-cloud-go'; | ||
} | ||
isMultiClientRepo(repo) { | ||
return repo === 'google-cloud-go' || repo === 'google-api-go-client'; | ||
} | ||
async coerceReleaseCandidate(cc, latestTag) { | ||
@@ -135,0 +147,0 @@ const version = latestTag |
@@ -7,2 +7,9 @@ # Changelog | ||
## [6.5.0](https://www.github.com/googleapis/release-please/compare/v6.4.4...v6.5.0) (2020-10-27) | ||
### Features | ||
* **go:** generalize to also support google-api-go-client ([#554](https://www.github.com/googleapis/release-please/issues/554)) ([609164c](https://www.github.com/googleapis/release-please/commit/609164ce23ddb9af369b01855581157e9ea891e3)) | ||
### [6.4.4](https://www.github.com/googleapis/release-please/compare/v6.4.3...v6.4.4) (2020-10-21) | ||
@@ -9,0 +16,0 @@ |
{ | ||
"name": "release-please", | ||
"version": "6.4.4", | ||
"version": "6.5.0", | ||
"description": "generate release PRs based on the conventionalcommits.org spec", | ||
@@ -5,0 +5,0 @@ "main": "./build/src/index.js", |
@@ -122,2 +122,3 @@ <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/> | ||
if: ${{ steps.release.outputs.release_created }} | ||
# if you are using Yarn, substitute the command below with `yarn install --frozen-lockfile` | ||
- run: npm ci | ||
@@ -124,0 +125,0 @@ if: ${{ steps.release.outputs.release_created }} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
258178
4648
220