release-please 15.10.3 → 15.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/build/src/manifest.js +7 -1
- package/build/src/plugins/linked-versions.js +7 -1
- package/build/src/plugins/merge.d.ts +10 -1
- package/build/src/plugins/merge.js +9 -5
- package/build/src/strategies/php-yoshi.js +1 -27
- package/build/src/util/branch-name.d.ts +1 -0
- package/build/src/util/branch-name.js +27 -0
- package/package.json +2 -2
- package/build/src/updaters/php/php-manifest.d.ts +0 -14
- package/build/src/updaters/php/php-manifest.js +0 -55
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [15.10.5](https://github.com/googleapis/release-please/compare/v15.10.4...v15.10.5) (2023-05-26)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* Allow configuring multiple, separate linked-versions plugins ([#1961](https://github.com/googleapis/release-please/issues/1961)) ([a3fac52](https://github.com/googleapis/release-please/commit/a3fac52b909bf62cfd934c48d139cc3cae9d37f1))
|
|
13
|
+
* **php-yoshi:** Remove manifest.json, Version.php, and ServiceBuilder.php ([#1949](https://github.com/googleapis/release-please/issues/1949)) ([09fb84b](https://github.com/googleapis/release-please/commit/09fb84b9244649622b556a78a8b03f664213bcb7))
|
|
14
|
+
|
|
15
|
+
## [15.10.4](https://github.com/googleapis/release-please/compare/v15.10.3...v15.10.4) (2023-04-19)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* Add more trace logging when searching for latest release version ([#1922](https://github.com/googleapis/release-please/issues/1922)) ([c33cc81](https://github.com/googleapis/release-please/commit/c33cc8112fc366242182bcb3a28015c488f6140b))
|
|
21
|
+
|
|
7
22
|
## [15.10.3](https://github.com/googleapis/release-please/compare/v15.10.2...v15.10.3) (2023-04-11)
|
|
8
23
|
|
|
9
24
|
|
package/build/src/manifest.js
CHANGED
|
@@ -373,7 +373,9 @@ class Manifest {
|
|
|
373
373
|
// Combine pull requests into 1 unless configured for separate
|
|
374
374
|
// pull requests
|
|
375
375
|
if (!this.separatePullRequests) {
|
|
376
|
-
this.plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig,
|
|
376
|
+
this.plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig, {
|
|
377
|
+
pullRequestTitlePattern: this.groupPullRequestTitlePattern,
|
|
378
|
+
}));
|
|
377
379
|
}
|
|
378
380
|
for (const plugin of this.plugins) {
|
|
379
381
|
this.logger.debug(`running plugin: ${plugin.constructor.name}`);
|
|
@@ -920,19 +922,23 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config,
|
|
|
920
922
|
commitShas.add(commitWithPullRequest.sha);
|
|
921
923
|
const mergedPullRequest = commitWithPullRequest.pullRequest;
|
|
922
924
|
if (!mergedPullRequest) {
|
|
925
|
+
logger.trace(`skipping commit: ${commitWithPullRequest.sha} missing merged pull request`);
|
|
923
926
|
continue;
|
|
924
927
|
}
|
|
925
928
|
const branchName = branch_name_1.BranchName.parse(mergedPullRequest.headBranchName, logger);
|
|
926
929
|
if (!branchName) {
|
|
930
|
+
logger.trace(`skipping commit: ${commitWithPullRequest.sha} unrecognized branch name: ${mergedPullRequest.headBranchName}`);
|
|
927
931
|
continue;
|
|
928
932
|
}
|
|
929
933
|
// If branchPrefix is specified, ensure it is found in the branch name.
|
|
930
934
|
// If branchPrefix is not specified, component should also be undefined.
|
|
931
935
|
if (branchName.getComponent() !== branchPrefix) {
|
|
936
|
+
logger.trace(`skipping commit: ${commitWithPullRequest.sha} branch component ${branchName.getComponent()} doesn't match expected prefix: ${branchPrefix}`);
|
|
932
937
|
continue;
|
|
933
938
|
}
|
|
934
939
|
const pullRequestTitle = pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title, config.pullRequestTitlePattern, logger);
|
|
935
940
|
if (!pullRequestTitle) {
|
|
941
|
+
logger.trace(`skipping commit: ${commitWithPullRequest.sha} couldn't parse pull request title: ${mergedPullRequest.title}`);
|
|
936
942
|
continue;
|
|
937
943
|
}
|
|
938
944
|
const version = pullRequestTitle.getVersion();
|
|
@@ -18,6 +18,7 @@ const plugin_1 = require("../plugin");
|
|
|
18
18
|
const commit_1 = require("../commit");
|
|
19
19
|
const factory_1 = require("../factory");
|
|
20
20
|
const merge_1 = require("./merge");
|
|
21
|
+
const branch_name_1 = require("../util/branch-name");
|
|
21
22
|
/**
|
|
22
23
|
* This plugin reconfigures strategies by linking multiple components
|
|
23
24
|
* together.
|
|
@@ -107,6 +108,7 @@ class LinkedVersions extends plugin_1.ManifestPlugin {
|
|
|
107
108
|
const [inScopeCandidates, outOfScopeCandidates] = candidates.reduce((collection, candidate) => {
|
|
108
109
|
if (!candidate.pullRequest.version) {
|
|
109
110
|
this.logger.warn('pull request missing version', candidate);
|
|
111
|
+
collection[1].push(candidate);
|
|
110
112
|
return collection;
|
|
111
113
|
}
|
|
112
114
|
if (this.components.has(candidate.config.component || '')) {
|
|
@@ -120,7 +122,11 @@ class LinkedVersions extends plugin_1.ManifestPlugin {
|
|
|
120
122
|
this.logger.info(`found ${inScopeCandidates.length} linked-versions candidates`);
|
|
121
123
|
// delegate to the merge plugin and add merged pull request
|
|
122
124
|
if (inScopeCandidates.length > 0) {
|
|
123
|
-
const merge = new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig,
|
|
125
|
+
const merge = new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig, {
|
|
126
|
+
pullRequestTitlePattern: `chore\${scope}: release ${this.groupName} libraries`,
|
|
127
|
+
forceMerge: true,
|
|
128
|
+
headBranchName: branch_name_1.BranchName.ofGroupTargetBranch(this.groupName, this.targetBranch).toString(),
|
|
129
|
+
});
|
|
124
130
|
const merged = await merge.run(inScopeCandidates);
|
|
125
131
|
outOfScopeCandidates.push(...merged);
|
|
126
132
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { ManifestPlugin } from '../plugin';
|
|
2
2
|
import { CandidateReleasePullRequest, RepositoryConfig } from '../manifest';
|
|
3
3
|
import { GitHub } from '../github';
|
|
4
|
+
interface MergeOptions {
|
|
5
|
+
pullRequestTitlePattern?: string;
|
|
6
|
+
pullRequestHeader?: string;
|
|
7
|
+
headBranchName?: string;
|
|
8
|
+
forceMerge?: boolean;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* This plugin merges multiple pull requests into a single
|
|
6
12
|
* release pull request.
|
|
@@ -10,6 +16,9 @@ import { GitHub } from '../github';
|
|
|
10
16
|
export declare class Merge extends ManifestPlugin {
|
|
11
17
|
private pullRequestTitlePattern?;
|
|
12
18
|
private pullRequestHeader?;
|
|
13
|
-
|
|
19
|
+
private headBranchName?;
|
|
20
|
+
private forceMerge;
|
|
21
|
+
constructor(github: GitHub, targetBranch: string, repositoryConfig: RepositoryConfig, options?: MergeOptions);
|
|
14
22
|
run(candidates: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
|
|
15
23
|
}
|
|
24
|
+
export {};
|
|
@@ -27,19 +27,23 @@ const composite_1 = require("../updaters/composite");
|
|
|
27
27
|
* Release notes are broken up using `<summary>`/`<details>` blocks.
|
|
28
28
|
*/
|
|
29
29
|
class Merge extends plugin_1.ManifestPlugin {
|
|
30
|
-
constructor(github, targetBranch, repositoryConfig,
|
|
30
|
+
constructor(github, targetBranch, repositoryConfig, options = {}) {
|
|
31
|
+
var _a, _b;
|
|
31
32
|
super(github, targetBranch, repositoryConfig);
|
|
32
33
|
this.pullRequestTitlePattern =
|
|
33
|
-
pullRequestTitlePattern
|
|
34
|
-
this.pullRequestHeader = pullRequestHeader;
|
|
34
|
+
(_a = options.pullRequestTitlePattern) !== null && _a !== void 0 ? _a : manifest_1.MANIFEST_PULL_REQUEST_TITLE_PATTERN;
|
|
35
|
+
this.pullRequestHeader = options.pullRequestHeader;
|
|
36
|
+
this.headBranchName = options.headBranchName;
|
|
37
|
+
this.forceMerge = (_b = options.forceMerge) !== null && _b !== void 0 ? _b : false;
|
|
35
38
|
}
|
|
36
39
|
async run(candidates) {
|
|
40
|
+
var _a;
|
|
37
41
|
if (candidates.length < 1) {
|
|
38
42
|
return candidates;
|
|
39
43
|
}
|
|
40
44
|
this.logger.info(`Merging ${candidates.length} pull requests`);
|
|
41
45
|
const [inScopeCandidates, outOfScopeCandidates] = candidates.reduce((collection, candidate) => {
|
|
42
|
-
if (candidate.config.separatePullRequests) {
|
|
46
|
+
if (candidate.config.separatePullRequests && !this.forceMerge) {
|
|
43
47
|
collection[1].push(candidate);
|
|
44
48
|
}
|
|
45
49
|
else {
|
|
@@ -71,7 +75,7 @@ class Merge extends plugin_1.ManifestPlugin {
|
|
|
71
75
|
}),
|
|
72
76
|
updates,
|
|
73
77
|
labels: Array.from(labels),
|
|
74
|
-
headRefName: branch_name_1.BranchName.ofTargetBranch(this.targetBranch).toString(),
|
|
78
|
+
headRefName: (_a = this.headBranchName) !== null && _a !== void 0 ? _a : branch_name_1.BranchName.ofTargetBranch(this.targetBranch).toString(),
|
|
75
79
|
draft: !candidates.some(candidate => !candidate.pullRequest.draft),
|
|
76
80
|
};
|
|
77
81
|
const releaseTypes = new Set(candidates.map(candidate => candidate.config.releaseType));
|
|
@@ -17,7 +17,6 @@ exports.PHPYoshi = void 0;
|
|
|
17
17
|
const base_1 = require("./base");
|
|
18
18
|
const changelog_1 = require("../updaters/changelog");
|
|
19
19
|
const root_composer_update_packages_1 = require("../updaters/php/root-composer-update-packages");
|
|
20
|
-
const php_manifest_1 = require("../updaters/php/php-manifest");
|
|
21
20
|
const php_client_version_1 = require("../updaters/php/php-client-version");
|
|
22
21
|
const version_1 = require("../version");
|
|
23
22
|
const commit_1 = require("../commit");
|
|
@@ -184,8 +183,7 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
184
183
|
changelogEntry: options.changelogEntry,
|
|
185
184
|
}),
|
|
186
185
|
});
|
|
187
|
-
// update the aggregate package information in the root
|
|
188
|
-
// composer.json and manifest.json.
|
|
186
|
+
// update the aggregate package information in the root composer.json
|
|
189
187
|
updates.push({
|
|
190
188
|
path: this.addPath('composer.json'),
|
|
191
189
|
createIfMissing: false,
|
|
@@ -194,30 +192,6 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
194
192
|
versionsMap,
|
|
195
193
|
}),
|
|
196
194
|
});
|
|
197
|
-
updates.push({
|
|
198
|
-
path: this.addPath('docs/manifest.json'),
|
|
199
|
-
createIfMissing: false,
|
|
200
|
-
updater: new php_manifest_1.PHPManifest({
|
|
201
|
-
version,
|
|
202
|
-
versionsMap,
|
|
203
|
-
}),
|
|
204
|
-
});
|
|
205
|
-
updates.push({
|
|
206
|
-
path: this.addPath('src/Version.php'),
|
|
207
|
-
createIfMissing: false,
|
|
208
|
-
updater: new php_client_version_1.PHPClientVersion({
|
|
209
|
-
version,
|
|
210
|
-
versionsMap,
|
|
211
|
-
}),
|
|
212
|
-
});
|
|
213
|
-
updates.push({
|
|
214
|
-
path: this.addPath('src/ServiceBuilder.php'),
|
|
215
|
-
createIfMissing: false,
|
|
216
|
-
updater: new php_client_version_1.PHPClientVersion({
|
|
217
|
-
version,
|
|
218
|
-
versionsMap,
|
|
219
|
-
}),
|
|
220
|
-
});
|
|
221
195
|
return updates;
|
|
222
196
|
}
|
|
223
197
|
}
|
|
@@ -9,6 +9,7 @@ export declare class BranchName {
|
|
|
9
9
|
static ofVersion(version: Version): BranchName;
|
|
10
10
|
static ofTargetBranch(targetBranch: string): BranchName;
|
|
11
11
|
static ofComponentTargetBranch(component: string, targetBranch: string): BranchName;
|
|
12
|
+
static ofGroupTargetBranch(group: string, targetBranch: string): BranchName;
|
|
12
13
|
constructor(_branchName: string);
|
|
13
14
|
static matches(_branchName: string): boolean;
|
|
14
15
|
getTargetBranch(): string | undefined;
|
|
@@ -25,6 +25,7 @@ function getAllResourceNames() {
|
|
|
25
25
|
return [
|
|
26
26
|
AutoreleaseBranchName,
|
|
27
27
|
ComponentBranchName,
|
|
28
|
+
GroupBranchName,
|
|
28
29
|
DefaultBranchName,
|
|
29
30
|
V12ComponentBranchName,
|
|
30
31
|
V12DefaultBranchName,
|
|
@@ -58,6 +59,9 @@ class BranchName {
|
|
|
58
59
|
static ofComponentTargetBranch(component, targetBranch) {
|
|
59
60
|
return new ComponentBranchName(`${RELEASE_PLEASE}--branches--${targetBranch}--components--${component}`);
|
|
60
61
|
}
|
|
62
|
+
static ofGroupTargetBranch(group, targetBranch) {
|
|
63
|
+
return new GroupBranchName(`${RELEASE_PLEASE}--branches--${targetBranch}--groups--${safeBranchName(group)}`);
|
|
64
|
+
}
|
|
61
65
|
constructor(_branchName) { }
|
|
62
66
|
static matches(_branchName) {
|
|
63
67
|
return false;
|
|
@@ -186,4 +190,27 @@ class ComponentBranchName extends BranchName {
|
|
|
186
190
|
return `${RELEASE_PLEASE}--branches--${this.targetBranch}--components--${this.component}`;
|
|
187
191
|
}
|
|
188
192
|
}
|
|
193
|
+
const GROUP_PATTERN = `^${RELEASE_PLEASE}--branches--(?<branch>.+)--groups--(?<group>.+)$`;
|
|
194
|
+
class GroupBranchName extends BranchName {
|
|
195
|
+
static matches(branchName) {
|
|
196
|
+
return !!branchName.match(GROUP_PATTERN);
|
|
197
|
+
}
|
|
198
|
+
constructor(branchName) {
|
|
199
|
+
super(branchName);
|
|
200
|
+
const match = branchName.match(GROUP_PATTERN);
|
|
201
|
+
if (match === null || match === void 0 ? void 0 : match.groups) {
|
|
202
|
+
this.targetBranch = match.groups['branch'];
|
|
203
|
+
this.component = match.groups['group'];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
toString() {
|
|
207
|
+
return `${RELEASE_PLEASE}--branches--${this.targetBranch}--groups--${this.component}`;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function safeBranchName(branchName) {
|
|
211
|
+
// convert disallowed characters in branch names, replacing them with '-'.
|
|
212
|
+
// replace multiple consecutive '-' with a single '-' to avoid interfering with
|
|
213
|
+
// our regexes for parsing the branch names
|
|
214
|
+
return branchName.replace(/[^\w\d]/g, '-').replace(/-+/g, '-');
|
|
215
|
+
}
|
|
189
216
|
//# sourceMappingURL=branch-name.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "15.10.
|
|
3
|
+
"version": "15.10.5",
|
|
4
4
|
"description": "generate release PRs based on the conventionalcommits.org spec",
|
|
5
5
|
"main": "./build/src/index.js",
|
|
6
6
|
"bin": "./build/src/bin/release-please.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"gts": "^3.1.0",
|
|
64
64
|
"mocha": "^9.2.2",
|
|
65
65
|
"nock": "^13.0.0",
|
|
66
|
-
"sinon": "15.0
|
|
66
|
+
"sinon": "15.1.0",
|
|
67
67
|
"snap-shot-it": "^7.0.0"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../../util/logger';
|
|
2
|
-
import { DefaultUpdater } from '../default';
|
|
3
|
-
/**
|
|
4
|
-
* Updates a manifest.json file.
|
|
5
|
-
* @see https://github.com/googleapis/google-cloud-php/blob/master/docs/manifest.json
|
|
6
|
-
*/
|
|
7
|
-
export declare class PHPManifest extends DefaultUpdater {
|
|
8
|
-
/**
|
|
9
|
-
* Given initial file contents, return updated contents.
|
|
10
|
-
* @param {string} content The initial content
|
|
11
|
-
* @returns {string} The updated content
|
|
12
|
-
*/
|
|
13
|
-
updateContent(content: string, logger?: Logger): string;
|
|
14
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2019 Google LLC
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.PHPManifest = void 0;
|
|
17
|
-
const logger_1 = require("../../util/logger");
|
|
18
|
-
const json_stringify_1 = require("../../util/json-stringify");
|
|
19
|
-
const default_1 = require("../default");
|
|
20
|
-
/**
|
|
21
|
-
* Updates a manifest.json file.
|
|
22
|
-
* @see https://github.com/googleapis/google-cloud-php/blob/master/docs/manifest.json
|
|
23
|
-
*/
|
|
24
|
-
class PHPManifest extends default_1.DefaultUpdater {
|
|
25
|
-
/**
|
|
26
|
-
* Given initial file contents, return updated contents.
|
|
27
|
-
* @param {string} content The initial content
|
|
28
|
-
* @returns {string} The updated content
|
|
29
|
-
*/
|
|
30
|
-
updateContent(content, logger = logger_1.logger) {
|
|
31
|
-
if (!this.versionsMap || this.versionsMap.size === 0) {
|
|
32
|
-
logger.info('no updates necessary');
|
|
33
|
-
return content;
|
|
34
|
-
}
|
|
35
|
-
const parsed = JSON.parse(content);
|
|
36
|
-
parsed.modules.forEach((module) => {
|
|
37
|
-
if (!this.versionsMap)
|
|
38
|
-
return;
|
|
39
|
-
for (const [key, version] of this.versionsMap) {
|
|
40
|
-
if (module.name === key) {
|
|
41
|
-
logger.info(`adding ${key}@${version} to manifest`);
|
|
42
|
-
module.versions.unshift(`v${version}`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// the mono-repo's own API version should be added to the
|
|
46
|
-
// google/cloud key:
|
|
47
|
-
if (module.name === 'google/cloud') {
|
|
48
|
-
module.versions.unshift(`v${this.version}`);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.PHPManifest = PHPManifest;
|
|
55
|
-
//# sourceMappingURL=php-manifest.js.map
|