release-please 13.11.0 → 13.13.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,32 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [13.13.0](https://github.com/googleapis/release-please/compare/v13.12.0...v13.13.0) (2022-04-18)
8
+
9
+
10
+ ### Features
11
+
12
+ * 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))
13
+
14
+ ## [13.12.0](https://github.com/googleapis/release-please/compare/v13.11.1...v13.12.0) (2022-04-15)
15
+
16
+
17
+ ### Features
18
+
19
+ * 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)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * Allow an empty value for --label ([#1397](https://github.com/googleapis/release-please/issues/1397)) ([f5aff97](https://github.com/googleapis/release-please/commit/f5aff97dbb20086a26b846dde89b289a4540dba1))
25
+
26
+ ### [13.11.1](https://github.com/googleapis/release-please/compare/v13.11.0...v13.11.1) (2022-04-15)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * **deps:** switch from `xmldom` to `@xmldom/xmldom` and update to v0.8.2 ([#1393](https://github.com/googleapis/release-please/issues/1393)) ([b6af677](https://github.com/googleapis/release-please/commit/b6af677da635493230d7e3a632aeedb5cfd1edb7))
32
+
7
33
  ## [13.11.0](https://github.com/googleapis/release-please/compare/v13.10.2...v13.11.0) (2022-04-15)
8
34
 
9
35
 
@@ -48,6 +48,7 @@ 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 {
@@ -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',
@@ -516,8 +521,14 @@ function extractManifestOptions(argv) {
516
521
  if ('fork' in argv && argv.fork !== undefined) {
517
522
  manifestOptions.fork = argv.fork;
518
523
  }
519
- if (argv.label) {
520
- manifestOptions.labels = argv.label.split(',');
524
+ if (argv.label !== undefined) {
525
+ let labels = argv.label.split(',');
526
+ if (labels.length === 1 && labels[0] === '')
527
+ labels = [];
528
+ manifestOptions.labels = labels;
529
+ }
530
+ if ('skipLabeling' in argv && argv.skipLabeling !== undefined) {
531
+ manifestOptions.skipLabeling = argv.skipLabeling;
521
532
  }
522
533
  if ('releaseLabel' in argv && argv.releaseLabel) {
523
534
  manifestOptions.releaseLabels = argv.releaseLabel.split(',');
@@ -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,
@@ -88,12 +88,15 @@ export interface ManifestOptions {
88
88
  signoff?: string;
89
89
  manifestPath?: string;
90
90
  labels?: string[];
91
+ skipLabeling?: boolean;
91
92
  releaseLabels?: string[];
92
93
  snapshotLabels?: string[];
93
94
  draft?: boolean;
94
95
  prerelease?: boolean;
95
96
  draftPullRequest?: boolean;
96
97
  groupPullRequestTitlePattern?: string;
98
+ releaseSearchDepth?: number;
99
+ commitSearchDepth?: number;
97
100
  }
98
101
  interface ReleaserPackageConfig extends ReleaserConfigJson {
99
102
  'package-name'?: string;
@@ -121,6 +124,8 @@ export interface ManifestConfig extends ReleaserConfigJson {
121
124
  plugins?: PluginType[];
122
125
  'separate-pull-requests'?: boolean;
123
126
  'group-pull-request-title-pattern'?: string;
127
+ 'release-search-depth'?: number;
128
+ 'commit-search-depth'?: number;
124
129
  }
125
130
  export declare type ReleasedVersions = Record<string, Version>;
126
131
  export declare type RepositoryConfig = Record<string, ReleaserConfig>;
@@ -150,6 +155,7 @@ export declare class Manifest {
150
155
  readonly fork: boolean;
151
156
  private signoffUser?;
152
157
  private labels;
158
+ private skipLabeling?;
153
159
  private releaseLabels;
154
160
  private snapshotLabels;
155
161
  private plugins;
@@ -162,6 +168,8 @@ export declare class Manifest {
162
168
  private prerelease?;
163
169
  private draftPullRequest?;
164
170
  private groupPullRequestTitlePattern?;
171
+ readonly releaseSearchDepth: number;
172
+ readonly commitSearchDepth: number;
165
173
  /**
166
174
  * Create a Manifest from explicit config in code. This assumes that the
167
175
  * 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
  /**
@@ -76,6 +78,7 @@ class Manifest {
76
78
  this.releaseLabels =
77
79
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.releaseLabels) || exports.DEFAULT_RELEASE_LABELS;
78
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;
79
82
  this.snapshotLabels =
80
83
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.snapshotLabels) || exports.DEFAULT_SNAPSHOT_LABELS;
81
84
  this.bootstrapSha = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.bootstrapSha;
@@ -83,6 +86,10 @@ class Manifest {
83
86
  this.draft = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draft;
84
87
  this.draftPullRequest = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draftPullRequest;
85
88
  this.groupPullRequestTitlePattern = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.groupPullRequestTitlePattern;
89
+ this.releaseSearchDepth =
90
+ (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.releaseSearchDepth) || DEFAULT_RELEASE_SEARCH_DEPTH;
91
+ this.commitSearchDepth =
92
+ (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.commitSearchDepth) || DEFAULT_COMMIT_SEARCH_DEPTH;
86
93
  }
87
94
  /**
88
95
  * Create a Manifest from config files in the repository.
@@ -169,8 +176,9 @@ class Manifest {
169
176
  const releaseShasByPath = {};
170
177
  // Releases by path
171
178
  const releasesByPath = {};
179
+ logger_1.logger.debug(`release search depth: ${this.releaseSearchDepth}`);
172
180
  for await (const release of this.github.releaseIterator({
173
- maxResults: 400,
181
+ maxResults: this.releaseSearchDepth,
174
182
  })) {
175
183
  const tagName = tag_name_1.TagName.parse(release.tagName);
176
184
  if (!tagName) {
@@ -227,8 +235,9 @@ class Manifest {
227
235
  // seen all release commits
228
236
  logger_1.logger.info('Collecting commits since all latest releases');
229
237
  const commits = [];
238
+ logger_1.logger.debug(`commit search depth: ${this.commitSearchDepth}`);
230
239
  const commitGenerator = this.github.mergeCommitIterator(this.targetBranch, {
231
- maxResults: 500,
240
+ maxResults: this.commitSearchDepth,
232
241
  backfillFiles: true,
233
242
  });
234
243
  const releaseShas = new Set(Object.values(releaseShasByPath));
@@ -459,6 +468,7 @@ class Manifest {
459
468
  const newPullRequest = await this.github.createReleasePullRequest(pullRequest, this.targetBranch, {
460
469
  fork: this.fork,
461
470
  signoffUser: this.signoffUser,
471
+ skipLabeling: this.skipLabeling,
462
472
  });
463
473
  return newPullRequest;
464
474
  }
@@ -719,6 +729,8 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
719
729
  labels: configLabel === undefined ? undefined : [configLabel],
720
730
  releaseLabels: configReleaseLabel === undefined ? undefined : [configReleaseLabel],
721
731
  snapshotLabels: configSnapshotLabel === undefined ? undefined : [configSnapshotLabel],
732
+ releaseSearchDepth: config['release-search-depth'],
733
+ commitSearchDepth: config['commit-search-depth'],
722
734
  };
723
735
  return { config: repositoryConfig, options: manifestOptions };
724
736
  }
@@ -14,7 +14,7 @@
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.BaseXml = void 0;
17
- const dom = require("xmldom");
17
+ const dom = require("@xmldom/xmldom");
18
18
  /**
19
19
  * Base class for all updaters working with XML files.
20
20
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.11.0",
3
+ "version": "13.13.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",
@@ -75,6 +75,7 @@
75
75
  "@octokit/request-error": "^2.1.0",
76
76
  "@octokit/rest": "^18.12.0",
77
77
  "@types/npm-package-arg": "^6.1.0",
78
+ "@xmldom/xmldom": "^0.8.2",
78
79
  "chalk": "^4.0.0",
79
80
  "code-suggester": "^2.0.0",
80
81
  "conventional-changelog-conventionalcommits": "^4.6.0",
@@ -92,7 +93,6 @@
92
93
  "typescript": "^3.8.3",
93
94
  "unist-util-visit": "^2.0.3",
94
95
  "unist-util-visit-parents": "^3.1.1",
95
- "xmldom": "^0.6.0",
96
96
  "xpath": "^0.0.32",
97
97
  "yargs": "^17.0.0"
98
98
  },