Skip to content

Show suggested reviewers and limit list to assignable users#1428

Merged
RMacfarlane merged 2 commits intomicrosoft:masterfrom
IllusionMH:suggested-reviewers-1424
Nov 1, 2019
Merged

Show suggested reviewers and limit list to assignable users#1428
RMacfarlane merged 2 commits intomicrosoft:masterfrom
IllusionMH:suggested-reviewers-1424

Conversation

@IllusionMH
Copy link
Contributor

Fixes #1424

This PR provides next improvements to add reviewers (quick)pick list:

  1. Suggested reviewers are displayed at the top of the pick list with suggestion reason below login and name.
    It is possible to add ⭐ before their logins to make suggested reviewers look more distinctive, but skipped this until review.

  2. Only assignable users are displayed in pick list instead of all mentionable users. Big improvement for list in some repos.

  3. List is now sorted by login (sort is case insensitive, same as quick pick built-in filter)

image

The only difference from GitHub that I've noticed is that I'm in list of suggested reviewers even if I already posted review - example from same PR.

It may be related to fact that GitHub has "Re-request review" for existing reviewers, but AFAIK this extension doesn't support this action so I left filtering out existing reviewers from suggested at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now it is properly typed as an array instead of a tuple with one element.
Not directly related to PR, but changed to match AssignableUsersResponse

@IllusionMH IllusionMH force-pushed the suggested-reviewers-1424 branch from f02f969 to 091e331 Compare October 30, 2019 03:45
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I've seen in a few repositories - suggested reviewers always were present in assignable users list.
Are there cases when it won't be true?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a safe assumption. I just tried removing a collaborator who was previously a suggested reviewer and they were removed from both lists

This comment was marked as outdated.

Copy link
Contributor Author

@IllusionMH IllusionMH Oct 31, 2019

Choose a reason for hiding this comment

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

After implementations comparison suggestedReviewers on PullRequestModel looks better than with separate request - pushed updated PullRequestModel

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, looks good

@IllusionMH IllusionMH force-pushed the suggested-reviewers-1424 branch from 091e331 to 98e9d86 Compare October 30, 2019 23:23
@IllusionMH
Copy link
Contributor Author

I also found collaborators connection on repository. It is accessible only to existing collaborators (should be OK when #1408 resolved, however will require additional checks) and in only repo where I was able to retrieve this data it was same as assignableUsers. I don't know what's exact difference between those lists.
Which one I should use for this PR?

@rebornix rebornix self-assigned this Oct 31, 2019
@IllusionMH IllusionMH force-pushed the suggested-reviewers-1424 branch 3 times, most recently from f8ee7ea to 767265c Compare October 31, 2019 00:34
@RMacfarlane
Copy link
Contributor

I found this doc on different permissions levels: https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#repository-access-for-each-permission-level

The row "Have an issue assigned to them" is checked for all permissions levels, so it seems to me like assignableUsers would always be identical to collaborators. From the collaborators connection you could also get information about what their permission level is, but seems a bit odd to have the same users returned on both, so maybe I'm still missing something. Continuing to use assignableUsers makes sense to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

can you also update the enterprise.gql file? this query and the above should work with the oldest supported github enterprise version https://developer.github.com/enterprise/2.16/v4/object/repository/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checked it yesterday to see if it has support and missed/failed somehow

@IllusionMH
Copy link
Contributor Author

@RMacfarlane I saw this doc however I still have some problems with understanding levels across different repos: looks like doc is only for orgs and doesn't mention collaborators role, however personal repos only has collaborators list.

Looks like Collaborator = Write from table, and only Write+ can "Submit reviews that affect a pull request's mergeability". Still cant find info if it still possible to ask for review from person even if their review can't affect mergability.

In any case - assignableUsers can be changed to collaborators later if needed.

@IllusionMH IllusionMH force-pushed the suggested-reviewers-1424 branch from 767265c to 4dac32a Compare November 1, 2019 02:05
Copy link
Contributor

@RMacfarlane RMacfarlane left a comment

Choose a reason for hiding this comment

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

This looks good to me! I will go ahead and merge it.

@RMacfarlane RMacfarlane merged commit f21a3b0 into microsoft:master Nov 1, 2019
@IllusionMH IllusionMH deleted the suggested-reviewers-1424 branch November 1, 2019 21:34
@IllusionMH
Copy link
Contributor Author

Thanks for review and suggestions!

@curtisgibby
Copy link
Contributor

curtisgibby commented Nov 1, 2019

This looks fantastic! I can't wait to try it out. Thanks folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reviewers should be listed in a "relevance" order

4 participants