As a dev manager I’d always try to improve the performance on my team, and the code reviews are a key step to maintain quality and reduce prevent bugs.
However code reviews usually become a bottleneck due to problems like:
- People who take a lot of time to review.
- A few people gets a lot of reviews assigned, while others none.
- Some just “approve” the pull requests but don’t make a quality review.
The solution
To avoid it I made a Github action that analyzes the latests reviews and prints relevant stats to improve the team’s performance:
-
Average review time
: To make each one compare to others and try to be more efficient. -
# reviewed pull requests
: Useful to distribute more evenly the reviews among the team. -
# of comments
: An indicator of who is doing quality review and who doesn’t.
Add to your project
To get this insights, add this Github Action to your project.
Just create a file ./github/workflows/stats.yml
and add the following (no need to change anything):
name: Pull Request Stats
on: [push]
jobs:
stats:
runs-on: ubuntu-latest
steps:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@v1
That’s it! It will run and print the stats in your next Pull Request.
Bonus:
If you prefer more visual stats and add a bit of gamification, pass the option charts
and sort the table by your preferred metric:
name: Pull Request Stats
on: [push]
jobs:
stats:
runs-on: ubuntu-latest
steps:
- name: Run pull request stats
uses: flowwer-dev/pull-request-stats@v1
with:
charts: true
sort-by: 'COMMENTS'
You’ll end up with stats like this:
Top comments (1)
Pretty great stuff, hope to use it in a project one day!