Skip to content

Commit

Permalink
Ensure that your own PRs assigned to yourself (e.g. via a team) do ap…
Browse files Browse the repository at this point in the history
…pear

It looks like the "review-requested" filter on GitHub Search filters out your own PRs, which means they wouldn't appear anywhere.

Fixes #764.
  • Loading branch information
fwouts committed Apr 25, 2020
1 parent d20ab58 commit 180acd5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/loading/internal/pull-requests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ describe("refreshOpenPullRequests", () => {
githubApi.loadComments.mockReturnValue(Promise.resolve([]));
githubApi.loadReviews.mockReturnValue(Promise.resolve([]));
githubApi.loadCommits.mockReturnValue(Promise.resolve([]));
const result = await refreshOpenPullRequests(githubApi, "author");
const result = await refreshOpenPullRequests(githubApi, "fwouts");
expect(result).toHaveLength(3);
expect(githubApi.searchPullRequests.mock.calls).toEqual([
[`review-requested:author is:open archived:false`],
[`commenter:author -review-requested:author is:open archived:false`],
[`review-requested:fwouts -author:fwouts is:open archived:false`],
[
`author:author -commenter:author -review-requested:author is:open archived:false`,
`commenter:fwouts -author:fwouts -review-requested:fwouts is:open archived:false`,
],
[`author:fwouts is:open archived:false`],
]);
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/loading/internal/pull-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ export async function refreshOpenPullRequests(
// Note: each query should specifically exclude the previous ones so we don't end up having
// to deduplicate PRs across lists.
const reviewRequestedPullRequests = await githubApi.searchPullRequests(
`review-requested:${userLogin} is:open archived:false`
`review-requested:${userLogin} -author:${userLogin} is:open archived:false`
);
const commentedPullRequests = await githubApi.searchPullRequests(
`commenter:${userLogin} -review-requested:${userLogin} is:open archived:false`
`commenter:${userLogin} -author:${userLogin} -review-requested:${userLogin} is:open archived:false`
);
const ownPullRequests = await githubApi.searchPullRequests(
`author:${userLogin} -commenter:${userLogin} -review-requested:${userLogin} is:open archived:false`
`author:${userLogin} is:open archived:false`
);
return Promise.all([
...reviewRequestedPullRequests.map((pr) =>
Expand Down

0 comments on commit 180acd5

Please sign in to comment.