microplane icon indicating copy to clipboard operation
microplane copied to clipboard

How to assign team reviewers?

Open caleb15 opened this issue 2 years ago • 3 comments

I tried assigning a an entire team as a reviewer when doing mp push but the PR had no reviewers. Is there a special syntax or something I need? Does microplane handle assigning a team as a reviewer? 🤔 I'm not sure if it's a bug or if I'm missing something.

mp push -a teamname -r eks_cicd-util mp push -a 15five/teamname -b 'Testing multi-repo changes with https://github.com/Clever/microplane. You can ignore this.'

caleb15 avatar Mar 27 '22 05:03 caleb15

@caleb15 thanks for the report!

I tried assigning a an entire team as a reviewer when doing mp push but the PR had no reviewers. Is there a special syntax or something I need? Does microplane handle assigning a team as a reviewer? 🤔 I'm not sure if it's a bug or if I'm missing something.

Today, microplane sets "assignees" but can't set "reviewers".

It seems Github doesn't support setting a team as an "assignee", although they do as a "reviewer". If of interest, here's some historical discussion on this feature suggestion: https://github.com/dear-github/dear-github/issues/170

Given these two things, it unfortunately doesn't support your current workflow.

nathanleiby avatar Mar 28 '22 06:03 nathanleiby

Solving this in microplane would require adding support for setting reviewers.

How assignees gets set today:

  • github API (https://docs.github.com/en/rest/reference/issues#add-assignees-to-an-issue)
  • relevant microplane code https://github.com/Clever/microplane/blob/568adcda022aebdb778f3118992ccafda81e730c/push/push.go#L124-L130

How reviewers could work:

  • Managing reviewers looks to now be available in Github's API https://docs.github.com/en/rest/reference/pulls#review-requests
  • Supporting it would require updating cmd/push.go (CLI interaction; add a new --reviewer flag) and push/push.go (Github API calls)
    • nit: could have >1 reviewer (or assignee) despite our support for just one today

nathanleiby avatar Mar 28 '22 06:03 nathanleiby

One other thought: At Clever one workaround here is to use CODEOWNERS files, which ensure microplane created PRs get reviewers set automatically.

nathanleiby avatar Mar 28 '22 06:03 nathanleiby