vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

Add ability to find PRs by authors on team (or multiple authors)

Open curtisgibby opened this issue 1 year ago • 2 comments

The Problem

I review PRs from lots of different people, with code review requests made against teams of users rather than on a user-by-user basis. If I'm first to review the PR, it works great to pull it up in the "Waiting For My Review" view (i.e. a query of is:open review-requested:${user}). But when someone else on my team has already submitted a review, the PR disappears from that view and tends to get lost in the "All Open" view (because there are a lot of irrelevant PRs pushing it down the list).

Current Workaround

I'm currently adding a query for each member of the teams that are relevant to me, like this:

{
    "label": "Me",
    "query": "is:open author:${user}"
},
{
    "label": "Adam",
    "query": "is:open author:asmith123"
},
{
    "label": "Greg",
    "query": "is:open author:gregsmith123"
},
{
    "label": "Jenny",
    "query": "is:open author:jennifersmith123"
},
{
    "label": "Josh C",
    "query": "is:open author:joshcarter123"
},
{
    "label": "Josh D",
    "query": "is:open author:joshdouglas123"
},
{
    "label": "Kate",
    "query": "is:open author:ksmith123"
},
{
    "label": "Rob",
    "query": "is:open author:rsmith123"
},
{
    "label": "Yvonne",
    "query": "is:open author:ysmith123"
}

This workaround is clunky for a couple of reasons:

  1. it adds a lot of vertical space to the PR tree
  2. when team members are added and removed, I have to manually update my settings.json to pull them into the query list

Proposed solutions

Query against authors by team (preferred)

I'd love to be able to add a query for "Created by My Team" so that relevant PRs are automatically pulled into my queue, regardless of whether they've been reviewed by someone else.

{
    "label": "Authored by Team A",
    "query": "is:open author:myorg/team-a"
},
{
    "label": "Authored by Team B",
    "query": "is:open author:myorg/team-b"
}

Query against multiple authors by username (better than nothing)

If it's not feasible to search by team directly, would it be possible to create an OR condition, to allow a single query to match multiple usernames? This would fix the "vertical space" problem, but not the "manually adding team members" problem.

{
    "label": "Authored by Team A",
    "query": "is:open author:{asmith123, gregsmith123, ysmith123, ${user}}" -- or whatever the syntax would look like
},
{
    "label": "Authored by Team B",
    "query": "is:open author:{jennifersmith123, joshcarter123, joshdouglas123, ksmith123, rsmith123}"
}

Technical challenges

I understand that these queries use GitHub search syntax, and I haven't ever been able to find a way to reference PRs by team name or by multiple authors using that logic.

If either of those functionalities already exists in the upstream GitHub search, it may be simply a matter of providing documentation to show how they work. If they don't exist, my proposed solutions might not be possible to accomplish in the code for this plugin, but upstream in the GH search itself.

curtisgibby avatar Jan 05 '24 18:01 curtisgibby

I just added a groupBy option for issue queries. Maybe we also need something similar for PRs.

alexr00 avatar Jan 19 '24 13:01 alexr00

I just added a groupBy option for issue queries. Maybe we also need something similar for PRs.

Yes please, this would be awesome to groupBy author...

dahu33 avatar Aug 23 '24 07:08 dahu33