release-please 13.4.5 → 13.4.9
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 +35 -0
- package/build/src/factory.js +1 -0
- package/build/src/github.js +27 -8
- package/build/src/manifest.d.ts +4 -0
- package/build/src/manifest.js +56 -5
- package/build/src/plugins/cargo-workspace.d.ts +1 -0
- package/build/src/plugins/cargo-workspace.js +13 -4
- 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 +2 -1
- package/build/src/strategies/base.js +21 -9
- package/build/src/strategies/go-yoshi.js +0 -4
- package/build/src/strategies/node.js +2 -1
- package/build/src/strategies/php-yoshi.js +1 -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/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,41 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
### [13.4.9](https://github.com/googleapis/release-please/compare/v13.4.8...v13.4.9) (2022-02-14)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* standalone releases should only be released by its matching component ([#1296](https://github.com/googleapis/release-please/issues/1296)) ([75dd686](https://github.com/googleapis/release-please/commit/75dd686a667da397b54498f543128d4cc6bb784e))
|
|
13
|
+
|
|
14
|
+
### [13.4.8](https://github.com/googleapis/release-please/compare/v13.4.7...v13.4.8) (2022-02-08)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* allow configuring includeComponentInTag and tagSeparator from manifest config ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
|
|
20
|
+
* check recent commits and latest releases for latest version ([#1267](https://github.com/googleapis/release-please/issues/1267)) ([f931842](https://github.com/googleapis/release-please/commit/f931842a117c97dd117f161c89beb1c9e2257fa2))
|
|
21
|
+
* correctly fetch full list of files ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
|
|
22
|
+
* **go-yoshi:** allows using go-yoshi with manifest ([#1287](https://github.com/googleapis/release-please/issues/1287)) ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
|
|
23
|
+
* **go-yoshi:** should not always skip modules ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
|
|
24
|
+
* Manifest should be able to find tagged versions without a release ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
|
|
25
|
+
* provide pull request to commit parser allow overrides ([#1285](https://github.com/googleapis/release-please/issues/1285)) ([e54028b](https://github.com/googleapis/release-please/commit/e54028bb39c4535f42b0b90c60b7f331847d005c))
|
|
26
|
+
|
|
27
|
+
### [13.4.7](https://github.com/googleapis/release-please/compare/v13.4.6...v13.4.7) (2022-02-02)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* php-yoshi strategy should handle custom changelog secctions ([#1277](https://github.com/googleapis/release-please/issues/1277)) ([bd74a5b](https://github.com/googleapis/release-please/commit/bd74a5b7b622a6cec0d64cbf9b9e01102dc835b2))
|
|
33
|
+
|
|
34
|
+
### [13.4.6](https://github.com/googleapis/release-please/compare/v13.4.5...v13.4.6) (2022-02-01)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
* cargo workspace cargo lock handling ([#1260](https://github.com/googleapis/release-please/issues/1260)) ([55e9d38](https://github.com/googleapis/release-please/commit/55e9d3822d4d36d3123231f22dccacf35910929e))
|
|
40
|
+
* 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)
|
|
41
|
+
|
|
7
42
|
### [13.4.5](https://github.com/googleapis/release-please/compare/v13.4.4...v13.4.5) (2022-02-01)
|
|
8
43
|
|
|
9
44
|
|
package/build/src/factory.js
CHANGED
|
@@ -123,6 +123,7 @@ async function buildStrategy(options) {
|
|
|
123
123
|
changelogNotes,
|
|
124
124
|
pullRequestTitlePattern: options.pullRequestTitlePattern,
|
|
125
125
|
extraFiles: options.extraFiles,
|
|
126
|
+
tagSeparator: options.tagSeparator,
|
|
126
127
|
};
|
|
127
128
|
switch (options.releaseType) {
|
|
128
129
|
case 'ruby': {
|
package/build/src/github.js
CHANGED
|
@@ -37,13 +37,25 @@ class GitHub {
|
|
|
37
37
|
*/
|
|
38
38
|
this.getCommitFiles = wrapAsync(async (sha) => {
|
|
39
39
|
logger_1.logger.debug(`Backfilling file list for commit: ${sha}`);
|
|
40
|
-
const
|
|
40
|
+
const files = [];
|
|
41
|
+
for await (const resp of this.octokit.paginate.iterator(this.octokit.repos.getCommit, {
|
|
41
42
|
owner: this.repository.owner,
|
|
42
43
|
repo: this.repository.repo,
|
|
43
44
|
ref: sha,
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
})) {
|
|
46
|
+
for (const f of resp.data.files || []) {
|
|
47
|
+
if (f.filename) {
|
|
48
|
+
files.push(f.filename);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (files.length >= 3000) {
|
|
53
|
+
logger_1.logger.warn(`Found ${files.length} files. This may not include all the files.`);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
logger_1.logger.debug(`Found ${files.length} files`);
|
|
57
|
+
}
|
|
58
|
+
return files;
|
|
47
59
|
});
|
|
48
60
|
this.graphqlRequest = wrapAsync(async (opts, maxRetries = 1) => {
|
|
49
61
|
while (maxRetries >= 0) {
|
|
@@ -509,6 +521,7 @@ class GitHub {
|
|
|
509
521
|
}
|
|
510
522
|
}
|
|
511
523
|
async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
|
|
524
|
+
var _a;
|
|
512
525
|
logger_1.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
|
|
513
526
|
const response = await this.graphqlRequest({
|
|
514
527
|
query: `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
|
|
@@ -562,7 +575,7 @@ class GitHub {
|
|
|
562
575
|
repo: this.repository.repo,
|
|
563
576
|
num: 25,
|
|
564
577
|
targetBranch,
|
|
565
|
-
maxFilesChanged:
|
|
578
|
+
maxFilesChanged: 100,
|
|
566
579
|
});
|
|
567
580
|
// if the branch does exist, return null
|
|
568
581
|
if (!response.repository.ref) {
|
|
@@ -592,9 +605,15 @@ class GitHub {
|
|
|
592
605
|
labels: pullRequest.labels.nodes.map(node => node.name),
|
|
593
606
|
files,
|
|
594
607
|
};
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
608
|
+
if (((_a = pullRequest.files.pageInfo) === null || _a === void 0 ? void 0 : _a.hasNextPage) && options.backfillFiles) {
|
|
609
|
+
logger_1.logger.info(`PR #${pullRequest.number} has many files, backfilling`);
|
|
610
|
+
commit.files = await this.getCommitFiles(graphCommit.sha);
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
// We cannot directly fetch files on commits via graphql, only provide file
|
|
614
|
+
// information for commits with associated pull requests
|
|
615
|
+
commit.files = files;
|
|
616
|
+
}
|
|
598
617
|
}
|
|
599
618
|
else if (options.backfillFiles) {
|
|
600
619
|
// In this case, there is no squashed merge commit. This could be a simple
|
package/build/src/manifest.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface ReleaserConfig {
|
|
|
22
22
|
packageName?: string;
|
|
23
23
|
includeComponentInTag?: boolean;
|
|
24
24
|
pullRequestTitlePattern?: string;
|
|
25
|
+
tagSeparator?: string;
|
|
25
26
|
changelogSections?: ChangelogSection[];
|
|
26
27
|
changelogPath?: string;
|
|
27
28
|
changelogType?: ChangelogNotesType;
|
|
@@ -54,6 +55,7 @@ interface ReleaserConfigJson {
|
|
|
54
55
|
'include-component-in-tag'?: boolean;
|
|
55
56
|
'changelog-type'?: ChangelogNotesType;
|
|
56
57
|
'pull-request-title-pattern'?: string;
|
|
58
|
+
'tag-separator'?: string;
|
|
57
59
|
'version-file'?: string;
|
|
58
60
|
'extra-files'?: string[];
|
|
59
61
|
}
|
|
@@ -196,6 +198,8 @@ export declare class Manifest {
|
|
|
196
198
|
* @returns {ReleasePullRequest[]} The candidate pull requests to open or update.
|
|
197
199
|
*/
|
|
198
200
|
buildPullRequests(): Promise<ReleasePullRequest[]>;
|
|
201
|
+
private backfillReleasesFromTags;
|
|
202
|
+
private getAllTags;
|
|
199
203
|
/**
|
|
200
204
|
* Opens/updates all candidate release pull requests for this repository.
|
|
201
205
|
*
|
package/build/src/manifest.js
CHANGED
|
@@ -166,7 +166,6 @@ class Manifest {
|
|
|
166
166
|
for await (const release of this.github.releaseIterator({
|
|
167
167
|
maxResults: 400,
|
|
168
168
|
})) {
|
|
169
|
-
// logger.debug(release);
|
|
170
169
|
const tagName = tag_name_1.TagName.parse(release.tagName);
|
|
171
170
|
if (!tagName) {
|
|
172
171
|
logger_1.logger.warn(`Unable to parse release name: ${release.name}`);
|
|
@@ -199,6 +198,18 @@ class Manifest {
|
|
|
199
198
|
}
|
|
200
199
|
}
|
|
201
200
|
const needsBootstrap = releasesFound < expectedReleases;
|
|
201
|
+
if (releasesFound < expectedReleases) {
|
|
202
|
+
logger_1.logger.warn(`Expected ${expectedReleases} releases, only found ${releasesFound}`);
|
|
203
|
+
// Fall back to looking for missing releases using expected tags
|
|
204
|
+
const missingPaths = Object.keys(strategiesByPath).filter(path => !releasesByPath[path]);
|
|
205
|
+
logger_1.logger.warn(`Missing ${missingPaths.length} paths: ${missingPaths}`);
|
|
206
|
+
const missingReleases = await this.backfillReleasesFromTags(missingPaths, strategiesByPath);
|
|
207
|
+
for (const path in missingReleases) {
|
|
208
|
+
releaseShasByPath[path] = missingReleases[path].sha;
|
|
209
|
+
releasesByPath[path] = missingReleases[path];
|
|
210
|
+
releasesFound++;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
202
213
|
if (releasesFound < expectedReleases) {
|
|
203
214
|
logger_1.logger.warn(`Expected ${expectedReleases} releases, only found ${releasesFound}`);
|
|
204
215
|
}
|
|
@@ -246,6 +257,7 @@ class Manifest {
|
|
|
246
257
|
sha: commit.sha,
|
|
247
258
|
message: commit.message,
|
|
248
259
|
files: commit.files,
|
|
260
|
+
pullRequest: commit.pullRequest,
|
|
249
261
|
});
|
|
250
262
|
}
|
|
251
263
|
if (releaseCommitsFound < expectedShas) {
|
|
@@ -322,6 +334,38 @@ class Manifest {
|
|
|
322
334
|
}
|
|
323
335
|
return newReleasePullRequests.map(pullRequestWithConfig => pullRequestWithConfig.pullRequest);
|
|
324
336
|
}
|
|
337
|
+
async backfillReleasesFromTags(missingPaths, strategiesByPath) {
|
|
338
|
+
const releasesByPath = {};
|
|
339
|
+
const allTags = await this.getAllTags();
|
|
340
|
+
for (const path of missingPaths) {
|
|
341
|
+
const expectedVersion = this.releasedVersions[path];
|
|
342
|
+
if (!expectedVersion) {
|
|
343
|
+
logger_1.logger.warn(`No version for path ${path}`);
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
const component = await strategiesByPath[path].getComponent();
|
|
347
|
+
const expectedTag = new tag_name_1.TagName(expectedVersion, component, this.repositoryConfig[path].tagSeparator);
|
|
348
|
+
logger_1.logger.debug(`looking for tagName: ${expectedTag.toString()}`);
|
|
349
|
+
const foundTag = allTags[expectedTag.toString()];
|
|
350
|
+
if (foundTag) {
|
|
351
|
+
logger_1.logger.debug(`found: ${foundTag.name} ${foundTag.sha}`);
|
|
352
|
+
releasesByPath[path] = {
|
|
353
|
+
name: foundTag.name,
|
|
354
|
+
tag: expectedTag,
|
|
355
|
+
sha: foundTag.sha,
|
|
356
|
+
notes: '',
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return releasesByPath;
|
|
361
|
+
}
|
|
362
|
+
async getAllTags() {
|
|
363
|
+
const allTags = {};
|
|
364
|
+
for await (const tag of this.github.tagIterator()) {
|
|
365
|
+
allTags[tag.name] = tag;
|
|
366
|
+
}
|
|
367
|
+
return allTags;
|
|
368
|
+
}
|
|
325
369
|
/**
|
|
326
370
|
* Opens/updates all candidate release pull requests for this repository.
|
|
327
371
|
*
|
|
@@ -567,6 +611,7 @@ function extractReleaserConfig(config) {
|
|
|
567
611
|
includeComponentInTag: config['include-component-in-tag'],
|
|
568
612
|
changelogType: config['changelog-type'],
|
|
569
613
|
pullRequestTitlePattern: config['pull-request-title-pattern'],
|
|
614
|
+
tagSeparator: config['tag-separator'],
|
|
570
615
|
};
|
|
571
616
|
}
|
|
572
617
|
/**
|
|
@@ -628,6 +673,7 @@ async function latestReleaseVersion(github, targetBranch, prefix, pullRequestTit
|
|
|
628
673
|
// collect set of recent commit SHAs seen to verify that the release
|
|
629
674
|
// is in the current branch
|
|
630
675
|
const commitShas = new Set();
|
|
676
|
+
const candidateReleaseVersions = [];
|
|
631
677
|
// only look at the last 250 or so commits to find the latest tag - we
|
|
632
678
|
// don't want to scan the entire repository history if this repo has never
|
|
633
679
|
// been released
|
|
@@ -656,12 +702,15 @@ async function latestReleaseVersion(github, targetBranch, prefix, pullRequestTit
|
|
|
656
702
|
// FIXME, don't hardcode this
|
|
657
703
|
continue;
|
|
658
704
|
}
|
|
659
|
-
|
|
705
|
+
if (version) {
|
|
706
|
+
logger_1.logger.debug(`Found latest release pull request: ${mergedPullRequest.number} version: ${version}`);
|
|
707
|
+
candidateReleaseVersions.push(version);
|
|
708
|
+
break;
|
|
709
|
+
}
|
|
660
710
|
}
|
|
661
711
|
// If not found from recent pull requests, look at releases. Iterate
|
|
662
712
|
// through releases finding valid tags, then cross reference
|
|
663
713
|
const releaseGenerator = github.releaseIterator();
|
|
664
|
-
const candidateReleaseVersions = [];
|
|
665
714
|
for await (const release of releaseGenerator) {
|
|
666
715
|
const tagName = tag_name_1.TagName.parse(release.tagName);
|
|
667
716
|
if (!tagName) {
|
|
@@ -703,7 +752,7 @@ async function latestReleaseVersion(github, targetBranch, prefix, pullRequestTit
|
|
|
703
752
|
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
|
704
753
|
}
|
|
705
754
|
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
706
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
755
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
707
756
|
return {
|
|
708
757
|
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
|
709
758
|
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
|
@@ -718,7 +767,9 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
|
718
767
|
packageName: (_m = pathConfig.packageName) !== null && _m !== void 0 ? _m : defaultConfig.packageName,
|
|
719
768
|
versionFile: (_o = pathConfig.versionFile) !== null && _o !== void 0 ? _o : defaultConfig.versionFile,
|
|
720
769
|
extraFiles: (_p = pathConfig.extraFiles) !== null && _p !== void 0 ? _p : defaultConfig.extraFiles,
|
|
721
|
-
|
|
770
|
+
includeComponentInTag: (_q = pathConfig.includeComponentInTag) !== null && _q !== void 0 ? _q : defaultConfig.includeComponentInTag,
|
|
771
|
+
tagSeparator: (_r = pathConfig.tagSeparator) !== null && _r !== void 0 ? _r : defaultConfig.tagSeparator,
|
|
772
|
+
pullRequestTitlePattern: (_s = pathConfig.pullRequestTitlePattern) !== null && _s !== void 0 ? _s : defaultConfig.pullRequestTitlePattern,
|
|
722
773
|
};
|
|
723
774
|
}
|
|
724
775
|
/**
|
|
@@ -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));
|
|
@@ -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
|
/**
|
|
@@ -47,7 +47,7 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
47
47
|
readonly path: string;
|
|
48
48
|
protected github: GitHub;
|
|
49
49
|
protected component?: string;
|
|
50
|
-
|
|
50
|
+
private packageName?;
|
|
51
51
|
readonly versioningStrategy: VersioningStrategy;
|
|
52
52
|
protected targetBranch: string;
|
|
53
53
|
protected repository: Repository;
|
|
@@ -72,6 +72,7 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
72
72
|
*/
|
|
73
73
|
getComponent(): Promise<string | undefined>;
|
|
74
74
|
getDefaultComponent(): Promise<string | undefined>;
|
|
75
|
+
getPackageName(): Promise<string | undefined>;
|
|
75
76
|
getDefaultPackageName(): Promise<string | undefined>;
|
|
76
77
|
protected normalizeComponent(component: string | undefined): string;
|
|
77
78
|
/**
|
|
@@ -68,8 +68,13 @@ class BaseStrategy {
|
|
|
68
68
|
var _a;
|
|
69
69
|
return this.normalizeComponent((_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName()));
|
|
70
70
|
}
|
|
71
|
+
async getPackageName() {
|
|
72
|
+
var _a;
|
|
73
|
+
return (_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName());
|
|
74
|
+
}
|
|
71
75
|
async getDefaultPackageName() {
|
|
72
|
-
|
|
76
|
+
var _a;
|
|
77
|
+
return (_a = this.packageName) !== null && _a !== void 0 ? _a : '';
|
|
73
78
|
}
|
|
74
79
|
normalizeComponent(component) {
|
|
75
80
|
if (!component) {
|
|
@@ -118,7 +123,6 @@ class BaseStrategy {
|
|
|
118
123
|
* open a pull request.
|
|
119
124
|
*/
|
|
120
125
|
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
|
121
|
-
var _a;
|
|
122
126
|
const conventionalCommits = await this.postProcessCommits(commit_1.parseConventionalCommits(commits));
|
|
123
127
|
logger_1.logger.info(`Considering: ${conventionalCommits.length} commits`);
|
|
124
128
|
if (conventionalCommits.length === 0) {
|
|
@@ -127,8 +131,6 @@ class BaseStrategy {
|
|
|
127
131
|
}
|
|
128
132
|
const newVersion = await this.buildNewVersion(conventionalCommits, latestRelease);
|
|
129
133
|
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);
|
|
132
134
|
const component = await this.getComponent();
|
|
133
135
|
logger_1.logger.debug('component:', component);
|
|
134
136
|
const newVersionTag = new tag_name_1.TagName(newVersion, this.includeComponentInTag ? component : undefined, this.tagSeparator);
|
|
@@ -237,14 +239,24 @@ class BaseStrategy {
|
|
|
237
239
|
return;
|
|
238
240
|
}
|
|
239
241
|
const component = await this.getComponent();
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
!pullRequestBody.releaseData[0].component
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
let releaseData;
|
|
243
|
+
if (pullRequestBody.releaseData.length === 1 &&
|
|
244
|
+
!pullRequestBody.releaseData[0].component) {
|
|
245
|
+
// standalone release PR, ensure the components match
|
|
246
|
+
if (this.normalizeComponent(branchName.component) !==
|
|
247
|
+
this.normalizeComponent(component)) {
|
|
248
|
+
logger_1.logger.warn(`PR component: ${branchName.component} does not match configured component: ${component}`);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
releaseData = pullRequestBody.releaseData[0];
|
|
252
|
+
}
|
|
253
|
+
else {
|
|
254
|
+
// manifest release with multiple components
|
|
255
|
+
releaseData = pullRequestBody.releaseData.find(releaseData => {
|
|
245
256
|
return (this.normalizeComponent(releaseData.component) ===
|
|
246
257
|
this.normalizeComponent(component));
|
|
247
258
|
});
|
|
259
|
+
}
|
|
248
260
|
const notes = releaseData === null || releaseData === void 0 ? void 0 : releaseData.notes;
|
|
249
261
|
if (notes === undefined) {
|
|
250
262
|
logger_1.logger.warn('Failed to find release notes');
|
|
@@ -66,10 +66,6 @@ class GoYoshi extends base_1.BaseStrategy {
|
|
|
66
66
|
logger_1.logger.debug('Filtering commits');
|
|
67
67
|
return commits.filter(commit => {
|
|
68
68
|
var _a, _b;
|
|
69
|
-
// ignore commits whose scope is in the list of ignored modules
|
|
70
|
-
if (IGNORED_SUB_MODULES.has(commit.scope || '')) {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
69
|
// Only have a single entry of the nightly regen listed in the changelog.
|
|
74
70
|
// If there are more than one of these commits, append associated PR.
|
|
75
71
|
if (this.repository.owner === 'googleapis' &&
|
|
@@ -21,9 +21,10 @@ const changelog_1 = require("../updaters/changelog");
|
|
|
21
21
|
const package_json_1 = require("../updaters/node/package-json");
|
|
22
22
|
class Node extends base_1.BaseStrategy {
|
|
23
23
|
async buildUpdates(options) {
|
|
24
|
+
var _a;
|
|
24
25
|
const updates = [];
|
|
25
26
|
const version = options.newVersion;
|
|
26
|
-
const packageName = this.
|
|
27
|
+
const packageName = (_a = (await this.getPackageName())) !== null && _a !== void 0 ? _a : '';
|
|
27
28
|
const lockFiles = ['package-lock.json', 'npm-shrinkwrap.json'];
|
|
28
29
|
lockFiles.forEach(lockFile => {
|
|
29
30
|
updates.push({
|
|
@@ -84,6 +84,7 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
84
84
|
previousTag: (_a = latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
85
85
|
currentTag: newVersionTag.toString(),
|
|
86
86
|
targetBranch: this.targetBranch,
|
|
87
|
+
changelogSections: this.changelogSections,
|
|
87
88
|
});
|
|
88
89
|
releaseNotesBody = updatePHPChangelogEntry(`${composer.name} ${newVersion.toString()}`, releaseNotesBody, partialReleaseNotes);
|
|
89
90
|
}
|
|
@@ -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');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.9",
|
|
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": "13.0.
|
|
56
|
+
"sinon": "13.0.1",
|
|
57
57
|
"snap-shot-it": "^7.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|