microplane
microplane copied to clipboard
How to assign team reviewers?
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 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.
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) andpush/push.go
(Github API calls)- nit: could have >1 reviewer (or assignee) despite our support for just one today
One other thought: At Clever one workaround here is to use CODEOWNERS files, which ensure microplane created PRs get reviewers set automatically.