Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] Fetch full PR object to fix CPs #10856

Merged
merged 3 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ if (pullRequestNumber) {
...DEFAULT_PAYLOAD,
state: 'all',
})
.then(({data}) => _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title)).number)
Copy link
Contributor

@Julesssss Julesssss Sep 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we care about highlighting the case where we fail to get a matching PR with an error
? I think probably not as the logs should be clear enough (like the one we're currently fixing), but thought I'd ask.

.then(matchingPRNum => GithubUtils.octokit.pulls.get({
...DEFAULT_PAYLOAD,
pull_number: matchingPRNum,
}))
.then(({data}) => {
const matchingPR = _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title));
outputMergeCommitHash(matchingPR);
outputMergeActor(matchingPR);
outputMergeCommitHash(data);
outputMergeActor(data);
});
}
10 changes: 7 additions & 3 deletions .github/actions/javascript/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,14 @@ if (pullRequestNumber) {
...DEFAULT_PAYLOAD,
state: 'all',
})
.then(({data}) => _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title)).number)
.then(matchingPRNum => GithubUtils.octokit.pulls.get({
...DEFAULT_PAYLOAD,
pull_number: matchingPRNum,
}))
.then(({data}) => {
const matchingPR = _.find(data, PR => PR.user.login === user && titleRegex.test(PR.title));
outputMergeCommitHash(matchingPR);
outputMergeActor(matchingPR);
outputMergeCommitHash(data);
outputMergeActor(data);
});
}

Expand Down