Review Bots - The Idea
Review Bots - The Idea
I’ve been writing code and building solutions in IT for a while now.
It was relatively simple when I worked by myself; it was only me. I had my own expectations about how to implement a feature, or fix a bug. I did consider my future self, and future developers who may pick up the project.
However, I didn’t have someone else reviewing my code, or the size of my changes.
In other situations, I’ve worked with teams where everyone had different backgrounds and experiences. These people had a variety of experience collaborating and contributing to code.
Over the years, I’ve observed that everyone has varying expectations about what “good” looks like. This “good” thing could be some code, some tests, documentation, a user interface, and the list goes on.
But, this lead me to broadly thinking about people who are involved in contributing to a software project.
It could be their first contribution to an open source project. Or, their very first graduate position straight out of university. Or, their 20th year as a software engineer.
How do we help encourage and nudge people towards working well together? How do we help reviewers prioritise and choose which contribution to work on?
This led me to 2 ideas.
-
Let’s build a bot to help tell people about what’s expected of them.
-
Let’s build a bot to categorise Pull Requests to encourage people to make better contributions and help reviewers prioritise contributions.
The Bots
-
In GitHub, you can setup templates for Issues and Pull Requests.
As someone who’s new to this process, it may not clear about what is expected.
Or, you could be under pressure and forget to complete one of the activities.
This bot will comment on the Issue or Pull request until you’ve:
- filled in the description
- ticked all the activities, or marked them as not applicable.
This relies on people writing good Github templates, and providing ways to contact the maintainers, as these projects could be in a company, or an open source project.
-
In GitHub, a Pull Request is one way that you can contribute to a project. It allows you to propose a set of changes to files.
It’s better to make small and frequent changes when you’re changing a program. This minimises the risk of something breaking and allows for quick reviews. Imagine reviewing a sentence, compared with a 20 page document. It’s much easier to understand if a sentence has mistakes, rather than 20 pages of sentences. The other benefit of smalls changes is that when something breaks, it’s easier to undo and restore the last working version.
The Label bot adds 2 labels to a Pull Request. A
kind
and asize
. Both can be used however you like.A reviewer could look at the size tags to determine which PR to review before lunch.
You could setup a GitHub Action to remind people to make smaller PRs when they’re too large.
You could setup a Github Action to automatically merge Extra Small PRs.