release-please 13.4.2 → 13.4.6
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 +31 -0
- package/build/src/manifest.js +0 -4
- package/build/src/plugins/cargo-workspace.d.ts +1 -0
- package/build/src/plugins/cargo-workspace.js +13 -4
- package/build/src/plugins/merge.js +3 -1
- package/build/src/plugins/node-workspace.d.ts +1 -0
- package/build/src/plugins/node-workspace.js +4 -0
- package/build/src/plugins/workspace.d.ts +13 -0
- package/build/src/plugins/workspace.js +2 -0
- package/build/src/strategies/base.d.ts +6 -0
- package/build/src/strategies/base.js +32 -16
- package/build/src/strategies/java-yoshi.d.ts +6 -0
- package/build/src/strategies/java-yoshi.js +23 -0
- package/build/src/strategies/node.js +1 -1
- package/build/src/strategies/php-yoshi.d.ts +1 -1
- package/build/src/strategies/php-yoshi.js +4 -0
- package/build/src/strategies/rust.js +1 -4
- package/build/src/updaters/krm/krm-blueprint-version.js +1 -1
- package/build/src/updaters/rust/cargo-lock.d.ts +5 -2
- package/build/src/updaters/rust/cargo-lock.js +4 -5
- package/build/src/util/pull-request-body.d.ts +2 -0
- package/build/src/util/pull-request-body.js +4 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,37 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
### [13.4.6](https://github.com/googleapis/release-please/compare/v13.4.5...v13.4.6) (2022-02-01)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* cargo workspace cargo lock handling ([#1260](https://github.com/googleapis/release-please/issues/1260)) ([55e9d38](https://github.com/googleapis/release-please/commit/55e9d3822d4d36d3123231f22dccacf35910929e))
|
|
13
|
+
* krm blueprints should update yaml files ([#1269](https://github.com/googleapis/release-please/issues/1269)) ([d6ef98a](https://github.com/googleapis/release-please/commit/d6ef98a7031b599e38a505af2ffc51e85b3c6da6)), closes [#1268](https://github.com/googleapis/release-please/issues/1268)
|
|
14
|
+
|
|
15
|
+
### [13.4.5](https://github.com/googleapis/release-please/compare/v13.4.4...v13.4.5) (2022-02-01)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* read packageName from config ([#1270](https://github.com/googleapis/release-please/issues/1270)) ([e953e1a](https://github.com/googleapis/release-please/commit/e953e1a387f6124fbacb7952b5451ca43bd498fa))
|
|
21
|
+
|
|
22
|
+
### [13.4.4](https://github.com/googleapis/release-please/compare/v13.4.3...v13.4.4) (2022-01-26)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* delegate empty commit handling to strategies ([#1254](https://github.com/googleapis/release-please/issues/1254)) ([757f2a9](https://github.com/googleapis/release-please/commit/757f2a9304aec164632ee081b09d22595c5f1e67))
|
|
28
|
+
* extra file should include strategy path ([#1187](https://github.com/googleapis/release-please/issues/1187)) ([c8fffb0](https://github.com/googleapis/release-please/commit/c8fffb0bca7be83487e9d2e3257277e8650cdfaf))
|
|
29
|
+
|
|
30
|
+
### [13.4.3](https://github.com/googleapis/release-please/compare/v13.4.2...v13.4.3) (2022-01-24)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* multi-component manifest release notes for single component release ([#1247](https://github.com/googleapis/release-please/issues/1247)) ([16aee09](https://github.com/googleapis/release-please/commit/16aee099c79d75853e565f83017745eef13b57fa))
|
|
36
|
+
* release notes should parse initial version heading ([#1248](https://github.com/googleapis/release-please/issues/1248)) ([71dc495](https://github.com/googleapis/release-please/commit/71dc4954e2393f74c4442c021fcf6c8ee530b4ae))
|
|
37
|
+
|
|
7
38
|
### [13.4.2](https://github.com/googleapis/release-please/compare/v13.4.1...v13.4.2) (2022-01-21)
|
|
8
39
|
|
|
9
40
|
|
package/build/src/manifest.js
CHANGED
|
@@ -265,10 +265,6 @@ class Manifest {
|
|
|
265
265
|
logger_1.logger.debug(`type: ${config.releaseType}`);
|
|
266
266
|
logger_1.logger.debug(`targetBranch: ${this.targetBranch}`);
|
|
267
267
|
const pathCommits = commitsAfterSha(path === exports.ROOT_PROJECT_PATH ? commits : commitsPerPath[path], releaseShasByPath[path]);
|
|
268
|
-
if (!pathCommits || pathCommits.length === 0) {
|
|
269
|
-
logger_1.logger.info(`No commits for path: ${path}, skipping`);
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
268
|
logger_1.logger.debug(`commits: ${pathCommits.length}`);
|
|
273
269
|
const latestReleasePullRequest = releasePullRequestsBySha[releaseShasByPath[path]];
|
|
274
270
|
if (!latestReleasePullRequest) {
|
|
@@ -45,6 +45,7 @@ export declare class CargoWorkspace extends WorkspacePlugin<CrateInfo> {
|
|
|
45
45
|
protected bumpVersion(pkg: CrateInfo): Version;
|
|
46
46
|
protected updateCandidate(existingCandidate: CandidateReleasePullRequest, pkg: CrateInfo, updatedVersions: VersionsMap): CandidateReleasePullRequest;
|
|
47
47
|
protected newCandidate(pkg: CrateInfo, updatedVersions: VersionsMap): CandidateReleasePullRequest;
|
|
48
|
+
protected postProcessCandidates(candidates: CandidateReleasePullRequest[], updatedVersions: VersionsMap): CandidateReleasePullRequest[];
|
|
48
49
|
protected buildGraph(allPackages: CrateInfo[]): Promise<DependencyGraph<CrateInfo>>;
|
|
49
50
|
protected inScope(candidate: CandidateReleasePullRequest): boolean;
|
|
50
51
|
protected packageNameFromPackage(pkg: CrateInfo): string;
|
|
@@ -113,10 +113,7 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
113
113
|
update.updater.changelogEntry = appendDependenciesSectionToChangelog(update.updater.changelogEntry, dependencyNotes);
|
|
114
114
|
}
|
|
115
115
|
else if (update.path === addPath(existingCandidate.path, 'Cargo.lock')) {
|
|
116
|
-
update.updater = new cargo_lock_1.CargoLock(
|
|
117
|
-
version,
|
|
118
|
-
versionsMap: updatedVersions,
|
|
119
|
-
});
|
|
116
|
+
update.updater = new cargo_lock_1.CargoLock(updatedVersions);
|
|
120
117
|
}
|
|
121
118
|
return update;
|
|
122
119
|
});
|
|
@@ -186,6 +183,18 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
186
183
|
},
|
|
187
184
|
};
|
|
188
185
|
}
|
|
186
|
+
postProcessCandidates(candidates, updatedVersions) {
|
|
187
|
+
const rootCandidate = candidates.find(c => c.path === manifest_1.ROOT_PROJECT_PATH);
|
|
188
|
+
if (!rootCandidate) {
|
|
189
|
+
throw Error('Unable to find root candidate pull request');
|
|
190
|
+
}
|
|
191
|
+
rootCandidate.pullRequest.updates.push({
|
|
192
|
+
path: 'Cargo.lock',
|
|
193
|
+
createIfMissing: false,
|
|
194
|
+
updater: new cargo_lock_1.CargoLock(updatedVersions),
|
|
195
|
+
});
|
|
196
|
+
return candidates;
|
|
197
|
+
}
|
|
189
198
|
async buildGraph(allPackages) {
|
|
190
199
|
var _a, _b, _c;
|
|
191
200
|
const workspaceCrateNames = new Set(allPackages.map(crateInfo => crateInfo.name));
|
|
@@ -20,6 +20,7 @@ const pull_request_title_1 = require("../util/pull-request-title");
|
|
|
20
20
|
const pull_request_body_1 = require("../util/pull-request-body");
|
|
21
21
|
const branch_name_1 = require("../util/branch-name");
|
|
22
22
|
const composite_1 = require("../updaters/composite");
|
|
23
|
+
const logger_1 = require("../util/logger");
|
|
23
24
|
/**
|
|
24
25
|
* This plugin merges multiple pull requests into a single
|
|
25
26
|
* release pull request.
|
|
@@ -36,6 +37,7 @@ class Merge extends plugin_1.ManifestPlugin {
|
|
|
36
37
|
if (candidates.length < 1) {
|
|
37
38
|
return candidates;
|
|
38
39
|
}
|
|
40
|
+
logger_1.logger.info(`Merging ${candidates.length} pull requests`);
|
|
39
41
|
const releaseData = [];
|
|
40
42
|
const labels = new Set();
|
|
41
43
|
let rawUpdates = [];
|
|
@@ -54,7 +56,7 @@ class Merge extends plugin_1.ManifestPlugin {
|
|
|
54
56
|
const updates = composite_1.mergeUpdates(rawUpdates);
|
|
55
57
|
const pullRequest = {
|
|
56
58
|
title: pull_request_title_1.PullRequestTitle.ofComponentTargetBranchVersion(rootRelease === null || rootRelease === void 0 ? void 0 : rootRelease.pullRequest.title.component, this.targetBranch, rootRelease === null || rootRelease === void 0 ? void 0 : rootRelease.pullRequest.title.version, this.pullRequestTitlePattern),
|
|
57
|
-
body: new pull_request_body_1.PullRequestBody(releaseData),
|
|
59
|
+
body: new pull_request_body_1.PullRequestBody(releaseData, { useComponents: true }),
|
|
58
60
|
updates,
|
|
59
61
|
labels: Array.from(labels),
|
|
60
62
|
headRefName: branch_name_1.BranchName.ofTargetBranch(this.targetBranch).toString(),
|
|
@@ -29,6 +29,7 @@ export declare class NodeWorkspace extends WorkspacePlugin<Package> {
|
|
|
29
29
|
protected bumpVersion(pkg: Package): Version;
|
|
30
30
|
protected updateCandidate(existingCandidate: CandidateReleasePullRequest, pkg: Package, updatedVersions: VersionsMap): CandidateReleasePullRequest;
|
|
31
31
|
protected newCandidate(pkg: Package, updatedVersions: VersionsMap): CandidateReleasePullRequest;
|
|
32
|
+
protected postProcessCandidates(candidates: CandidateReleasePullRequest[], _updatedVersions: VersionsMap): CandidateReleasePullRequest[];
|
|
32
33
|
protected buildGraph(allPackages: Package[]): Promise<DependencyGraph<Package>>;
|
|
33
34
|
protected inScope(candidate: CandidateReleasePullRequest): boolean;
|
|
34
35
|
protected packageNameFromPackage(pkg: Package): string;
|
|
@@ -190,6 +190,10 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
190
190
|
},
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
+
postProcessCandidates(candidates, _updatedVersions) {
|
|
194
|
+
// NOP for node workspaces
|
|
195
|
+
return candidates;
|
|
196
|
+
}
|
|
193
197
|
async buildGraph(allPackages) {
|
|
194
198
|
var _a, _b, _c, _d;
|
|
195
199
|
const graph = new Map();
|
|
@@ -83,6 +83,19 @@ export declare abstract class WorkspacePlugin<T> extends ManifestPlugin {
|
|
|
83
83
|
* @returns {string} The package name.
|
|
84
84
|
*/
|
|
85
85
|
protected abstract packageNameFromPackage(pkg: T): string;
|
|
86
|
+
/**
|
|
87
|
+
* Amend any or all in-scope candidates once all other processing has occured.
|
|
88
|
+
*
|
|
89
|
+
* This gives the workspace plugin once last chance to tweak the pull-requests
|
|
90
|
+
* once all the underlying information has been collated.
|
|
91
|
+
* @param {CandidateReleasePullRequest[]} candidates - The list of candidates
|
|
92
|
+
* once all other workspace processing has occured.
|
|
93
|
+
* @param {VersionMap} updatedVersions - Map containing any component versions
|
|
94
|
+
* that have changed.
|
|
95
|
+
* @returns {CandidateReleasePullRequest[]} potentially amended list of
|
|
96
|
+
* candidates.
|
|
97
|
+
*/
|
|
98
|
+
protected abstract postProcessCandidates(candidates: CandidateReleasePullRequest[], updatedVersions: VersionsMap): CandidateReleasePullRequest[];
|
|
86
99
|
/**
|
|
87
100
|
* Helper to invert the graph from package => packages that it depends on
|
|
88
101
|
* to package => packages that depend on it.
|
|
@@ -98,6 +98,8 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
|
98
98
|
logger_1.logger.info(`Merging ${newCandidates.length} in-scope candidates`);
|
|
99
99
|
const mergePlugin = new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig);
|
|
100
100
|
newCandidates = await mergePlugin.run(newCandidates);
|
|
101
|
+
logger_1.logger.info(`Post-processing ${newCandidates.length} in-scope candidates`);
|
|
102
|
+
newCandidates = this.postProcessCandidates(newCandidates, updatedVersions);
|
|
101
103
|
return [...outOfScopeCandidates, ...newCandidates];
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
@@ -110,5 +110,11 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
110
110
|
* Override this to handle the initial version of a new library.
|
|
111
111
|
*/
|
|
112
112
|
protected initialReleaseVersion(): Version;
|
|
113
|
+
/**
|
|
114
|
+
* Adds a given file path to the strategy path.
|
|
115
|
+
* @param {string} file Desired file path.
|
|
116
|
+
* @returns {string} The file relative to the strategy.
|
|
117
|
+
* @throws {Error} If the file path contains relative pathing characters, i.e. ../, ~/
|
|
118
|
+
*/
|
|
113
119
|
protected addPath(file: string): string;
|
|
114
120
|
}
|
|
@@ -65,7 +65,8 @@ class BaseStrategy {
|
|
|
65
65
|
return this.component || (await this.getDefaultComponent());
|
|
66
66
|
}
|
|
67
67
|
async getDefaultComponent() {
|
|
68
|
-
|
|
68
|
+
var _a;
|
|
69
|
+
return this.normalizeComponent((_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName()));
|
|
69
70
|
}
|
|
70
71
|
async getDefaultPackageName() {
|
|
71
72
|
return '';
|
|
@@ -117,10 +118,17 @@ class BaseStrategy {
|
|
|
117
118
|
* open a pull request.
|
|
118
119
|
*/
|
|
119
120
|
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
|
121
|
+
var _a;
|
|
120
122
|
const conventionalCommits = await this.postProcessCommits(commit_1.parseConventionalCommits(commits));
|
|
121
123
|
logger_1.logger.info(`Considering: ${conventionalCommits.length} commits`);
|
|
124
|
+
if (conventionalCommits.length === 0) {
|
|
125
|
+
logger_1.logger.info(`No commits for path: ${this.path}, skipping`);
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
122
128
|
const newVersion = await this.buildNewVersion(conventionalCommits, latestRelease);
|
|
123
129
|
const versionsMap = await this.updateVersionsMap(await this.buildVersionsMap(conventionalCommits), conventionalCommits);
|
|
130
|
+
this.packageName = (_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName());
|
|
131
|
+
logger_1.logger.debug('packageName', this.packageName);
|
|
124
132
|
const component = await this.getComponent();
|
|
125
133
|
logger_1.logger.debug('component:', component);
|
|
126
134
|
const newVersionTag = new tag_name_1.TagName(newVersion, this.includeComponentInTag ? component : undefined, this.tagSeparator);
|
|
@@ -154,13 +162,11 @@ class BaseStrategy {
|
|
|
154
162
|
}
|
|
155
163
|
extraFileUpdates(version) {
|
|
156
164
|
const genericUpdater = new generic_1.Generic({ version });
|
|
157
|
-
return this.extraFiles.map(path => {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
};
|
|
163
|
-
});
|
|
165
|
+
return this.extraFiles.map(path => ({
|
|
166
|
+
path: this.addPath(path),
|
|
167
|
+
createIfMissing: false,
|
|
168
|
+
updater: genericUpdater,
|
|
169
|
+
}));
|
|
164
170
|
}
|
|
165
171
|
changelogEmpty(changelogEntry) {
|
|
166
172
|
return changelogEntry.split('\n').length <= 1;
|
|
@@ -265,18 +271,28 @@ class BaseStrategy {
|
|
|
265
271
|
initialReleaseVersion() {
|
|
266
272
|
return version_1.Version.parse('1.0.0');
|
|
267
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* Adds a given file path to the strategy path.
|
|
276
|
+
* @param {string} file Desired file path.
|
|
277
|
+
* @returns {string} The file relative to the strategy.
|
|
278
|
+
* @throws {Error} If the file path contains relative pathing characters, i.e. ../, ~/
|
|
279
|
+
*/
|
|
268
280
|
addPath(file) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (this.path === undefined) {
|
|
274
|
-
return file;
|
|
281
|
+
// There is no strategy path to join, the strategy is at the root, or the
|
|
282
|
+
// file is at the root (denoted by a leading slash or tilde)
|
|
283
|
+
if (!this.path || this.path === manifest_1.ROOT_PROJECT_PATH || file.startsWith('/')) {
|
|
284
|
+
file = file.replace(/^\/+/, '');
|
|
275
285
|
}
|
|
286
|
+
// Otherwise, the file is relative to the strategy path
|
|
276
287
|
else {
|
|
277
|
-
|
|
278
|
-
|
|
288
|
+
file = `${this.path.replace(/\/+$/, '')}/${file}`;
|
|
289
|
+
}
|
|
290
|
+
// Ensure the file path does not escape the workspace
|
|
291
|
+
if (/((^|\/)\.{1,2}|^~|^\/*)+\//.test(file)) {
|
|
292
|
+
throw new Error(`illegal pathing characters in path: ${file}`);
|
|
279
293
|
}
|
|
294
|
+
// Strip any trailing slashes and return
|
|
295
|
+
return file.replace(/\/+$/, '');
|
|
280
296
|
}
|
|
281
297
|
}
|
|
282
298
|
exports.BaseStrategy = BaseStrategy;
|
|
@@ -14,6 +14,12 @@ export declare class JavaYoshi extends BaseStrategy {
|
|
|
14
14
|
constructor(options: BaseStrategyOptions);
|
|
15
15
|
buildReleasePullRequest(commits: Commit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest | undefined>;
|
|
16
16
|
private buildSnapshotPullRequest;
|
|
17
|
+
/**
|
|
18
|
+
* Override this method to post process commits
|
|
19
|
+
* @param {ConventionalCommit[]} commits parsed commits
|
|
20
|
+
* @returns {ConventionalCommit[]} modified commits
|
|
21
|
+
*/
|
|
22
|
+
protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
|
|
17
23
|
private needsSnapshot;
|
|
18
24
|
protected buildVersionsMap(): Promise<VersionsMap>;
|
|
19
25
|
protected getVersionsContent(): Promise<GitHubFileContents>;
|
|
@@ -102,6 +102,29 @@ class JavaYoshi extends base_1.BaseStrategy {
|
|
|
102
102
|
draft: false,
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Override this method to post process commits
|
|
107
|
+
* @param {ConventionalCommit[]} commits parsed commits
|
|
108
|
+
* @returns {ConventionalCommit[]} modified commits
|
|
109
|
+
*/
|
|
110
|
+
async postProcessCommits(commits) {
|
|
111
|
+
if (commits.length === 0) {
|
|
112
|
+
// For Java commits, push a fake commit so we force a
|
|
113
|
+
// SNAPSHOT release
|
|
114
|
+
commits.push({
|
|
115
|
+
type: 'fake',
|
|
116
|
+
bareMessage: 'fake commit',
|
|
117
|
+
message: 'fake commit',
|
|
118
|
+
breaking: false,
|
|
119
|
+
scope: null,
|
|
120
|
+
notes: [],
|
|
121
|
+
files: [],
|
|
122
|
+
references: [],
|
|
123
|
+
sha: 'fake',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return commits;
|
|
127
|
+
}
|
|
105
128
|
async needsSnapshot() {
|
|
106
129
|
return versions_manifest_1.VersionsManifest.needsSnapshot((await this.getVersionsContent()).parsedContent);
|
|
107
130
|
}
|
|
@@ -23,7 +23,7 @@ class Node extends base_1.BaseStrategy {
|
|
|
23
23
|
async buildUpdates(options) {
|
|
24
24
|
const updates = [];
|
|
25
25
|
const version = options.newVersion;
|
|
26
|
-
const packageName = this.
|
|
26
|
+
const packageName = this.packageName || '';
|
|
27
27
|
const lockFiles = ['package-lock.json', 'npm-shrinkwrap.json'];
|
|
28
28
|
lockFiles.forEach(lockFile => {
|
|
29
29
|
updates.push({
|
|
@@ -6,7 +6,7 @@ import { ReleasePullRequest } from '../release-pull-request';
|
|
|
6
6
|
import { PullRequestBody } from '../util/pull-request-body';
|
|
7
7
|
export declare class PHPYoshi extends BaseStrategy {
|
|
8
8
|
constructor(options: BaseStrategyOptions);
|
|
9
|
-
buildReleasePullRequest(commits: Commit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest>;
|
|
9
|
+
buildReleasePullRequest(commits: Commit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest | undefined>;
|
|
10
10
|
protected parsePullRequestBody(pullRequestBody: string): Promise<PullRequestBody | undefined>;
|
|
11
11
|
protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
|
|
12
12
|
}
|
|
@@ -51,6 +51,10 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
51
51
|
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
|
52
52
|
var _a, _b, _c;
|
|
53
53
|
const conventionalCommits = await this.postProcessCommits(commit_1.parseConventionalCommits(commits));
|
|
54
|
+
if (conventionalCommits.length === 0) {
|
|
55
|
+
logger_1.logger.info(`No commits for path: ${this.path}, skipping`);
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
54
58
|
const newVersion = latestRelease
|
|
55
59
|
? await this.versioningStrategy.bump(latestRelease.tag.version, conventionalCommits)
|
|
56
60
|
: this.initialReleaseVersion();
|
|
@@ -102,10 +102,7 @@ class Rust extends base_1.BaseStrategy {
|
|
|
102
102
|
updates.push({
|
|
103
103
|
path: this.addPath('Cargo.lock'),
|
|
104
104
|
createIfMissing: false,
|
|
105
|
-
updater: new cargo_lock_1.CargoLock(
|
|
106
|
-
version,
|
|
107
|
-
versionsMap,
|
|
108
|
-
}),
|
|
105
|
+
updater: new cargo_lock_1.CargoLock(versionsMap),
|
|
109
106
|
});
|
|
110
107
|
return updates;
|
|
111
108
|
}
|
|
@@ -32,7 +32,7 @@ class KRMBlueprintVersion extends default_1.DefaultUpdater {
|
|
|
32
32
|
let matchRegex = '(cnrm/.*/)(v[0-9]+.[0-9]+.[0-9]+)+(-w+)?';
|
|
33
33
|
// if explicit previous version, match only that version
|
|
34
34
|
if ((_a = this.versionsMap) === null || _a === void 0 ? void 0 : _a.has('previousVersion')) {
|
|
35
|
-
matchRegex = `(cnrm/.*/)(${this.versionsMap.get('previousVersion')})+(-w+)?`;
|
|
35
|
+
matchRegex = `(cnrm/.*/)(v${this.versionsMap.get('previousVersion')})+(-w+)?`;
|
|
36
36
|
}
|
|
37
37
|
const oldVersion = content.match(new RegExp(matchRegex));
|
|
38
38
|
if (oldVersion) {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Updater } from '../../update';
|
|
2
|
+
import { VersionsMap } from '../../version';
|
|
2
3
|
/**
|
|
3
4
|
* Updates `Cargo.lock` lockfiles, preserving formatting and comments.
|
|
4
5
|
*/
|
|
5
|
-
export declare class CargoLock
|
|
6
|
+
export declare class CargoLock implements Updater {
|
|
7
|
+
versionsMap: VersionsMap;
|
|
8
|
+
constructor(versionsMap: VersionsMap);
|
|
6
9
|
/**
|
|
7
10
|
* Given initial file contents, return updated contents.
|
|
8
11
|
* @param {string} content The initial content
|
|
@@ -17,11 +17,13 @@ exports.CargoLock = void 0;
|
|
|
17
17
|
const toml_edit_1 = require("../../util/toml-edit");
|
|
18
18
|
const common_1 = require("./common");
|
|
19
19
|
const logger_1 = require("../../util/logger");
|
|
20
|
-
const default_1 = require("../default");
|
|
21
20
|
/**
|
|
22
21
|
* Updates `Cargo.lock` lockfiles, preserving formatting and comments.
|
|
23
22
|
*/
|
|
24
|
-
class CargoLock
|
|
23
|
+
class CargoLock {
|
|
24
|
+
constructor(versionsMap) {
|
|
25
|
+
this.versionsMap = versionsMap;
|
|
26
|
+
}
|
|
25
27
|
/**
|
|
26
28
|
* Given initial file contents, return updated contents.
|
|
27
29
|
* @param {string} content The initial content
|
|
@@ -29,9 +31,6 @@ class CargoLock extends default_1.DefaultUpdater {
|
|
|
29
31
|
*/
|
|
30
32
|
updateContent(content) {
|
|
31
33
|
let payload = content;
|
|
32
|
-
if (!this.versionsMap) {
|
|
33
|
-
throw new Error('updateContent called with no versions');
|
|
34
|
-
}
|
|
35
34
|
const parsed = common_1.parseCargoLockfile(payload);
|
|
36
35
|
if (!parsed.package) {
|
|
37
36
|
logger_1.logger.error('is not a Cargo lockfile');
|
|
@@ -3,12 +3,14 @@ interface PullRequestBodyOptions {
|
|
|
3
3
|
header?: string;
|
|
4
4
|
footer?: string;
|
|
5
5
|
extra?: string;
|
|
6
|
+
useComponents?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare class PullRequestBody {
|
|
8
9
|
header: string;
|
|
9
10
|
footer: string;
|
|
10
11
|
extra?: string;
|
|
11
12
|
releaseData: ReleaseData[];
|
|
13
|
+
useComponents: boolean;
|
|
12
14
|
constructor(releaseData: ReleaseData[], options?: PullRequestBodyOptions);
|
|
13
15
|
static parse(body: string): PullRequestBody | undefined;
|
|
14
16
|
notes(): string;
|
|
@@ -22,10 +22,12 @@ const DEFAULT_FOOTER = 'This PR was generated with [Release Please](https://gith
|
|
|
22
22
|
const NOTES_DELIMITER = '---';
|
|
23
23
|
class PullRequestBody {
|
|
24
24
|
constructor(releaseData, options) {
|
|
25
|
+
var _a;
|
|
25
26
|
this.header = (options === null || options === void 0 ? void 0 : options.header) || DEFAULT_HEADER;
|
|
26
27
|
this.footer = (options === null || options === void 0 ? void 0 : options.footer) || DEFAULT_FOOTER;
|
|
27
28
|
this.extra = options === null || options === void 0 ? void 0 : options.extra;
|
|
28
29
|
this.releaseData = releaseData;
|
|
30
|
+
this.useComponents = (_a = options === null || options === void 0 ? void 0 : options.useComponents) !== null && _a !== void 0 ? _a : this.releaseData.length > 1;
|
|
29
31
|
}
|
|
30
32
|
static parse(body) {
|
|
31
33
|
const parts = splitBody(body);
|
|
@@ -46,7 +48,7 @@ class PullRequestBody {
|
|
|
46
48
|
});
|
|
47
49
|
}
|
|
48
50
|
notes() {
|
|
49
|
-
if (this.
|
|
51
|
+
if (this.useComponents) {
|
|
50
52
|
return this.releaseData
|
|
51
53
|
.map(release => {
|
|
52
54
|
var _a;
|
|
@@ -110,7 +112,7 @@ function extractMultipleReleases(notes) {
|
|
|
110
112
|
}
|
|
111
113
|
return data;
|
|
112
114
|
}
|
|
113
|
-
const COMPARE_REGEX = /^#{2,} \[(?<version>\d+\.\d+\.\d+.*)\]
|
|
115
|
+
const COMPARE_REGEX = /^#{2,} \[?(?<version>\d+\.\d+\.\d+.*)\]?/;
|
|
114
116
|
function extractSingleRelease(body) {
|
|
115
117
|
var _a;
|
|
116
118
|
body = body.trim();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.6",
|
|
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",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"gts": "^3.0.0",
|
|
54
54
|
"mocha": "^9.0.0",
|
|
55
55
|
"nock": "^13.0.0",
|
|
56
|
-
"sinon": "
|
|
56
|
+
"sinon": "13.0.0",
|
|
57
57
|
"snap-shot-it": "^7.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|