release-please 17.2.1 → 17.3.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.
@@ -47,6 +47,7 @@ type CommitFilter = (commit: Commit) => boolean;
47
47
  interface CommitIteratorOptions {
48
48
  maxResults?: number;
49
49
  backfillFiles?: boolean;
50
+ batchSize?: number;
50
51
  }
51
52
  interface ReleaseIteratorOptions {
52
53
  maxResults?: number;
@@ -533,8 +533,8 @@ class GitHub {
533
533
  }
534
534
  }
535
535
  async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
536
- var _a, _b, _c, _d, _e, _f, _g, _h;
537
- var _j;
536
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
537
+ var _k;
538
538
  this.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
539
539
  const query = `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
540
540
  repository(owner: $owner, name: $repo) {
@@ -586,7 +586,7 @@ class GitHub {
586
586
  cursor,
587
587
  owner: this.repository.owner,
588
588
  repo: this.repository.repo,
589
- num: 10,
589
+ num: (_a = options.batchSize) !== null && _a !== void 0 ? _a : 10,
590
590
  targetBranch,
591
591
  maxFilesChanged: 100, // max is 100
592
592
  };
@@ -599,7 +599,7 @@ class GitHub {
599
599
  return null;
600
600
  }
601
601
  // if the branch does exist, return null
602
- if (!((_a = response.repository) === null || _a === void 0 ? void 0 : _a.ref)) {
602
+ if (!((_b = response.repository) === null || _b === void 0 ? void 0 : _b.ref)) {
603
603
  this.logger.warn(`Could not find commits for branch ${targetBranch} - it likely does not exist.`);
604
604
  return null;
605
605
  }
@@ -611,8 +611,8 @@ class GitHub {
611
611
  const mergeCommitCount = {};
612
612
  for (const commit of commits) {
613
613
  for (const pr of commit.associatedPullRequests.nodes) {
614
- if ((_b = pr.mergeCommit) === null || _b === void 0 ? void 0 : _b.oid) {
615
- (_c = mergeCommitCount[_j = pr.mergeCommit.oid]) !== null && _c !== void 0 ? _c : (mergeCommitCount[_j] = 0);
614
+ if ((_c = pr.mergeCommit) === null || _c === void 0 ? void 0 : _c.oid) {
615
+ (_d = mergeCommitCount[_k = pr.mergeCommit.oid]) !== null && _d !== void 0 ? _d : (mergeCommitCount[_k] = 0);
616
616
  mergeCommitCount[pr.mergeCommit.oid]++;
617
617
  }
618
618
  }
@@ -642,15 +642,15 @@ class GitHub {
642
642
  number: pullRequest.number,
643
643
  baseBranchName: pullRequest.baseRefName,
644
644
  headBranchName: pullRequest.headRefName,
645
- mergeCommitOid: (_d = pullRequest.mergeCommit) === null || _d === void 0 ? void 0 : _d.oid,
645
+ mergeCommitOid: (_e = pullRequest.mergeCommit) === null || _e === void 0 ? void 0 : _e.oid,
646
646
  title: pullRequest.title,
647
647
  body: pullRequest.body,
648
648
  labels: pullRequest.labels.nodes.map(node => node.name),
649
- files: (((_e = pullRequest.files) === null || _e === void 0 ? void 0 : _e.nodes) || []).map(node => node.path),
649
+ files: (((_f = pullRequest.files) === null || _f === void 0 ? void 0 : _f.nodes) || []).map(node => node.path),
650
650
  };
651
651
  }
652
652
  if (mergePullRequest) {
653
- if (((_g = (_f = mergePullRequest.files) === null || _f === void 0 ? void 0 : _f.pageInfo) === null || _g === void 0 ? void 0 : _g.hasNextPage) &&
653
+ if (((_h = (_g = mergePullRequest.files) === null || _g === void 0 ? void 0 : _g.pageInfo) === null || _h === void 0 ? void 0 : _h.hasNextPage) &&
654
654
  options.backfillFiles) {
655
655
  this.logger.info(`PR #${mergePullRequest.number} has many files, backfilling`);
656
656
  commit.files = await this.getCommitFiles(graphCommit.sha);
@@ -658,7 +658,7 @@ class GitHub {
658
658
  else {
659
659
  // We cannot directly fetch files on commits via graphql, only provide file
660
660
  // information for commits with associated pull requests
661
- commit.files = (((_h = mergePullRequest.files) === null || _h === void 0 ? void 0 : _h.nodes) || []).map(node => node.path);
661
+ commit.files = (((_j = mergePullRequest.files) === null || _j === void 0 ? void 0 : _j.nodes) || []).map(node => node.path);
662
662
  }
663
663
  }
