release-please 13.11.1 → 13.12.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,18 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [13.12.0](https://github.com/googleapis/release-please/compare/v13.11.1...v13.12.0) (2022-04-15)
8
+
9
+
10
+ ### Features
11
+
12
+ * allow configuring `release-search-depth` and `commit-search-depth` ([#1396](https://github.com/googleapis/release-please/issues/1396)) ([102d650](https://github.com/googleapis/release-please/commit/102d650394140667d17d84726bd962477d69562c)), closes [#1394](https://github.com/googleapis/release-please/issues/1394)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * Allow an empty value for --label ([#1397](https://github.com/googleapis/release-please/issues/1397)) ([f5aff97](https://github.com/googleapis/release-please/commit/f5aff97dbb20086a26b846dde89b289a4540dba1))
18
+
7
19
  ### [13.11.1](https://github.com/googleapis/release-please/compare/v13.11.0...v13.11.1) (2022-04-15)
8
20
 
9
21
 
@@ -516,8 +516,11 @@ function extractManifestOptions(argv) {
516
516
  if ('fork' in argv && argv.fork !== undefined) {
517
517
  manifestOptions.fork = argv.fork;
518
518
  }
519
- if (argv.label) {
520
- manifestOptions.labels = argv.label.split(',');
519
+ if (argv.label !== undefined) {
520
+ let labels = argv.label.split(',');
521
+ if (labels.length === 1 && labels[0] === '')
522
+ labels = [];
523
+ manifestOptions.labels = labels;
521
524
  }
522
525
  if ('releaseLabel' in argv && argv.releaseLabel) {
523
526
  manifestOptions.releaseLabels = argv.releaseLabel.split(',');
@@ -94,6 +94,8 @@ export interface ManifestOptions {
94
94
  prerelease?: boolean;
95
95
  draftPullRequest?: boolean;
96
96
  groupPullRequestTitlePattern?: string;
97
+ releaseSearchDepth?: number;
98
+ commitSearchDepth?: number;
97
99
  }
98
100
  interface ReleaserPackageConfig extends ReleaserConfigJson {
99
101
  'package-name'?: string;
@@ -121,6 +123,8 @@ export interface ManifestConfig extends ReleaserConfigJson {
121
123
  plugins?: PluginType[];
122
124
  'separate-pull-requests'?: boolean;
123
125
  'group-pull-request-title-pattern'?: string;
126
+ 'release-search-depth'?: number;
127
+ 'commit-search-depth'?: number;
124
128
  }
125
129
  export declare type ReleasedVersions = Record<string, Version>;
126
130
  export declare type RepositoryConfig = Record<string, ReleaserConfig>;
@@ -162,6 +166,8 @@ export declare class Manifest {
162
166
  private prerelease?;
163
167
  private draftPullRequest?;
164
168
  private groupPullRequestTitlePattern?;
169
+ readonly releaseSearchDepth: number;
170
+ readonly commitSearchDepth: number;
165
171
  /**
166
172
  * Create a Manifest from explicit config in code. This assumes that the
167
173
  * repository has a single component at the root path.
@@ -33,6 +33,8 @@ exports.DEFAULT_LABELS = ['autorelease: pending'];
33
33
  exports.DEFAULT_RELEASE_LABELS = ['autorelease: tagged'];
34
34
  exports.DEFAULT_SNAPSHOT_LABELS = ['autorelease: snapshot'];
35
35
  exports.SNOOZE_LABEL = 'autorelease: snooze';
36
+ const DEFAULT_RELEASE_SEARCH_DEPTH = 400;
37
+ const DEFAULT_COMMIT_SEARCH_DEPTH = 500;
36
38
  exports.MANIFEST_PULL_REQUEST_TITLE_PATTERN = 'chore: release ${branch}';
37
39
  class Manifest {
38
40
  /**
@@ -83,6 +85,10 @@ class Manifest {
83
85
  this.draft = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draft;
84
86
  this.draftPullRequest = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draftPullRequest;
85
87
  this.groupPullRequestTitlePattern = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.groupPullRequestTitlePattern;
88
+ this.releaseSearchDepth =
89
+ (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.releaseSearchDepth) || DEFAULT_RELEASE_SEARCH_DEPTH;
90
+ this.commitSearchDepth =
91
+ (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.commitSearchDepth) || DEFAULT_COMMIT_SEARCH_DEPTH;
86
92
  }
87
93
  /**
88
94
  * Create a Manifest from config files in the repository.
@@ -169,8 +175,9 @@ class Manifest {
169
175
  const releaseShasByPath = {};
170
176
  // Releases by path
171
177
  const releasesByPath = {};
178
+ logger_1.logger.debug(`release search depth: ${this.releaseSearchDepth}`);
172
179
  for await (const release of this.github.releaseIterator({
173
- maxResults: 400,
180
+ maxResults: this.releaseSearchDepth,
174
181
  })) {
175
182
  const tagName = tag_name_1.TagName.parse(release.tagName);
176
183
  if (!tagName) {
@@ -227,8 +234,9 @@ class Manifest {
227
234
  // seen all release commits
228
235
  logger_1.logger.info('Collecting commits since all latest releases');
229
236
  const commits = [];
237
+ logger_1.logger.debug(`commit search depth: ${this.commitSearchDepth}`);
230
238
  const commitGenerator = this.github.mergeCommitIterator(this.targetBranch, {
231
- maxResults: 500,
239
+ maxResults: this.commitSearchDepth,
232
240
  backfillFiles: true,
233
241
  });
234
242
  const releaseShas = new Set(Object.values(releaseShasByPath));
@@ -719,6 +727,8 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
719
727
  labels: configLabel === undefined ? undefined : [configLabel],
720
728
  releaseLabels: configReleaseLabel === undefined ? undefined : [configReleaseLabel],
721
729
  snapshotLabels: configSnapshotLabel === undefined ? undefined : [configSnapshotLabel],
730
+ releaseSearchDepth: config['release-search-depth'],
731
+ commitSearchDepth: config['commit-search-depth'],
722
732
  };
723
733
  return { config: repositoryConfig, options: manifestOptions };
724
734
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.11.1",
3
+ "version": "13.12.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",