-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Pre-merge Code Reviews #6916
Comments
👍 |
interesting read: The Pitfalls of Code Review (And How To Fix Them)
|
I like the idea of code reviews. |
+1 for the label, that's a really good idea to prevent PRs to be forgotten. It would also be easy to bookmark a github search to find all PR to review in all projects (including piwik pro). |
+1 for labels, I was wondering how we could manage this, and that's great idea! |
Created a Needs Review label, feel free to rename if you have a better idea. Let's start using it! |
FYI @piwik/core-team From now on, you can please add a label |
@mattab is there any reason to keep this issue open now? The RFC can be closed I guess, it's been open for more than 1 month and nobody seemed against that. |
sounds good, created little follow up issue: Add info about Pre-merge Code Reviews in the "contributing to Piwik" guide #7210 |
I have a question for core team developers: after we have reviewed a pull request, would it make sense that the reviewer remove the |
or remove the label and merge directly? |
I was wondering, only in the case when the PR has actually some feedback that needs to be acted on, code to be changed, etc. |
A common practice I see in open source projects is to have one-two people do the review and comment the PR. Either there are things to discuss or fix, either it's all good (usually people write LGTM or 👍). Then the person that opened the PR can merge. |
Note: one of the important things to check for in pre-merge core reviews is that all new functionality is covered by tests, ideally unit tests. We need to make sure that we don't introduce as few bugs as possible and this mix of Pre-merge code reviews + Ensuring tests cover it all, should make huge positive difference 👍 |
The goal of this issue is to discuss and possibly introduce a new process when developing code on the Piwik git repository: introducing Pre-merge code reviews.
The Rules
The Rules apply to this
piwik/piwik
repository as well as allplugin-*
repositories inpiwik
andPiwikPRO
Github organizations.For minor changes (typos, small bugs, trivial features), you are allowed to push to master directly. For any large change, always push to a separate branch per logical unit (story, feature, bug, optimisation, refactor, improvement).
This helps to ensures that code is in fact reviewed.
When you are finished with a task, you notify the other team members that your work is ready for final review. Then you review existing branches. Before picking up a new task, you look at all open pull requests (including unfinished ones) and review the changes since the last time you checked.
Merging a pull request is the responsibility of the whole team. A pull request can not be merged when someone in the team does not understand the code or the reasoning, or does not agree with the solution.
The Benefits
Having multiple sets of eyes review a pull request before it gets merged to master or an integration branch, is a great way to catch defects early. At this time, they are usually still cheap to fix.
There are however much more important benefits. Instead of individual developers, the team is responsible for the internal and external quality of the code. This is a great remedy against the blame culture that is still present in many organisations. Managers or team members can no longer point fingers to an individual for not delivering a feature within the expected quality range. You tend to become happier and more productive, knowing that the team has your back. You can afford to make a mistake; someone will find it quickly.
Another effect is something called ‘swarming’ in Kanban. Because you are encouraged to help out on other branches before starting your own, you start to help others finishing work in progress. Stories are finished faster, and there’s a better flow throughout the system. Especially when stories are difficult, or when stories block other stories, it’s liberating to have people come and help you to get it done.
And of course, there’s all the benefits from the clear sense of code co-ownership. It’s invaluable to have a team where everybody knows what the code does, why it’s designed that way, how everything fits together. It also reduces the Bus Factor: no single team member is a bottleneck. Best practices are shared, and the code is more consistent. Opportunities for reuse are spotted before lots of duplication happens.
In short, pre-merge code reviews grow the team’s maturity.
For more information (tips and anti-pattern to avoid) read the original post that inspired this issue.
--> What do you think?
The text was updated successfully, but these errors were encountered: