release-please 14.5.0 → 14.6.1

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,25 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [14.6.1](https://github.com/googleapis/release-please/compare/v14.6.0...v14.6.1) (2022-09-20)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * Detect uppercase readme.md files ([#1644](https://github.com/googleapis/release-please/issues/1644)) ([d3b68b2](https://github.com/googleapis/release-please/commit/d3b68b2afe622b0a9f83c77da33bfcf1bc4c77b4))
13
+
14
+ ## [14.6.0](https://github.com/googleapis/release-please/compare/v14.5.0...v14.6.0) (2022-09-15)
15
+
16
+
17
+ ### Features
18
+
19
+ * Allow nesting multiple commits that are parsed independently ([#1566](https://github.com/googleapis/release-please/issues/1566)) ([21ed59a](https://github.com/googleapis/release-please/commit/21ed59a1db32c6b9593931519bfa3b1eb456a4a7))
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **deps:** Update dependency node-html-parser to v6 ([#1633](https://github.com/googleapis/release-please/issues/1633)) ([af213c4](https://github.com/googleapis/release-please/commit/af213c404a87754747bc3becab6b5759320d7508))
25
+
7
26
  ## [14.5.0](https://github.com/googleapis/release-please/compare/v14.4.0...v14.5.0) (2022-09-07)
8
27
 
9
28
 
@@ -283,6 +283,21 @@ function hasExtendedContext(line) {
283
283
  function parseCommits(message) {
284
284
  return conventionalCommitsFilter(toConventionalChangelogFormat(parser.parser(message))).map(postProcessCommits);
285
285
  }
286
+ // If someone wishes to aggregate multiple, complex commit messages into a
287
+ // single commit, they can include one or more `BEGIN_NESTED_COMMIT`/`END_NESTED_COMMIT`
288
+ // blocks into the body of the commit
289
+ function splitMessages(message) {
290
+ const parts = message.split('BEGIN_NESTED_COMMIT');
291
+ const messages = [parts.shift()];
292
+ for (const part of parts) {
293
+ const [newMessage, ...rest] = part.split('END_NESTED_COMMIT');
294
+ messages.push(newMessage);
295
+ // anthing outside of the BEGIN/END annotations are added to the original
296
+ // commit
297
+ messages[0] = messages[0] + rest.join();
298
+ }
299
+ return messages;
300
+ }
286
301
  /**
287
302
  * Given a list of raw commits, parse and expand into conventional commits.
288
303
  *
@@ -295,27 +310,28 @@ function parseCommits(message) {
295
310
  function parseConventionalCommits(commits, logger = logger_1.logger) {
296
311
  const conventionalCommits = [];
297
312
  for (const commit of commits) {
298
- const commitMessage = preprocessCommitMessage(commit);
299
- try {
300
- for (const parsedCommit of parseCommits(commitMessage)) {
301
- const breaking = parsedCommit.notes.filter(note => note.title === 'BREAKING CHANGE')
302
- .length > 0;
303
- conventionalCommits.push({
304
- sha: commit.sha,
305
- message: parsedCommit.header,
306
- files: commit.files,
307
- pullRequest: commit.pullRequest,
308
- type: parsedCommit.type,
309
- scope: parsedCommit.scope,
310
- bareMessage: parsedCommit.subject,
311
- notes: parsedCommit.notes,
312
- references: parsedCommit.references,
313
- breaking,
314
- });
313
+ for (const commitMessage of splitMessages(preprocessCommitMessage(commit))) {
314
+ try {
315
+ for (const parsedCommit of parseCommits(commitMessage)) {
316
+ const breaking = parsedCommit.notes.filter(note => note.title === 'BREAKING CHANGE')
317
+ .length > 0;
318
+ conventionalCommits.push({
319
+ sha: commit.sha,
320
+ message: parsedCommit.header,
321
+ files: commit.files,
322
+ pullRequest: commit.pullRequest,
323
+ type: parsedCommit.type,
324
+ scope: parsedCommit.scope,
325
+ bareMessage: parsedCommit.subject,
326
+ notes: parsedCommit.notes,
327
+ references: parsedCommit.references,
328
+ breaking,
329
+ });
330
+ }
331
+ }
332
+ catch (_err) {
333
+ logger.debug(`commit could not be parsed: ${commit.sha} ${commit.message.split('\n')[0]}`);
315
334
  }
316
- }
317
- catch (_err) {
318
- logger.debug(`commit could not be parsed: ${commit.sha} ${commit.message.split('\n')[0]}`);
319
335
  }
320
336
  }
321
337
  return conventionalCommits;
@@ -35,7 +35,12 @@ class TerraformModule extends base_1.BaseStrategy {
35
35
  });
36
36
  // Update version in README to current candidate version.
37
37
  // A module may have submodules, so find all submodules.
38
- const readmeFiles = await this.github.findFilesByFilenameAndRef('readme.md', this.targetBranch, this.path);
38
+ const readmeFiles = await Promise.all([
39
+ this.github.findFilesByFilenameAndRef('readme.md', this.targetBranch, this.path),
40
+ this.github.findFilesByFilenameAndRef('README.md', this.targetBranch, this.path),
41
+ ]).then(([v, vt]) => {
42
+ return v.concat(vt);
43
+ });
39
44
  readmeFiles.forEach(path => {
40
45
  updates.push({
41
46
  path: this.addPath(path),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "14.5.0",
3
+ "version": "14.6.1",
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",
@@ -90,7 +90,7 @@
90
90
  "figures": "^3.0.0",
91
91
  "js-yaml": "^4.0.0",
92
92
  "jsonpath": "^1.1.1",
93
- "node-html-parser": "^5.0.0",
93
+ "node-html-parser": "^6.0.0",
94
94
  "parse-github-repo-url": "^1.4.1",
95
95
  "semver": "^7.0.0",
96
96
  "type-fest": "^2.0.0",