664
664
  else if (options.backfillFiles) {
@@ -14,4 +14,4 @@ export { Logger, setLogger } from './util/logger';
14
14
  export { GitHub } from './github';
15
15
  export declare const configSchema: any;
16
16
  export declare const manifestSchema: any;
17
- export declare const VERSION = "17.2.1";
17
+ export declare const VERSION = "17.3.0";
@@ -36,6 +36,6 @@ Object.defineProperty(exports, "GitHub", { enumerable: true, get: function () {
36
36
  exports.configSchema = require('../../schemas/config.json');
37
37
  exports.manifestSchema = require('../../schemas/manifest.json');
38
38
  // x-release-please-start-version
39
- exports.VERSION = '17.2.1';
39
+ exports.VERSION = '17.3.0';
40
40
  // x-release-please-end
41
41
  //# sourceMappingURL=index.js.map
@@ -153,6 +153,7 @@ export interface ManifestOptions {
153
153
  groupPullRequestTitlePattern?: string;
154
154
  releaseSearchDepth?: number;
155
155
  commitSearchDepth?: number;
156
+ commitBatchSize?: number;
156
157
  logger?: Logger;
157
158
  dateFormat?: string;
158
159
  }
@@ -198,6 +199,7 @@ export interface ManifestConfig extends ReleaserConfigJson {
198
199
  'group-pull-request-title-pattern'?: string;
199
200
  'release-search-depth'?: number;
200
201
  'commit-search-depth'?: number;
202
+ 'commit-batch-size'?: number;
201
203
  'sequential-calls'?: boolean;
202
204
  'always-update'?: boolean;
203
205
  }
@@ -248,6 +250,7 @@ export declare class Manifest {
248
250
  private groupPullRequestTitlePattern?;
249
251
  readonly releaseSearchDepth: number;
250
252
  readonly commitSearchDepth: number;
253
+ readonly commitBatchSize: number;
251
254
  readonly logger: Logger;
252
255
  private pullRequestOverflowHandler;
253
256
  /**
@@ -38,6 +38,7 @@ exports.DEFAULT_SNAPSHOT_LABELS = ['autorelease: snapshot'];
38
38
  exports.SNOOZE_LABEL = 'autorelease: snooze';
39
39
  const DEFAULT_RELEASE_SEARCH_DEPTH = 400;
40
40
  const DEFAULT_COMMIT_SEARCH_DEPTH = 500;
41
+ const DEFAULT_COMMIT_BATCH_SIZE = 10;
41
42
  exports.MANIFEST_PULL_REQUEST_TITLE_PATTERN = 'chore: release ${branch}';
42
43
  class Manifest {
43
44
  /**
@@ -100,6 +101,8 @@ class Manifest {
100
101
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.releaseSearchDepth) || DEFAULT_RELEASE_SEARCH_DEPTH;
101
102
  this.commitSearchDepth =
102
103
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.commitSearchDepth) || DEFAULT_COMMIT_SEARCH_DEPTH;
104
+ this.commitBatchSize =
105
+ (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.commitBatchSize) || DEFAULT_COMMIT_BATCH_SIZE;
103
106
  this.logger = (_b = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.logger) !== null && _b !== void 0 ? _b : logger_1.logger;
104
107
  this.plugins = ((manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.plugins) || []).map(pluginType => (0, factory_1.buildPlugin)({
105
108
  type: pluginType,
@@ -261,6 +264,7 @@ class Manifest {
261
264
  const commitGenerator = this.github.mergeCommitIterator(this.targetBranch, {
262
265
  maxResults: this.commitSearchDepth,
263
266
  backfillFiles: true,
267
+ batchSize: this.commitBatchSize,
264
268
  });
265
269
  const releaseShas = new Set(Object.values(releaseShasByPath));
266
270
  this.logger.debug(releaseShas);
@@ -888,6 +892,7 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
888
892
  extraLabels: configExtraLabel === null || configExtraLabel === void 0 ? void 0 : configExtraLabel.split(','),
889
893
  releaseSearchDepth: config['release-search-depth'],
890
894
  commitSearchDepth: config['commit-search-depth'],
895
+ commitBatchSize: config['commit-batch-size'],
891
896
  sequentialCalls: config['sequential-calls'],
892
897
  };
893
898
  return { config: repositoryConfig, options: manifestOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "17.2.1",
3
+ "version": "17.3.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",
@@ -431,6 +431,10 @@
431
431
  "description": "When considering commit history, only look this many commits deep.",
432
432
  "type": "number"
433
433
  },
434
+ "commit-batch-size": {
435
+ "description": "Number of commits to fetch per API request when searching commit history. Lower values result in more API calls but may help avoid timeouts. Defaults to 10.",
436
+ "type": "number"
437
+ },
434
438
  "sequential-calls": {
435
439
  "description": "Whether to open pull requests/releases sequentially rather than concurrently. If you have many components, you may want to set this to avoid secondary rate limits.",
436
440
  "type": "boolean"
@@ -462,6 +466,7 @@
462
466
  "group-pull-request-title-pattern": true,
463
467
  "release-search-depth": true,
464
468
  "commit-search-depth": true,
469
+ "commit-batch-size": true,
465
470
  "sequential-calls": true,
466
471
  "release-type": true,
467
472
  "bump-minor-pre-major": true,