Skip to content

Commit 124d7b8

Browse files
authored
Merge branch 'main' into release-please--branches--main--components--release-please-action
2 parents 8f6728b + 2023ce4 commit 124d7b8

3 files changed

Lines changed: 114 additions & 75 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ Release Please automates releases for the following flavors of repositories:
106106
| `minor` | Number representing minor semver value |
107107
| `patch` | Number representing patch semver value |
108108
| `sha` | sha that a GitHub release was tagged at |
109-
| `pr` | The PR number of an opened release (undefined if no release created) |
109+
| `pr` | The JSON string of the [PullRequest object](https://github.com/googleapis/release-please/blob/main/src/pull-request.ts#L15) (undefined if no release created) |
110+
| `prs` | The JSON string of the array of [PullRequest objects](https://github.com/googleapis/release-please/blob/main/src/pull-request.ts#L15) (undefined if no release created) |
110111

111112
## How release please works
112113

dist/index.js

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -80625,64 +80625,72 @@ class GitHub {
8062580625
}
8062680626
}
8062780627
async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
80628-
var _a;
80628+
var _a, _b;
8062980629
logger_1.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
80630-
const response = await this.graphqlRequest({
80631-
query: `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
80632-
repository(owner: $owner, name: $repo) {
80633-
ref(qualifiedName: $targetBranch) {
80634-
target {
80635-
... on Commit {
80636-
history(first: $num, after: $cursor) {
80637-
nodes {
80638-
associatedPullRequests(first: 10) {
80639-
nodes {
80640-
number
80641-
title
80642-
baseRefName
80643-
headRefName
80644-
labels(first: 10) {
80645-
nodes {
80646-
name
80647-
}
80630+
const query = `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
80631+
repository(owner: $owner, name: $repo) {
80632+
ref(qualifiedName: $targetBranch) {
80633+
target {
80634+
... on Commit {
80635+
history(first: $num, after: $cursor) {
80636+
nodes {
80637+
associatedPullRequests(first: 10) {
80638+
nodes {
80639+
number
80640+
title
80641+
baseRefName
80642+
headRefName
80643+
labels(first: 10) {
80644+
nodes {
80645+
name
8064880646
}
80649-
body
80650-
mergeCommit {
80651-
oid
80647+
}
80648+
body
80649+
mergeCommit {
80650+
oid
80651+
}
80652+
files(first: $maxFilesChanged) {
80653+
nodes {
80654+
path
8065280655
}
80653-
files(first: $maxFilesChanged) {
80654-
nodes {
80655-
path
80656-
}
80657-
pageInfo {
80658-
endCursor
80659-
hasNextPage
80660-
}
80656+
pageInfo {
80657+
endCursor
80658+
hasNextPage
8066180659
}
8066280660
}
8066380661
}
80664-
sha: oid
80665-
message
80666-
}
80667-
pageInfo {
80668-
hasNextPage
80669-
endCursor
8067080662
}
80663+
sha: oid
80664+
message
80665+
}
80666+
pageInfo {
80667+
hasNextPage
80668+
endCursor
8067180669
}
8067280670
}
8067380671
}
8067480672
}
8067580673
}
80676-
}`,
80674+
}
80675+
}`;
80676+
const params = {
8067780677
cursor,
8067880678
owner: this.repository.owner,
8067980679
repo: this.repository.repo,
8068080680
num: 25,
8068180681
targetBranch,
8068280682
maxFilesChanged: 100, // max is 100
80683+
};
80684+
const response = await this.graphqlRequest({
80685+
query,
80686+
...params,
8068380687
});
80688+
if (!response) {
80689+
logger_1.logger.warn(`Did not receive a response for query: ${query}`, params);
80690+
return null;
80691+
}
8068480692
// if the branch does exist, return null
80685-
if (!response.repository.ref) {
80693+
if (!((_a = response.repository) === null || _a === void 0 ? void 0 : _a.ref)) {
8068680694
logger_1.logger.warn(`Could not find commits for branch ${targetBranch} - it likely does not exist.`);
8068780695
return null;
8068880696
}
@@ -80709,7 +80717,7 @@ class GitHub {
8070980717
labels: pullRequest.labels.nodes.map(node => node.name),
8071080718
files,
8071180719
};
80712-
if (((_a = pullRequest.files.pageInfo) === null || _a === void 0 ? void 0 : _a.hasNextPage) && options.backfillFiles) {
80720+
if (((_b = pullRequest.files.pageInfo) === null || _b === void 0 ? void 0 : _b.hasNextPage) && options.backfillFiles) {
8071380721
logger_1.logger.info(`PR #${pullRequest.number} has many files, backfilling`);
8071480722
commit.files = await this.getCommitFiles(graphCommit.sha);
8071580723
}
@@ -88683,12 +88691,14 @@ class BranchFileCache {
8868388691
* @returns {TreeEntry[]} The tree entries
8868488692
*/
8868588693
async fetchTree(sha) {
88686-
const { data: { tree }, } = await this.octokit.git.getTree({
88694+
const { data: { tree, truncated }, } = await this.octokit.git.getTree({
8868788695
owner: this.repository.owner,
8868888696
repo: this.repository.repo,
8868988697
tree_sha: sha,
88690-
recursive: 'false',
8869188698
});
88699+
if (truncated) {
88700+
logger_1.logger.warn(`file list for tree sha ${sha} is truncated`);
88701+
}
8869288702
return tree;
8869388703
}
8869488704
/**
@@ -114285,7 +114295,7 @@ module.exports = {};
114285114295
/***/ ((module) => {
114286114296

114287114297
"use strict";
114288-
module.exports = {"i8":"13.18.7"};
114298+
module.exports = {"i8":"13.19.3"};
114289114299

114290114300
/***/ }),
114291114301

0 commit comments

Comments
 (0)