release-please 14.15.0 → 14.15.2
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/plugins/cargo-workspace.js +36 -15
- package/build/src/plugins/maven-workspace.d.ts +7 -0
- package/build/src/plugins/maven-workspace.js +15 -2
- package/build/src/plugins/workspace.d.ts +6 -0
- package/build/src/plugins/workspace.js +11 -1
- package/build/src/util/commit-split.js +2 -8
- package/package.json +1 -1
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
|
+
## [14.15.2](https://github.com/googleapis/release-please/compare/v14.15.1...v14.15.2) (2022-11-01)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* Allow overlapping paths when splitting commits ([#1733](https://github.com/googleapis/release-please/issues/1733)) ([adcb99a](https://github.com/googleapis/release-please/commit/adcb99acdbff9ddeea527b673bc8820edff68f2a))
|
|
13
|
+
* **cargo-workspace:** Update target dependencies in Cargo workspace packages ([#1730](https://github.com/googleapis/release-please/issues/1730)) ([3ca3bbc](https://github.com/googleapis/release-please/commit/3ca3bbcef729a359805473fdc798b5af5ab22861))
|
|
14
|
+
|
|
15
|
+
## [14.15.1](https://github.com/googleapis/release-please/compare/v14.15.0...v14.15.1) (2022-10-28)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **maven-workspace:** SNAPSHOT versions should not be included in the manifest ([#1727](https://github.com/googleapis/release-please/issues/1727)) ([d926c84](https://github.com/googleapis/release-please/commit/d926c840ec99de013a0b5cb198f9fb2700930cf7))
|
|
21
|
+
|
|
7
22
|
## [14.15.0](https://github.com/googleapis/release-please/compare/v14.14.0...v14.15.0) (2022-10-27)
|
|
8
23
|
|
|
9
24
|
|
|
@@ -195,7 +195,7 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
195
195
|
return candidates;
|
|
196
196
|
}
|
|
197
197
|
async buildGraph(allPackages) {
|
|
198
|
-
var _a, _b, _c;
|
|
198
|
+
var _a, _b, _c, _d, _e, _f;
|
|
199
199
|
const workspaceCrateNames = new Set(allPackages.map(crateInfo => crateInfo.name));
|
|
200
200
|
const graph = new Map();
|
|
201
201
|
for (const crateInfo of allPackages) {
|
|
@@ -204,6 +204,17 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
204
204
|
...((_b = crateInfo.manifest['dev-dependencies']) !== null && _b !== void 0 ? _b : {}),
|
|
205
205
|
...((_c = crateInfo.manifest['build-dependencies']) !== null && _c !== void 0 ? _c : {}),
|
|
206
206
|
});
|
|
207
|
+
const targets = crateInfo.manifest.target;
|
|
208
|
+
if (targets) {
|
|
209
|
+
for (const targetName in targets) {
|
|
210
|
+
const target = targets[targetName];
|
|
211
|
+
allDeps.push(...Object.keys({
|
|
212
|
+
...((_d = target.dependencies) !== null && _d !== void 0 ? _d : {}),
|
|
213
|
+
...((_e = target['dev-dependencies']) !== null && _e !== void 0 ? _e : {}),
|
|
214
|
+
...((_f = target['build-dependencies']) !== null && _f !== void 0 ? _f : {}),
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
207
218
|
const workspaceDeps = allDeps.filter(dep => workspaceCrateNames.has(dep));
|
|
208
219
|
graph.set(crateInfo.name, {
|
|
209
220
|
deps: workspaceDeps,
|
|
@@ -224,7 +235,6 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
224
235
|
}
|
|
225
236
|
exports.CargoWorkspace = CargoWorkspace;
|
|
226
237
|
function getChangelogDepsNotes(originalManifest, updatedManifest) {
|
|
227
|
-
var _a;
|
|
228
238
|
let depUpdateNotes = '';
|
|
229
239
|
const depTypes = [
|
|
230
240
|
'dependencies',
|
|
@@ -252,21 +262,32 @@ function getChangelogDepsNotes(originalManifest, updatedManifest) {
|
|
|
252
262
|
}
|
|
253
263
|
return result;
|
|
254
264
|
};
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
265
|
+
const populateUpdates = (originalScope, updatedScope, updates) => {
|
|
266
|
+
var _a;
|
|
267
|
+
for (const depType of depTypes) {
|
|
268
|
+
const depUpdates = [];
|
|
269
|
+
const pkgDepTypes = updatedScope[depType];
|
|
270
|
+
if (pkgDepTypes === undefined) {
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
for (const [depName, currentDepVer] of Object.entries(getDepMap(pkgDepTypes))) {
|
|
274
|
+
const origDepVer = depVer((_a = originalScope[depType]) === null || _a === void 0 ? void 0 : _a[depName]);
|
|
275
|
+
if (currentDepVer !== origDepVer) {
|
|
276
|
+
depUpdates.push(`\n * ${depName} bumped from ${origDepVer} to ${currentDepVer}`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (depUpdates.length > 0) {
|
|
280
|
+
const updatesForType = updates.get(depType) || new Set();
|
|
281
|
+
depUpdates.forEach(update => updatesForType.add(update));
|
|
282
|
+
updates.set(depType, updatesForType);
|
|
266
283
|
}
|
|
267
284
|
}
|
|
268
|
-
|
|
269
|
-
|
|
285
|
+
};
|
|
286
|
+
const updates = new Map();
|
|
287
|
+
populateUpdates(originalManifest, updatedManifest, updates);
|
|
288
|
+
if (updatedManifest.target && originalManifest.target) {
|
|
289
|
+
for (const targetName in updatedManifest.target) {
|
|
290
|
+
populateUpdates(originalManifest.target[targetName], updatedManifest.target[targetName], updates);
|
|
270
291
|
}
|
|
271
292
|
}
|
|
272
293
|
for (const [dt, notes] of updates) {
|
|
@@ -63,6 +63,13 @@ export declare class MavenWorkspace extends WorkspacePlugin<MavenArtifact> {
|
|
|
63
63
|
updatedPathVersions: VersionsMap;
|
|
64
64
|
}>;
|
|
65
65
|
protected buildGraph(allPackages: MavenArtifact[]): Promise<DependencyGraph<MavenArtifact>>;
|
|
66
|
+
/**
|
|
67
|
+
* Given a release version, determine if we should bump the manifest
|
|
68
|
+
* version as well. For maven artifacts, SNAPSHOT versions are not
|
|
69
|
+
* considered releases.
|
|
70
|
+
* @param {Version} version The release version
|
|
71
|
+
*/
|
|
72
|
+
protected isReleaseVersion(version: Version): boolean;
|
|
66
73
|
protected bumpVersion(artifact: MavenArtifact): Version;
|
|
67
74
|
protected updateCandidate(existingCandidate: CandidateReleasePullRequest, artifact: MavenArtifact, updatedVersions: VersionsMap): CandidateReleasePullRequest;
|
|
68
75
|
protected newCandidate(artifact: MavenArtifact, updatedVersions: VersionsMap): CandidateReleasePullRequest;
|
|
@@ -155,7 +155,8 @@ class MavenWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
155
155
|
this.logger.warn(`${pomUpdate.path} does not have cached contents`);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
if (candidate.pullRequest.version
|
|
158
|
+
if (candidate.pullRequest.version &&
|
|
159
|
+
this.isReleaseVersion(candidate.pullRequest.version)) {
|
|
159
160
|
updatedPathVersions.set(candidate.path, candidate.pullRequest.version);
|
|
160
161
|
}
|
|
161
162
|
}
|
|
@@ -176,7 +177,9 @@ class MavenWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
176
177
|
else {
|
|
177
178
|
this.logger.debug(`version: ${version} forced bump`);
|
|
178
179
|
updatedVersions.set(packageName, version);
|
|
179
|
-
|
|
180
|
+
if (this.isReleaseVersion(version)) {
|
|
181
|
+
updatedPathVersions.set(this.pathFromPackage(pkg), version);
|
|
182
|
+
}
|
|
180
183
|
}
|
|
181
184
|
}
|
|
182
185
|
}
|
|
@@ -207,6 +210,16 @@ class MavenWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
207
210
|
}
|
|
208
211
|
return graph;
|
|
209
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Given a release version, determine if we should bump the manifest
|
|
215
|
+
* version as well. For maven artifacts, SNAPSHOT versions are not
|
|
216
|
+
* considered releases.
|
|
217
|
+
* @param {Version} version The release version
|
|
218
|
+
*/
|
|
219
|
+
isReleaseVersion(version) {
|
|
220
|
+
var _a;
|
|
221
|
+
return !((_a = version.preRelease) === null || _a === void 0 ? void 0 : _a.includes('SNAPSHOT'));
|
|
222
|
+
}
|
|
210
223
|
bumpVersion(artifact) {
|
|
211
224
|
const strategy = new java_snapshot_1.JavaSnapshot(new always_bump_patch_1.AlwaysBumpPatch());
|
|
212
225
|
return strategy.bump(version_1.Version.parse(artifact.version), [FAKE_COMMIT]);
|
|
@@ -74,6 +74,12 @@ export declare abstract class WorkspacePlugin<T> extends ManifestPlugin {
|
|
|
74
74
|
updatedVersions: VersionsMap;
|
|
75
75
|
updatedPathVersions: VersionsMap;
|
|
76
76
|
}>;
|
|
77
|
+
/**
|
|
78
|
+
* Given a release version, determine if we should bump the manifest
|
|
79
|
+
* version as well.
|
|
80
|
+
* @param {Version} _version The release version
|
|
81
|
+
*/
|
|
82
|
+
protected isReleaseVersion(_version: Version): boolean;
|
|
77
83
|
/**
|
|
78
84
|
* Given a package, return the new bumped version after updating
|
|
79
85
|
* the dependency.
|
|
@@ -173,7 +173,9 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
|
173
173
|
const version = this.bumpVersion(pkg);
|
|
174
174
|
this.logger.debug(`version: ${version} forced bump`);
|
|
175
175
|
updatedVersions.set(packageName, version);
|
|
176
|
-
|
|
176
|
+
if (this.isReleaseVersion(version)) {
|
|
177
|
+
updatedPathVersions.set(this.pathFromPackage(pkg), version);
|
|
178
|
+
}
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
181
|
return {
|
|
@@ -181,6 +183,14 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
|
181
183
|
updatedPathVersions,
|
|
182
184
|
};
|
|
183
185
|
}
|
|
186
|
+
/**
|
|
187
|
+
* Given a release version, determine if we should bump the manifest
|
|
188
|
+
* version as well.
|
|
189
|
+
* @param {Version} _version The release version
|
|
190
|
+
*/
|
|
191
|
+
isReleaseVersion(_version) {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
184
194
|
/**
|
|
185
195
|
* Helper to invert the graph from package => packages that it depends on
|
|
186
196
|
* to package => packages that depend on it.
|
|
@@ -41,19 +41,13 @@ class CommitSplit {
|
|
|
41
41
|
newPath = newPath.replace(/^\//, '');
|
|
42
42
|
newPath = newPath.replace(/$/, '/');
|
|
43
43
|
newPath = newPath.replace(/^/, '/');
|
|
44
|
-
for (let exPath of paths) {
|
|
45
|
-
exPath = exPath.replace(/$/, '/');
|
|
46
|
-
exPath = exPath.replace(/^/, '/');
|
|
47
|
-
if (newPath.startsWith(exPath) || exPath.startsWith(newPath)) {
|
|
48
|
-
throw new Error(`Path prefixes must be unique: ${newPath}, ${exPath}`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
44
|
// store them with leading and trailing slashes removed.
|
|
52
45
|
newPath = newPath.replace(/\/$/, '');
|
|
53
46
|
newPath = newPath.replace(/^\//, '');
|
|
54
47
|
paths.push(newPath);
|
|
55
48
|
}
|
|
56
|
-
|
|
49
|
+
// sort by longest paths first
|
|
50
|
+
this.packagePaths = paths.sort((a, b) => b.length - a.length);
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
53
|
/**
|
package/package.json
CHANGED