-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GitHub action for auto-requesting code owner reviews. #3471
Add GitHub action for auto-requesting code owner reviews. #3471
Conversation
I am not very familiar with GH Actions and find it challenging to test. I would appreciate reviews from those with more experience. It would also be helpful if you could test it yourself. Or just use it as an inspiration for a proper solution. |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3471 +/- ##
=======================================
Coverage 20.29% 20.29%
=======================================
Files 198 198
Lines 45268 45268
=======================================
+ Hits 9188 9189 +1
+ Misses 35396 35395 -1
Partials 684 684 ☔ View full report in Codecov by Sentry. |
082eb8e
to
dc36222
Compare
Fixed the Yetus checks. |
I was thinking this is the default behavior of the GitHub, when codewners file is filled in. What's new in the behavior? |
@rouming , it handles the code owners without write permissions. I've mentioned it in the commit message |
reviewers_cleaned=${reviewers//@/} | ||
reviewers_comma_separated=$(echo "$reviewers_cleaned" | tr ' ' ',') | ||
echo "Requesting review from: $reviewers_comma_separated" | ||
#echo gh pr edit ${{ github.event.pull_request.number }} --add-reviewer $reviewers_comma_separated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented code, is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, nope. That's how I tested it. Will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW way I test GHA is i create fork and enable workflows there, for small actions it'll do :)
dc36222
to
b60ef7c
Compare
FYI @europaul |
@OhmSpectator you can use https://github.com/nektos/act to test the GH action. I'm not a big fan of it, because it usually fails on not having access to the right secrets, but here you can use your own GitHub tocken, so I think it should work fine |
Thanks! I'll take a look! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, as long as @OhmSpectator tested it either way and it worked :)
Youth and rage! Be a rebel! Merge into master without tests! Just kidding... I will try the approach proposed by @europaul later when I have time. |
…ews. This new GitHub Action automatically requests reviews from code owners when a pull request is opened or updated. It fetches the necessary number of commits related to the PR and identifies the appropriate code owners based on the changed files. This is particularly useful as most of the code owners do not have write access to the repository, and thus are not automatically assigned by GitHub. Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
b60ef7c
to
7b14d83
Compare
I've tested it with the |
I suggest we merge it and see how it works with our real PRs. Since it does not touch any dangerous functionality, we can afford to test it under real conditions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I agree 👍 |
This new GitHub Action automatically requests reviews from code owners when a pull request is opened or updated. It fetches the necessary number of commits related to the PR and identifies the appropriate code owners based on the changed files. This is particularly useful as most of the code owners do not have write access to the repository, and thus are not automatically assigned by GitHub.