release-please 13.13.0 → 13.14.0

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 CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [13.14.0](https://github.com/googleapis/release-please/compare/v13.13.0...v13.14.0) (2022-04-20)
8
+
9
+
10
+ ### Features
11
+
12
+ * Support sequential-calls manifest field that disables concurrency when creating multiple pull requests or releases ([#1401](https://github.com/googleapis/release-please/issues/1401)) ([50f5c99](https://github.com/googleapis/release-please/commit/50f5c990b99d991b874ba88556386c6b940743f6))
13
+
7
14
  ## [13.13.0](https://github.com/googleapis/release-please/compare/v13.12.0...v13.13.0) (2022-04-18)
8
15
 
9
16
 
@@ -88,9 +88,10 @@ export interface ManifestOptions {
88
88
  signoff?: string;
89
89
  manifestPath?: string;
90
90
  labels?: string[];
91
- skipLabeling?: boolean;
92
91
  releaseLabels?: string[];
93
92
  snapshotLabels?: string[];
93
+ skipLabeling?: boolean;
94
+ sequentialCalls?: boolean;
94
95
  draft?: boolean;
95
96
  prerelease?: boolean;
96
97
  draftPullRequest?: boolean;
@@ -126,6 +127,7 @@ export interface ManifestConfig extends ReleaserConfigJson {
126
127
  'group-pull-request-title-pattern'?: string;
127
128
  'release-search-depth'?: number;
128
129
  'commit-search-depth'?: number;
130
+ 'sequential-calls'?: boolean;
129
131
  }
130
132
  export declare type ReleasedVersions = Record<string, Version>;
131
133
  export declare type RepositoryConfig = Record<string, ReleaserConfig>;
@@ -156,6 +158,7 @@ export declare class Manifest {
156
158
  private signoffUser?;
157
159
  private labels;
158
160
  private skipLabeling?;
161
+ private sequentialCalls?;
159
162
  private releaseLabels;
160
163
  private snapshotLabels;
161
164
  private plugins;
@@ -247,7 +250,7 @@ export declare class Manifest {
247
250
  /**
248
251
  * Opens/updates all candidate release pull requests for this repository.
249
252
  *
250
- * @returns {number[]} Pull request numbers of release pull requests
253
+ * @returns {PullRequest[]} Pull request numbers of release pull requests
251
254
  */
252
255
  createPullRequests(): Promise<(PullRequest | undefined)[]>;
253
256
  private findOpenReleasePullRequests;
@@ -79,6 +79,7 @@ class Manifest {
79
79
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.releaseLabels) || exports.DEFAULT_RELEASE_LABELS;
80
80
  this.labels = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.labels) || exports.DEFAULT_LABELS;
81
81
  this.skipLabeling = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.skipLabeling) || false;
82
+ this.sequentialCalls = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.sequentialCalls) || false;
82
83
  this.snapshotLabels =
83
84
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.snapshotLabels) || exports.DEFAULT_SNAPSHOT_LABELS;
84
85
  this.bootstrapSha = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.bootstrapSha;
@@ -400,7 +401,7 @@ class Manifest {
400
401
  /**
401
402
  * Opens/updates all candidate release pull requests for this repository.
402
403
  *
403
- * @returns {number[]} Pull request numbers of release pull requests
404
+ * @returns {PullRequest[]} Pull request numbers of release pull requests
404
405
  */
405
406
  async createPullRequests() {
406
407
  const candidatePullRequests = await this.buildPullRequests();
@@ -417,13 +418,24 @@ class Manifest {
417
418
  // collect open and snoozed release pull requests
418
419
  const openPullRequests = await this.findOpenReleasePullRequests();
419
420
  const snoozedPullRequests = await this.findSnoozedReleasePullRequests();
420
- const promises = [];
421
- for (const pullRequest of candidatePullRequests) {
422
- promises.push(this.createOrUpdatePullRequest(pullRequest, openPullRequests, snoozedPullRequests));
421
+ if (this.sequentialCalls) {
422
+ const pullRequests = [];
423
+ for (const pullRequest of candidatePullRequests) {
424
+ const resultPullRequest = await this.createOrUpdatePullRequest(pullRequest, openPullRequests, snoozedPullRequests);
425
+ if (resultPullRequest)
426
+ pullRequests.push(resultPullRequest);
427
+ }
428
+ return pullRequests;
429
+ }
430
+ else {
431
+ const promises = [];
432
+ for (const pullRequest of candidatePullRequests) {
433
+ promises.push(this.createOrUpdatePullRequest(pullRequest, openPullRequests, snoozedPullRequests));
434
+ }
435
+ const pullNumbers = await Promise.all(promises);
436
+ // reject any pull numbers that were not created or updated
437
+ return pullNumbers.filter(number => !!number);
423
438
  }
424
- const pullNumbers = await Promise.all(promises);
425
- // reject any pull numbers that were not created or updated
426
- return pullNumbers.filter(number => !!number);
427
439
  }
428
440
  async findOpenReleasePullRequests() {
429
441
  logger_1.logger.info('Looking for open release pull requests');
@@ -573,12 +585,22 @@ class Manifest {
573
585
  releasesByPullRequest[release.pullRequest.number] = [release];
574
586
  }
575
587
  }
576
- const promises = [];
577
- for (const pullNumber in releasesByPullRequest) {
578
- promises.push(this.createReleasesForPullRequest(releasesByPullRequest[pullNumber], pullRequestsByNumber[pullNumber]));
588
+ if (this.sequentialCalls) {
589
+ const resultReleases = [];
590
+ for (const pullNumber in releasesByPullRequest) {
591
+ const releases = await this.createReleasesForPullRequest(releasesByPullRequest[pullNumber], pullRequestsByNumber[pullNumber]);
592
+ resultReleases.concat(releases);
593
+ }
594
+ return resultReleases;
595
+ }
596
+ else {
597
+ const promises = [];
598
+ for (const pullNumber in releasesByPullRequest) {
599
+ promises.push(this.createReleasesForPullRequest(releasesByPullRequest[pullNumber], pullRequestsByNumber[pullNumber]));
600
+ }
601
+ const releases = await Promise.all(promises);
602
+ return releases.reduce((collection, r) => collection.concat(r), []);
579
603
  }
580
- const releases = await Promise.all(promises);
581
- return releases.reduce((collection, r) => collection.concat(r), []);
582
604
  }
583
605
  async createReleasesForPullRequest(releases, pullRequest) {
584
606
  // create the release
@@ -731,6 +753,7 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
731
753
  snapshotLabels: configSnapshotLabel === undefined ? undefined : [configSnapshotLabel],
732
754
  releaseSearchDepth: config['release-search-depth'],
733
755
  commitSearchDepth: config['commit-search-depth'],
756
+ sequentialCalls: config['sequential-calls'],
734
757
  };
735
758
  return { config: repositoryConfig, options: manifestOptions };
736
759
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.13.0",
3
+ "version": "13.14.0",
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",