Development Code Review Procedures and Guidelines
Development Code Review Procedures and Guidelines
This topic should give you as a developer a brief overview about what you should do, must do, aswell as can and can not do. What you as devepoler can expect from Armbian and what we expect from you.
Requirements:
Even though you may already be a developer, just to make sure, here is an outline of the expectations for this process:
Review | Approve | Merge | |
---|---|---|---|
Github ID | |||
Armbian Github Organisation Collaborator | |||
Armbian Github Organisation Member |
Armbian Organization Members are required to have:
- An account on Armbian Community Forums
- An account on Armbian Jira
- Enabled 2FA for their GitHub account
You should know development basics like how to get an Armbian image running on your hardware, do basic debugging, building a kernel and how to use the Armbian build system.
Code Review:
Some helpful guidelines for pull requests and code reviews
It has often been said that programming is part art, part science - that is because lots of times there is no single, simple solution to a problem. Or if there is, we might not know about it. There is also an infamous joke that if there are n developers in the room, then there are n+1 opinions on how things should be done. That being said, here are some guidelines that should prevent friction when submitting or reviewing code.
The most important thing
The code has to work.Unless you open a PR (“pull request”) as a work in progress, the code should be built and tested on a device or emulator. Do not rely on CI test automation!
If you have touched the build files and changed build setup, it is useful to test the whole build from scratch (clean build) and all of the types and flavours. If you updated external libraries, test the pertaining features. If you changed the build version, make a build and test that the version is correct.
Having people review your code is one thing, but you should not expect them to also test the code for you when not explicitly asked for.
Context
One important thing that lots of guidelines forget to mention is the context of the pull request: Sometimes it is a big refactor, sometimes it is a new feature, sometimes it is a bugfix. Some of those might be more urgent than others, and sometimes you might be under pressure to ship ASAP so the code might not be perfect or there will not be any tests or code might not be extendable. That is ok.
Everyone
As a Code Submitter
As a Reviewer
Merging a merge request
Before making the decision to merge:
If a pull request is fundamentally ready, but needs only trivial fixes (such as typos), consider demonstrating a bias for action by making those changes directly without going back to the author. You can do this by using the suggest changes feature to apply your own suggestions to the pull request.
Note that:
Authors are not authorized to merge their own pull requests and need to seek approval from another maintainer / developer to merge.
Armbian's Assistance
If you have questions about being a developer or want to learn more and deeper insights about the build framework, Armbian will try to guide you to the appropriate documentation or information in a best-effort fashion. If time allows, at our descrection, we will try our best to explain and teach you personally various aspects about our processes. If best effort guidance is not enough, contact us for professional assistance.
If you have any concerns please do not hesitate to reach out via forums, IRC or Discord. Armbian cares about the people who care about Armbian
References / Sources:
- https://github.com/thoughtbot/guides/tree/master/code-review
- https://github.com/blog/1943-how-to-write-the-perfect-pull-request
- https://blog.codinghorror.com/the-ten-commandments-of-egoless-programming/
- https://hackernoon.com/tagged/code-review
- https://hackernoon.com/the-art-of-pull-requests-6f0f099850f9
- https://gist.github.com/mrsasha/8d511770ad9b282f3a5d0f5c8acdd10e
- https://docs.gitlab.com/ee/development/code_review.html#everyone