release-please 13.15.0 → 13.16.1
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 +22 -0
- package/build/src/manifest.d.ts +2 -1
- package/build/src/manifest.js +3 -1
- package/build/src/plugins/cargo-workspace.d.ts +2 -4
- package/build/src/plugins/cargo-workspace.js +0 -6
- package/build/src/plugins/merge.js +11 -1
- package/build/src/plugins/node-workspace.js +1 -2
- package/build/src/plugins/workspace.js +1 -0
- package/build/src/strategies/base.d.ts +1 -0
- package/build/src/strategies/base.js +9 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
### [13.16.1](https://github.com/googleapis/release-please/compare/v13.16.0...v13.16.1) (2022-05-10)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* release tagging can find branch components ([#1425](https://github.com/googleapis/release-please/issues/1425)) ([2947d1e](https://github.com/googleapis/release-please/commit/2947d1e9bc49cc25e7c5eef022ba4106d72e829f))
|
|
13
|
+
|
|
14
|
+
## [13.16.0](https://github.com/googleapis/release-please/compare/v13.15.1...v13.16.0) (2022-05-06)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* allow configuring separate-pull-requests per component ([#1412](https://github.com/googleapis/release-please/issues/1412)) ([d274421](https://github.com/googleapis/release-please/commit/d2744219fbbd6c58a10b177a824fb3715039162a))
|
|
20
|
+
|
|
21
|
+
### [13.15.1](https://github.com/googleapis/release-please/compare/v13.15.0...v13.15.1) (2022-05-05)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **cargo-workspace:** stop defaulting to updating all components ([#1414](https://github.com/googleapis/release-please/issues/1414)) ([532637c](https://github.com/googleapis/release-please/commit/532637c399d38962e1c0a8622656d61e0fe7e405))
|
|
27
|
+
* node-workspace should not bump versions for peer dependencies ([#1413](https://github.com/googleapis/release-please/issues/1413)) ([cc4eaaa](https://github.com/googleapis/release-please/commit/cc4eaaa864b7a6444e4dc72d1c75a596932d7b62)), closes [#1403](https://github.com/googleapis/release-please/issues/1403)
|
|
28
|
+
|
|
7
29
|
## [13.15.0](https://github.com/googleapis/release-please/compare/v13.14.0...v13.15.0) (2022-04-27)
|
|
8
30
|
|
|
9
31
|
|
package/build/src/manifest.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface ReleaserConfig {
|
|
|
39
39
|
includeVInTag?: boolean;
|
|
40
40
|
pullRequestTitlePattern?: string;
|
|
41
41
|
tagSeparator?: string;
|
|
42
|
+
separatePullRequests?: boolean;
|
|
42
43
|
changelogSections?: ChangelogSection[];
|
|
43
44
|
changelogPath?: string;
|
|
44
45
|
changelogType?: ChangelogNotesType;
|
|
@@ -75,6 +76,7 @@ interface ReleaserConfigJson {
|
|
|
75
76
|
'changelog-type'?: ChangelogNotesType;
|
|
76
77
|
'changelog-host'?: string;
|
|
77
78
|
'pull-request-title-pattern'?: string;
|
|
79
|
+
'separate-pull-requests'?: boolean;
|
|
78
80
|
'tag-separator'?: string;
|
|
79
81
|
'extra-files'?: string[];
|
|
80
82
|
'version-file'?: string;
|
|
@@ -125,7 +127,6 @@ export interface ManifestConfig extends ReleaserConfigJson {
|
|
|
125
127
|
'last-release-sha'?: string;
|
|
126
128
|
'always-link-local'?: boolean;
|
|
127
129
|
plugins?: PluginType[];
|
|
128
|
-
'separate-pull-requests'?: boolean;
|
|
129
130
|
'group-pull-request-title-pattern'?: string;
|
|
130
131
|
'release-search-depth'?: number;
|
|
131
132
|
'commit-search-depth'?: number;
|
package/build/src/manifest.js
CHANGED
|
@@ -715,6 +715,7 @@ function extractReleaserConfig(config) {
|
|
|
715
715
|
changelogType: config['changelog-type'],
|
|
716
716
|
pullRequestTitlePattern: config['pull-request-title-pattern'],
|
|
717
717
|
tagSeparator: config['tag-separator'],
|
|
718
|
+
separatePullRequests: config['separate-pull-requests'],
|
|
718
719
|
};
|
|
719
720
|
}
|
|
720
721
|
/**
|
|
@@ -873,7 +874,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix,
|
|
|
873
874
|
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
|
874
875
|
}
|
|
875
876
|
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
876
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
877
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
877
878
|
return {
|
|
878
879
|
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
|
879
880
|
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
|
@@ -893,6 +894,7 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
|
893
894
|
includeVInTag: (_s = pathConfig.includeVInTag) !== null && _s !== void 0 ? _s : defaultConfig.includeVInTag,
|
|
894
895
|
tagSeparator: (_t = pathConfig.tagSeparator) !== null && _t !== void 0 ? _t : defaultConfig.tagSeparator,
|
|
895
896
|
pullRequestTitlePattern: (_u = pathConfig.pullRequestTitlePattern) !== null && _u !== void 0 ? _u : defaultConfig.pullRequestTitlePattern,
|
|
897
|
+
separatePullRequests: (_v = pathConfig.separatePullRequests) !== null && _v !== void 0 ? _v : defaultConfig.separatePullRequests,
|
|
896
898
|
};
|
|
897
899
|
}
|
|
898
900
|
/**
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { CandidateReleasePullRequest
|
|
2
|
-
import { WorkspacePlugin, DependencyGraph
|
|
1
|
+
import { CandidateReleasePullRequest } from '../manifest';
|
|
2
|
+
import { WorkspacePlugin, DependencyGraph } from './workspace';
|
|
3
3
|
import { CargoManifest } from '../updaters/rust/common';
|
|
4
4
|
import { VersionsMap, Version } from '../version';
|
|
5
|
-
import { GitHub } from '../github';
|
|
6
5
|
interface CrateInfo {
|
|
7
6
|
/**
|
|
8
7
|
* e.g. `crates/crate-a`
|
|
@@ -37,7 +36,6 @@ interface CrateInfo {
|
|
|
37
36
|
* into a single rust package.
|
|
38
37
|
*/
|
|
39
38
|
export declare class CargoWorkspace extends WorkspacePlugin<CrateInfo> {
|
|
40
|
-
constructor(github: GitHub, targetBranch: string, repositoryConfig: RepositoryConfig, options?: WorkspacePluginOptions);
|
|
41
39
|
protected buildAllPackages(candidates: CandidateReleasePullRequest[]): Promise<{
|
|
42
40
|
allPackages: CrateInfo[];
|
|
43
41
|
candidatesByPackage: Record<string, CandidateReleasePullRequest>;
|
|
@@ -35,12 +35,6 @@ const cargo_lock_1 = require("../updaters/rust/cargo-lock");
|
|
|
35
35
|
* into a single rust package.
|
|
36
36
|
*/
|
|
37
37
|
class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
38
|
-
constructor(github, targetBranch, repositoryConfig, options = {}) {
|
|
39
|
-
super(github, targetBranch, repositoryConfig, {
|
|
40
|
-
...options,
|
|
41
|
-
updateAllPackages: true,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
38
|
async buildAllPackages(candidates) {
|
|
45
39
|
var _a, _b, _c, _d;
|
|
46
40
|
const cargoManifestContent = await this.github.getFileContentsOnBranch('Cargo.toml', this.targetBranch);
|
|
@@ -38,11 +38,20 @@ class Merge extends plugin_1.ManifestPlugin {
|
|
|
38
38
|
return candidates;
|
|
39
39
|
}
|
|
40
40
|
logger_1.logger.info(`Merging ${candidates.length} pull requests`);
|
|
41
|
+
const [inScopeCandidates, outOfScopeCandidates] = candidates.reduce((collection, candidate) => {
|
|
42
|
+
if (candidate.config.separatePullRequests) {
|
|
43
|
+
collection[1].push(candidate);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
collection[0].push(candidate);
|
|
47
|
+
}
|
|
48
|
+
return collection;
|
|
49
|
+
}, [[], []]);
|
|
41
50
|
const releaseData = [];
|
|
42
51
|
const labels = new Set();
|
|
43
52
|
let rawUpdates = [];
|
|
44
53
|
let rootRelease = null;
|
|
45
|
-
for (const candidate of
|
|
54
|
+
for (const candidate of inScopeCandidates) {
|
|
46
55
|
const pullRequest = candidate.pullRequest;
|
|
47
56
|
rawUpdates = rawUpdates.concat(...pullRequest.updates);
|
|
48
57
|
for (const label of pullRequest.labels) {
|
|
@@ -72,6 +81,7 @@ class Merge extends plugin_1.ManifestPlugin {
|
|
|
72
81
|
releaseType,
|
|
73
82
|
},
|
|
74
83
|
},
|
|
84
|
+
...outOfScopeCandidates,
|
|
75
85
|
];
|
|
76
86
|
}
|
|
77
87
|
}
|
|
@@ -211,7 +211,7 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
211
211
|
return candidates;
|
|
212
212
|
}
|
|
213
213
|
async buildGraph(allPackages) {
|
|
214
|
-
var _a, _b, _c
|
|
214
|
+
var _a, _b, _c;
|
|
215
215
|
const graph = new Map();
|
|
216
216
|
const workspacePackageNames = new Set(allPackages.map(packageJson => packageJson.name));
|
|
217
217
|
for (const packageJson of allPackages) {
|
|
@@ -219,7 +219,6 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
219
219
|
...((_a = packageJson.dependencies) !== null && _a !== void 0 ? _a : {}),
|
|
220
220
|
...((_b = packageJson.devDependencies) !== null && _b !== void 0 ? _b : {}),
|
|
221
221
|
...((_c = packageJson.optionalDependencies) !== null && _c !== void 0 ? _c : {}),
|
|
222
|
-
...((_d = packageJson.peerDependencies) !== null && _d !== void 0 ? _d : {}),
|
|
223
222
|
});
|
|
224
223
|
const workspaceDeps = allDeps.filter(dep => workspacePackageNames.has(dep));
|
|
225
224
|
graph.set(packageJson.name, {
|
|
@@ -132,6 +132,7 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
|
132
132
|
* being updated.
|
|
133
133
|
*/
|
|
134
134
|
buildGraphOrder(graph, packageNamesToUpdate) {
|
|
135
|
+
logger_1.logger.info(`building graph order, existing package names: ${packageNamesToUpdate}`);
|
|
135
136
|
// invert the graph so it's dependency name => packages that depend on it
|
|
136
137
|
const dependentGraph = this.invertGraph(graph);
|
|
137
138
|
const visited = new Set();
|
|
@@ -79,6 +79,7 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
79
79
|
*/
|
|
80
80
|
getComponent(): Promise<string | undefined>;
|
|
81
81
|
getDefaultComponent(): Promise<string | undefined>;
|
|
82
|
+
protected getBranchComponent(): Promise<string | undefined>;
|
|
82
83
|
getPackageName(): Promise<string | undefined>;
|
|
83
84
|
getDefaultPackageName(): Promise<string | undefined>;
|
|
84
85
|
protected normalizeComponent(component: string | undefined): string;
|
|
@@ -73,6 +73,9 @@ class BaseStrategy {
|
|
|
73
73
|
var _a;
|
|
74
74
|
return this.normalizeComponent((_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName()));
|
|
75
75
|
}
|
|
76
|
+
async getBranchComponent() {
|
|
77
|
+
return this.component || (await this.getDefaultComponent());
|
|
78
|
+
}
|
|
76
79
|
async getPackageName() {
|
|
77
80
|
var _a;
|
|
78
81
|
return (_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName());
|
|
@@ -143,8 +146,9 @@ class BaseStrategy {
|
|
|
143
146
|
const newVersionTag = new tag_name_1.TagName(newVersion, this.includeComponentInTag ? component : undefined, this.tagSeparator, this.includeVInTag);
|
|
144
147
|
logger_1.logger.debug('pull request title pattern:', this.pullRequestTitlePattern);
|
|
145
148
|
const pullRequestTitle = pull_request_title_1.PullRequestTitle.ofComponentTargetBranchVersion(component || '', this.targetBranch, newVersion, this.pullRequestTitlePattern);
|
|
146
|
-
const
|
|
147
|
-
|
|
149
|
+
const branchComponent = await this.getBranchComponent();
|
|
150
|
+
const branchName = branchComponent
|
|
151
|
+
? branch_name_1.BranchName.ofComponentTargetBranch(branchComponent, this.targetBranch)
|
|
148
152
|
: branch_name_1.BranchName.ofTargetBranch(this.targetBranch);
|
|
149
153
|
const releaseNotesBody = await this.buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease, commits);
|
|
150
154
|
if (this.changelogEmpty(releaseNotesBody)) {
|
|
@@ -268,10 +272,11 @@ class BaseStrategy {
|
|
|
268
272
|
let releaseData;
|
|
269
273
|
if (pullRequestBody.releaseData.length === 1 &&
|
|
270
274
|
!pullRequestBody.releaseData[0].component) {
|
|
275
|
+
const branchComponent = await this.getBranchComponent();
|
|
271
276
|
// standalone release PR, ensure the components match
|
|
272
277
|
if (this.normalizeComponent(branchName.component) !==
|
|
273
|
-
this.normalizeComponent(
|
|
274
|
-
logger_1.logger.warn(`PR component: ${branchName.component} does not match configured component: ${
|
|
278
|
+
this.normalizeComponent(branchComponent)) {
|
|
279
|
+
logger_1.logger.warn(`PR component: ${branchName.component} does not match configured component: ${branchComponent}`);
|
|
275
280
|
return;
|
|
276
281
|
}
|
|
277
282
|
releaseData = pullRequestBody.releaseData[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.16.1",
|
|
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",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"gts": "^3.0.0",
|
|
61
61
|
"mocha": "^9.0.0",
|
|
62
62
|
"nock": "^13.0.0",
|
|
63
|
-
"sinon": "
|
|
63
|
+
"sinon": "14.0.0",
|
|
64
64
|
"snap-shot-it": "^7.0.0"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|