release-please 13.10.0 → 13.10.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,16 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ### [13.10.1](https://github.com/googleapis/release-please/compare/v13.10.0...v13.10.1) (2022-04-13)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * bump retries for pull request iterator from 1 to 3 ([#1377](https://github.com/googleapis/release-please/issues/1377)) ([b2b7ff8](https://github.com/googleapis/release-please/commit/b2b7ff8ce98714ac591857b194ba0d51d9c2a641)), closes [#1376](https://github.com/googleapis/release-please/issues/1376)
13
+ * don't crash when pull request iterator GraphQL returns no response ([b2b7ff8](https://github.com/googleapis/release-please/commit/b2b7ff8ce98714ac591857b194ba0d51d9c2a641))
14
+ * fixed maxResults check in tag and release iterators ([#1378](https://github.com/googleapis/release-please/issues/1378)) ([6492a86](https://github.com/googleapis/release-please/commit/6492a86c56bbbb9b85f96bdf7edba910f1d66fc0))
15
+ * GraphQL retry now uses exponential backoff ([b2b7ff8](https://github.com/googleapis/release-please/commit/b2b7ff8ce98714ac591857b194ba0d51d9c2a641))
16
+
7
17
  ## [13.10.0](https://github.com/googleapis/release-please/compare/v13.9.0...v13.10.0) (2022-04-12)
8
18
 
9
19
 
@@ -59,17 +59,30 @@ class GitHub {
59
59
  return files;
60
60
  });
61
61
  this.graphqlRequest = wrapAsync(async (opts, maxRetries = 1) => {
62
+ let seconds = 1;
62
63
  while (maxRetries >= 0) {
63
64
  try {
64
- return await this.graphql(opts);
65
+ const response = await this.graphql(opts);
66
+ if (response) {
67
+ return response;
68
+ }
69
+ logger_1.logger.trace('no GraphQL response, retrying');
65
70
  }
66
71
  catch (err) {
67
72
  if (err.status !== 502) {
68
73
  throw err;
69
74
  }
75
+ logger_1.logger.trace('received 502 error, retrying');
70
76
  }
71
77
  maxRetries -= 1;
78
+ if (maxRetries >= 0) {
79
+ logger_1.logger.trace(`sleeping ${seconds} seconds`);
80
+ await sleepInMs(1000 * seconds);
81
+ seconds *= 2;
82
+ }
72
83
  }
84
+ logger_1.logger.trace('ran out of retries');
85
+ return undefined;
73
86
  });
74
87
  /**
75
88
  * Returns a list of paths to all files with a given name.
@@ -622,6 +635,7 @@ class GitHub {
622
635
  * @throws {GitHubAPIError} on an API error
623
636
  */
624
637
  async pullRequestsGraphQL(targetBranch, states = 'MERGED', cursor) {
638
+ var _a;
625
639
  logger_1.logger.debug(`Fetching ${states} pull requests on branch ${targetBranch} with cursor ${cursor}`);
626
640
  const response = await this.graphqlRequest({
627
641
  query: `query mergedPullRequests($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $states: [PullRequestState!], $cursor: String) {
@@ -665,8 +679,8 @@ class GitHub {
665
679
  targetBranch,
666
680
  states,
667
681
  maxFilesChanged: 64,
668
- });
669
- if (!response.repository.pullRequests) {
682
+ }, 3);
683
+ if (!((_a = response === null || response === void 0 ? void 0 : response.repository) === null || _a === void 0 ? void 0 : _a.pullRequests)) {
670
684
  logger_1.logger.warn(`Could not find merged pull requests for branch ${targetBranch} - it likely does not exist.`);
671
685
  return null;
672
686
  }
@@ -714,7 +728,7 @@ class GitHub {
714
728
  }
715
729
  yield response.data[i];
716
730
  }
717
- if (!response.pageInfo.hasNextPage) {
731
+ if (results > maxResults || !response.pageInfo.hasNextPage) {
718
732
  break;
719
733
  }
720
734
  cursor = response.pageInfo.endCursor;
@@ -799,6 +813,8 @@ class GitHub {
799
813
  sha: tag.commit.sha,
800
814
  };
801
815
  }
816
+ if (results > maxResults)
817
+ break;
802
818
  }
803
819
  }
804
820
  /**
@@ -975,4 +991,5 @@ const wrapAsync = (fn, errorHandler) => {
975
991
  }
976
992
  };
977
993
  };
994
+ const sleepInMs = (ms) => new Promise(resolve => setTimeout(resolve, ms));
978
995
  //# sourceMappingURL=github.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.10.0",
3
+ "version": "13.10.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",