release-please 14.7.0 → 14.7.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,14 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [14.7.1](https://github.com/googleapis/release-please/compare/v14.7.0...v14.7.1) (2022-09-22)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * Handle pull request files returned as null ([#1651](https://github.com/googleapis/release-please/issues/1651)) ([4cea3dd](https://github.com/googleapis/release-please/commit/4cea3dd1b17ee31e27c1d246e83fcf39f28f0677))
13
+ * **node:** Rethrow missing file error for package.json as a configuration error ([#1652](https://github.com/googleapis/release-please/issues/1652)) ([65ee57b](https://github.com/googleapis/release-please/commit/65ee57b433f67d87db3c2530dad4207218dae6d2))
14
+
7
15
  ## [14.7.0](https://github.com/googleapis/release-please/compare/v14.6.1...v14.7.0) (2022-09-20)
8
16
 
9
17
 
@@ -490,7 +490,7 @@ class GitHub {
490
490
  }
491
491
  }
492
492
  async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
493
- var _a, _b;
493
+ var _a, _b, _c, _d;
494
494
  this.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
495
495
  const query = `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
496
496
  repository(owner: $owner, name: $repo) {
@@ -571,7 +571,7 @@ class GitHub {
571
571
  return pr.mergeCommit && pr.mergeCommit.oid === graphCommit.sha;
572
572
  });
573
573
  if (pullRequest) {
574
- const files = pullRequest.files.nodes.map(node => node.path);
574
+ const files = (((_b = pullRequest.files) === null || _b === void 0 ? void 0 : _b.nodes) || []).map(node => node.path);
575
575
  commit.pullRequest = {
576
576
  sha: commit.sha,
577
577
  number: pullRequest.number,
@@ -582,7 +582,7 @@ class GitHub {
582
582
  labels: pullRequest.labels.nodes.map(node => node.name),
583
583
  files,
584
584
  };
585
- if (((_b = pullRequest.files.pageInfo) === null || _b === void 0 ? void 0 : _b.hasNextPage) && options.backfillFiles) {
585
+ if (((_d = (_c = pullRequest.files) === null || _c === void 0 ? void 0 : _c.pageInfo) === null || _d === void 0 ? void 0 : _d.hasNextPage) && options.backfillFiles) {
586
586
  this.logger.info(`PR #${pullRequest.number} has many files, backfilling`);
587
587
  commit.files = await this.getCommitFiles(graphCommit.sha);
588
588
  }
@@ -19,6 +19,7 @@ const package_lock_json_1 = require("../updaters/node/package-lock-json");
19
19
  const samples_package_json_1 = require("../updaters/node/samples-package-json");
20
20
  const changelog_1 = require("../updaters/changelog");
21
21
  const package_json_1 = require("../updaters/node/package-json");
22
+ const errors_1 = require("../errors");
22
23
  class Node extends base_1.BaseStrategy {
23
24
  async buildUpdates(options) {
24
25
  var _a;
@@ -74,7 +75,15 @@ class Node extends base_1.BaseStrategy {
74
75
  }
75
76
  async getPkgJsonContents() {
76
77
  if (!this.pkgJsonContents) {
77
- this.pkgJsonContents = await this.github.getFileContentsOnBranch(this.addPath('package.json'), this.targetBranch);
78
+ try {
79
+ this.pkgJsonContents = await this.github.getFileContentsOnBranch(this.addPath('package.json'), this.targetBranch);
80
+ }
81
+ catch (e) {
82
+ if (e instanceof errors_1.FileNotFoundError) {
83
+ throw new errors_1.MissingRequiredFileError(this.addPath('package.json'), 'node', `${this.repository.owner}/${this.repository.repo}`);
84
+ }
85
+ throw e;
86
+ }
78
87
  }
79
88
  return this.pkgJsonContents;
80
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "14.7.0",
3
+ "version": "14.7.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",