release-please 13.12.0 → 13.15.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,27 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [13.15.0](https://github.com/googleapis/release-please/compare/v13.14.0...v13.15.0) (2022-04-27)
8
+
9
+
10
+ ### Features
11
+
12
+ * allow configuring changelog-host ([#1408](https://github.com/googleapis/release-please/issues/1408)) ([d7d525f](https://github.com/googleapis/release-please/commit/d7d525f283f931dd999ca69228e71dd6adf9e0c3))
13
+
14
+ ## [13.14.0](https://github.com/googleapis/release-please/compare/v13.13.0...v13.14.0) (2022-04-20)
15
+
16
+
17
+ ### Features
18
+
19
+ * 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))
20
+
21
+ ## [13.13.0](https://github.com/googleapis/release-please/compare/v13.12.0...v13.13.0) (2022-04-18)
22
+
23
+
24
+ ### Features
25
+
26
+ * add a flag to disable adding labels to new pull requests ([#1399](https://github.com/googleapis/release-please/issues/1399)) ([3957ef5](https://github.com/googleapis/release-please/commit/3957ef542512eb1ae2c3353b3c2a7fde4540c731))
27
+
7
28
  ## [13.12.0](https://github.com/googleapis/release-please/compare/v13.11.1...v13.12.0) (2022-04-15)
8
29
 
9
30
 
@@ -48,12 +48,14 @@ interface ReleaseArgs {
48
48
  interface PullRequestArgs {
49
49
  draftPullRequest?: boolean;
50
50
  label?: string;
51
+ skipLabeling?: boolean;
51
52
  signoff?: string;
52
53
  }
53
54
  interface PullRequestStrategyArgs {
54
55
  snapshot?: boolean;
55
56
  changelogSections?: ChangelogSection[];
56
57
  changelogPath?: string;
58
+ changelogHost?: string;
57
59
  versioningStrategy?: VersioningStrategyType;
58
60
  versionFile?: string;
59
61
  extraFiles?: string[];
@@ -105,6 +105,11 @@ function pullRequestOptions(yargs) {
105
105
  .option('label', {
106
106
  default: 'autorelease: pending',
107
107
  describe: 'comma-separated list of labels to add to from release PR',
108
+ })
109
+ .option('skip-labeling', {
110
+ describe: 'skip application of labels to pull requests',
111
+ type: 'boolean',
112
+ default: false,
108
113
  })
109
114
  .option('fork', {
110
115
  describe: 'should the PR be created from a fork',
@@ -180,6 +185,10 @@ function pullRequestStrategyOptions(yargs) {
180
185
  }
181
186
  return arg;
182
187
  },
188
+ })
189
+ .option('changelog-host', {
190
+ describe: 'host for hyperlinks in the changelog',
191
+ type: 'string',
183
192
  })
184
193
  .option('last-package-version', {
185
194
  describe: 'last version # that package was released as',
@@ -279,6 +288,7 @@ const createReleasePullRequestCommand = {
279
288
  bumpPatchForMinorPreMajor: argv.bumpPatchForMinorPreMajor,
280
289
  changelogPath: argv.changelogPath,
281
290
  changelogType: argv.changelogType,
291
+ changelogHost: argv.changelogHost,
282
292
  pullRequestTitlePattern: argv.pullRequestTitlePattern,
283
293
  changelogSections: argv.changelogSections,
284
294
  releaseAs: argv.releaseAs,
@@ -466,6 +476,7 @@ const bootstrapCommand = {
466
476
  bumpMinorPreMajor: argv.bumpMinorPreMajor,
467
477
  bumpPatchForMinorPreMajor: argv.bumpPatchForMinorPreMajor,
468
478
  changelogPath: argv.changelogPath,
479
+ changelogHost: argv.changelogHost,
469
480
  changelogSections: argv.changelogSections,
470
481
  releaseAs: argv.releaseAs,
471
482
  versioning: argv.versioningStrategy,
@@ -522,6 +533,9 @@ function extractManifestOptions(argv) {
522
533
  labels = [];
523
534
  manifestOptions.labels = labels;
524
535
  }
536
+ if ('skipLabeling' in argv && argv.skipLabeling !== undefined) {
537
+ manifestOptions.skipLabeling = argv.skipLabeling;
538
+ }
525
539
  if ('releaseLabel' in argv && argv.releaseLabel) {
526
540
  manifestOptions.releaseLabels = argv.releaseLabel.split(',');
527
541
  }
@@ -233,6 +233,7 @@ export declare class GitHub {
233
233
  createReleasePullRequest(releasePullRequest: ReleasePullRequest, targetBranch: string, options?: {
234
234
  signoffUser?: string;
235
235
  fork?: boolean;
236
+ skipLabeling?: boolean;
236
237
  }): Promise<PullRequest>;
237
238
  createPullRequest: (pullRequest: PullRequest, targetBranch: string, message: string, updates: Update[], options?: {
238
239
  fork?: boolean | undefined;
@@ -870,13 +870,15 @@ class GitHub {
870
870
  if (options === null || options === void 0 ? void 0 : options.signoffUser) {
871
871
  message = signoff_commit_message_1.signoffCommitMessage(message, options.signoffUser);
872
872
  }
873
+ const pullRequestLabels = (options === null || options === void 0 ? void 0 : options.skipLabeling) ? []
874
+ : releasePullRequest.labels;
873
875
  return await this.createPullRequest({
874
876
  headBranchName: releasePullRequest.headRefName,
875
877
  baseBranchName: targetBranch,
876
878
  number: -1,
877
879
  title: releasePullRequest.title.toString(),
878
880
  body: releasePullRequest.body.toString().slice(0, MAX_ISSUE_BODY_SIZE),
879
- labels: releasePullRequest.labels,
881
+ labels: pullRequestLabels,
880
882
  files: [],
881
883
  }, targetBranch, message, releasePullRequest.updates, {
882
884
  fork: options === null || options === void 0 ? void 0 : options.fork,
@@ -42,6 +42,7 @@ export interface ReleaserConfig {
42
42
  changelogSections?: ChangelogSection[];
43
43
  changelogPath?: string;
44
44
  changelogType?: ChangelogNotesType;
45
+ changelogHost?: string;
45
46
  versionFile?: string;
46
47
  extraFiles?: ExtraFile[];
47
48
  snapshotLabels?: string[];
@@ -72,6 +73,7 @@ interface ReleaserConfigJson {
72
73
  'include-component-in-tag'?: boolean;
73
74
  'include-v-in-tag'?: boolean;
74
75
  'changelog-type'?: ChangelogNotesType;
76
+ 'changelog-host'?: string;
75
77
  'pull-request-title-pattern'?: string;
76
78
  'tag-separator'?: string;
77
79
  'extra-files'?: string[];
@@ -90,6 +92,8 @@ export interface ManifestOptions {
90
92
  labels?: string[];
91
93
  releaseLabels?: string[];
92
94
  snapshotLabels?: string[];
95
+ skipLabeling?: boolean;
96
+ sequentialCalls?: boolean;
93
97
  draft?: boolean;
94
98
  prerelease?: boolean;
95
99
  draftPullRequest?: boolean;
@@ -125,6 +129,7 @@ export interface ManifestConfig extends ReleaserConfigJson {
125
129
  'group-pull-request-title-pattern'?: string;
126
130
  'release-search-depth'?: number;
127
131
  'commit-search-depth'?: number;
132
+ 'sequential-calls'?: boolean;
128
133
  }
129
134
  export declare type ReleasedVersions = Record<string, Version>;
130
135
  export declare type RepositoryConfig = Record<string, ReleaserConfig>;
@@ -154,6 +159,8 @@ export declare class Manifest {
154
159
  readonly fork: boolean;
155
160
  private signoffUser?;
156
161
  private labels;
162
+ private skipLabeling?;
163
+ private sequentialCalls?;
157
164
  private releaseLabels;
158
165
  private snapshotLabels;
159
166
  private plugins;
@@ -245,7 +252,7 @@ export declare class Manifest {
245
252
  /**
246
253
  * Opens/updates all candidate release pull requests for this repository.
247
254
  *
248
- * @returns {number[]} Pull request numbers of release pull requests
255
+ * @returns {PullRequest[]} Pull request numbers of release pull requests
249
256
  */
250
257
  createPullRequests(): Promise<(PullRequest | undefined)[]>;
251
258
  private findOpenReleasePullRequests;
@@ -78,6 +78,8 @@ class Manifest {
78
78
  this.releaseLabels =
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
+ 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;
81
83
  this.snapshotLabels =
82
84
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.snapshotLabels) || exports.DEFAULT_SNAPSHOT_LABELS;
83
85
  this.bootstrapSha = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.bootstrapSha;
@@ -399,7 +401,7 @@ class Manifest {
399
401
  /**
400
402
  * Opens/updates all candidate release pull requests for this repository.
401
403
  *
402
- * @returns {number[]} Pull request numbers of release pull requests
404
+ * @returns {PullRequest[]} Pull request numbers of release pull requests
403
405
  */
404
406
  async createPullRequests() {
405
407
  const candidatePullRequests = await this.buildPullRequests();
@@ -416,13 +418,24 @@ class Manifest {
416
418
  // collect open and snoozed release pull requests
417
419
  const openPullRequests = await this.findOpenReleasePullRequests();
418
420
  const snoozedPullRequests = await this.findSnoozedReleasePullRequests();
419
- const promises = [];
420
- for (const pullRequest of candidatePullRequests) {
421
- 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);
422
438
  }
423
- const pullNumbers = await Promise.all(promises);
424
- // reject any pull numbers that were not created or updated
425
- return pullNumbers.filter(number => !!number);
426
439
  }
427
440
  async findOpenReleasePullRequests() {
428
441
  logger_1.logger.info('Looking for open release pull requests');
@@ -467,6 +480,7 @@ class Manifest {
467
480
  const newPullRequest = await this.github.createReleasePullRequest(pullRequest, this.targetBranch, {
468
481
  fork: this.fork,
469
482
  signoffUser: this.signoffUser,
483
+ skipLabeling: this.skipLabeling,
470
484
  });
471
485
  return newPullRequest;
472
486
  }
@@ -571,12 +585,22 @@ class Manifest {
571
585
  releasesByPullRequest[release.pullRequest.number] = [release];
572
586
  }
573
587
  }
574
- const promises = [];
575
- for (const pullNumber in releasesByPullRequest) {
576
- 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), []);
577
603
  }
578
- const releases = await Promise.all(promises);
579
- return releases.reduce((collection, r) => collection.concat(r), []);
580
604
  }
581
605
  async createReleasesForPullRequest(releases, pullRequest) {
582
606
  // create the release
@@ -676,6 +700,7 @@ function extractReleaserConfig(config) {
676
700
  bumpPatchForMinorPreMajor: config['bump-patch-for-minor-pre-major'],
677
701
  changelogSections: config['changelog-sections'],
678
702
  changelogPath: config['changelog-path'],
703
+ changelogHost: config['changelog-host'],
679
704
  releaseAs: config['release-as'],
680
705
  skipGithubRelease: config['skip-github-release'],
681
706
  draft: config.draft,
@@ -729,6 +754,7 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
729
754
  snapshotLabels: configSnapshotLabel === undefined ? undefined : [configSnapshotLabel],
730
755
  releaseSearchDepth: config['release-search-depth'],
731
756
  commitSearchDepth: config['commit-search-depth'],
757
+ sequentialCalls: config['sequential-calls'],
732
758
  };
733
759
  return { config: repositoryConfig, options: manifestOptions };
734
760
  }
@@ -847,25 +873,26 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix,
847
873
  return candidateTagVersion.sort((a, b) => b.compare(a))[0];
848
874
  }
849
875
  function mergeReleaserConfig(defaultConfig, pathConfig) {
850
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
876
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
851
877
  return {
852
878
  releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
853
879
  bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
854
880
  bumpPatchForMinorPreMajor: (_d = pathConfig.bumpPatchForMinorPreMajor) !== null && _d !== void 0 ? _d : defaultConfig.bumpPatchForMinorPreMajor,
855
881
  changelogSections: (_e = pathConfig.changelogSections) !== null && _e !== void 0 ? _e : defaultConfig.changelogSections,
856
882
  changelogPath: (_f = pathConfig.changelogPath) !== null && _f !== void 0 ? _f : defaultConfig.changelogPath,
857
- releaseAs: (_g = pathConfig.releaseAs) !== null && _g !== void 0 ? _g : defaultConfig.releaseAs,
858
- skipGithubRelease: (_h = pathConfig.skipGithubRelease) !== null && _h !== void 0 ? _h : defaultConfig.skipGithubRelease,
859
- draft: (_j = pathConfig.draft) !== null && _j !== void 0 ? _j : defaultConfig.draft,
860
- prerelease: (_k = pathConfig.prerelease) !== null && _k !== void 0 ? _k : defaultConfig.prerelease,
861
- component: (_l = pathConfig.component) !== null && _l !== void 0 ? _l : defaultConfig.component,
862
- packageName: (_m = pathConfig.packageName) !== null && _m !== void 0 ? _m : defaultConfig.packageName,
863
- versionFile: (_o = pathConfig.versionFile) !== null && _o !== void 0 ? _o : defaultConfig.versionFile,
864
- extraFiles: (_p = pathConfig.extraFiles) !== null && _p !== void 0 ? _p : defaultConfig.extraFiles,
865
- includeComponentInTag: (_q = pathConfig.includeComponentInTag) !== null && _q !== void 0 ? _q : defaultConfig.includeComponentInTag,
866
- includeVInTag: (_r = pathConfig.includeVInTag) !== null && _r !== void 0 ? _r : defaultConfig.includeVInTag,
867
- tagSeparator: (_s = pathConfig.tagSeparator) !== null && _s !== void 0 ? _s : defaultConfig.tagSeparator,
868
- pullRequestTitlePattern: (_t = pathConfig.pullRequestTitlePattern) !== null && _t !== void 0 ? _t : defaultConfig.pullRequestTitlePattern,
883
+ changelogHost: (_g = pathConfig.changelogHost) !== null && _g !== void 0 ? _g : defaultConfig.changelogHost,
884
+ releaseAs: (_h = pathConfig.releaseAs) !== null && _h !== void 0 ? _h : defaultConfig.releaseAs,
885
+ skipGithubRelease: (_j = pathConfig.skipGithubRelease) !== null && _j !== void 0 ? _j : defaultConfig.skipGithubRelease,
886
+ draft: (_k = pathConfig.draft) !== null && _k !== void 0 ? _k : defaultConfig.draft,
887
+ prerelease: (_l = pathConfig.prerelease) !== null && _l !== void 0 ? _l : defaultConfig.prerelease,
888
+ component: (_m = pathConfig.component) !== null && _m !== void 0 ? _m : defaultConfig.component,
889
+ packageName: (_o = pathConfig.packageName) !== null && _o !== void 0 ? _o : defaultConfig.packageName,
890
+ versionFile: (_p = pathConfig.versionFile) !== null && _p !== void 0 ? _p : defaultConfig.versionFile,
891
+ extraFiles: (_q = pathConfig.extraFiles) !== null && _q !== void 0 ? _q : defaultConfig.extraFiles,
892
+ includeComponentInTag: (_r = pathConfig.includeComponentInTag) !== null && _r !== void 0 ? _r : defaultConfig.includeComponentInTag,
893
+ includeVInTag: (_s = pathConfig.includeVInTag) !== null && _s !== void 0 ? _s : defaultConfig.includeVInTag,
894
+ tagSeparator: (_t = pathConfig.tagSeparator) !== null && _t !== void 0 ? _t : defaultConfig.tagSeparator,
895
+ pullRequestTitlePattern: (_u = pathConfig.pullRequestTitlePattern) !== null && _u !== void 0 ? _u : defaultConfig.pullRequestTitlePattern,
869
896
  };
870
897
  }
871
898
  /**
@@ -28,6 +28,7 @@ export interface BaseStrategyOptions {
28
28
  versioningStrategy?: VersioningStrategy;
29
29
  targetBranch: string;
30
30
  changelogPath?: string;
31
+ changelogHost?: string;
31
32
  changelogSections?: ChangelogSection[];
32
33
  commitPartial?: string;
33
34
  headerPartial?: string;
@@ -56,6 +57,7 @@ export declare abstract class BaseStrategy implements Strategy {
56
57
  protected targetBranch: string;
57
58
  protected repository: Repository;
58
59
  protected changelogPath: string;
60
+ protected changelogHost?: string;
59
61
  protected tagSeparator?: string;
60
62
  private skipGitHubRelease;
61
63
  private releaseAs?;
@@ -47,6 +47,7 @@ class BaseStrategy {
47
47
  this.targetBranch = options.targetBranch;
48
48
  this.repository = options.github.repository;
49
49
  this.changelogPath = options.changelogPath || DEFAULT_CHANGELOG_PATH;
50
+ this.changelogHost = options.changelogHost;
50
51
  this.changelogSections = options.changelogSections;
51
52
  this.tagSeparator = options.tagSeparator;
52
53
  this.skipGitHubRelease = options.skipGitHubRelease || false;
@@ -97,6 +98,7 @@ class BaseStrategy {
97
98
  async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease, commits) {
98
99
  var _a;
99
100
  return await this.changelogNotes.buildNotes(conventionalCommits, {
101
+ host: this.changelogHost,
100
102
  owner: this.repository.owner,
101
103
  repository: this.repository.repo,
102
104
  version: newVersion.toString(),
@@ -79,6 +79,7 @@ class PHPYoshi extends base_1.BaseStrategy {
79
79
  const newVersion = await this.versioningStrategy.bump(version, splitCommits[directory]);
80
80
  versionsMap.set(composer.name, newVersion);
81
81
  const partialReleaseNotes = await this.changelogNotes.buildNotes(splitCommits[directory], {
82
+ host: this.changelogHost,
82
83
  owner: this.repository.owner,
83
84
  repository: this.repository.repo,
84
85
  version: newVersion.toString(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.12.0",
3
+ "version": "13.15.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",