release-please 13.19.2 → 13.19.3

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,13 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [13.19.3](https://github.com/googleapis/release-please/compare/v13.19.2...v13.19.3) (2022-07-08)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * stop iterating if we fail to receive commits from a graphql query ([#1518](https://github.com/googleapis/release-please/issues/1518)) ([0f27cb5](https://github.com/googleapis/release-please/commit/0f27cb58d5a21e95a4f1a6c3fcfff019cdfdaff9))
13
+
7
14
  ## [13.19.2](https://github.com/googleapis/release-please/compare/v13.19.1...v13.19.2) (2022-07-06)
8
15
 
9
16
 
@@ -488,64 +488,72 @@ class GitHub {
488
488
  }
489
489
  }
490
490
  async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
491
- var _a;
491
+ var _a, _b;
492
492
  logger_1.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
493
- const response = await this.graphqlRequest({
494
- query: `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
495
- repository(owner: $owner, name: $repo) {
496
- ref(qualifiedName: $targetBranch) {
497
- target {
498
- ... on Commit {
499
- history(first: $num, after: $cursor) {
500
- nodes {
501
- associatedPullRequests(first: 10) {
502
- nodes {
503
- number
504
- title
505
- baseRefName
506
- headRefName
507
- labels(first: 10) {
508
- nodes {
509
- name
510
- }
493
+ const query = `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
494
+ repository(owner: $owner, name: $repo) {
495
+ ref(qualifiedName: $targetBranch) {
496
+ target {
497
+ ... on Commit {
498
+ history(first: $num, after: $cursor) {
499
+ nodes {
500
+ associatedPullRequests(first: 10) {
501
+ nodes {
502
+ number
503
+ title
504
+ baseRefName
505
+ headRefName
506
+ labels(first: 10) {
507
+ nodes {
508
+ name
511
509
  }
512
- body
513
- mergeCommit {
514
- oid
510
+ }
511
+ body
512
+ mergeCommit {
513
+ oid
514
+ }
515
+ files(first: $maxFilesChanged) {
516
+ nodes {
517
+ path
515
518
  }
516
- files(first: $maxFilesChanged) {
517
- nodes {
518
- path
519
- }
520
- pageInfo {
521
- endCursor
522
- hasNextPage
523
- }
519
+ pageInfo {
520
+ endCursor
521
+ hasNextPage
524
522
  }
525
523
  }
526
524
  }
527
- sha: oid
528
- message
529
- }
530
- pageInfo {
531
- hasNextPage
532
- endCursor
533
525
  }
526
+ sha: oid
527
+ message
528
+ }
529
+ pageInfo {
530
+ hasNextPage
531
+ endCursor
534
532
  }
535
533
  }
536
534
  }
537
535
  }
538
536
  }
539
- }`,
537
+ }
538
+ }`;
539
+ const params = {
540
540
  cursor,
541
541
  owner: this.repository.owner,
542
542
  repo: this.repository.repo,
543
543
  num: 25,
544
544
  targetBranch,
545
545
  maxFilesChanged: 100, // max is 100
546
+ };
547
+ const response = await this.graphqlRequest({
548
+ query,
549
+ ...params,
546
550
  });
551
+ if (!response) {
552
+ logger_1.logger.warn(`Did not receive a response for query: ${query}`, params);
553
+ return null;
554
+ }
547
555
  // if the branch does exist, return null
548
- if (!response.repository.ref) {
556
+ if (!((_a = response.repository) === null || _a === void 0 ? void 0 : _a.ref)) {
549
557
  logger_1.logger.warn(`Could not find commits for branch ${targetBranch} - it likely does not exist.`);
550
558
  return null;
551
559
  }
@@ -572,7 +580,7 @@ class GitHub {
572
580
  labels: pullRequest.labels.nodes.map(node => node.name),
573
581
  files,
574
582
  };
575
- if (((_a = pullRequest.files.pageInfo) === null || _a === void 0 ? void 0 : _a.hasNextPage) && options.backfillFiles) {
583
+ if (((_b = pullRequest.files.pageInfo) === null || _b === void 0 ? void 0 : _b.hasNextPage) && options.backfillFiles) {
576
584
  logger_1.logger.info(`PR #${pullRequest.number} has many files, backfilling`);
577
585
  commit.files = await this.getCommitFiles(graphCommit.sha);
578
586
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.19.2",
3
+ "version": "13.19.3",
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",