-
Notifications
You must be signed in to change notification settings - Fork 54
Reviewing
This page summarises our principles and practices when reviewing pull requests (PRs).
- Every line of code should be seen by another pair of eyes
- Reviewing is an opportunity to share knowledge
- Make it clear who is reviewing issue or PR
- Every PR should preserve or increase code coverage
- Check it as a black box
- Check it as a white box
- Next steps
We don't push code directly into any of the REANA repositories on GitHub. Every line of code should be seen by another person than the author. Therefore, we require code reviews. These can be sometimes light, based upon reading the code differences, but more often they require full testing and attention to details.
In addition to checking the quality of the code, a review is an excellent way of sharing knowledge. Found some issue or possible optimization? Add a few more details to your PR comments to educate others.
When you review an issue or PR, assign yourself as an assignee or self-request review.
Example:
-
when reviewing an issue with one or more PRs, assign yourself to the issue, when reviewing PRs related to the issue self-request review;
-
when reviewing a PR without issue, self-request review.
It allows other team members to see who is responsible for the work.
If the pull request is not green, it isn't finished. Please always make the Continuous Integration (CI) pass first before asking for review.
Note, there are exceptions where a pull request set may be red. For example,
if implementing some feature requires to touch several REANA cluster
components, such as reana-job-controller
and reana-workflow-controller
, as
well as some changes to the shared reana-commons
component. Here it is possible that a PR to reana-job-controller
wouldn't be "green" until a
new version of reana-commons
is released on PyPI. What we do in these cases
is the following:
- We review the pull requests locally, making sure it is working;
- We release the approved
reana-commons
on PyPI; - We upgrade PRs for each other component of the PR set (i.e.
reana-job-controller
orreana-workflow-controller
) to depend on this newly releasedreana-commons
version.
This should make the two pull requests to pass CI tests.
Moreover, the commits will be nicely atomic, declaring that this new
functionality in reana-job-controller
is inherently dependent on some
reana-commons
version.
As a reviewer, you should first check whether the pull request is understandable from the "outside". That is, the pull request surface should make sense without reading the implementation. It is helpful to ask yourself the following questions:
- Is the goal of the pull request understandable from the commit message?
- Is it working as it should? Does it pass the integration tests?
- Is the bug fix or the new feature announced in the
CHANGES.rst
file?
As a reviewer, if the pull request works overall, and it is understandable on the "outside", it is time to look on the "inside".
- Does the implementation look good? Is the code idiomatic?
- Does the code follow the coding standards?
- Can the implementation fail for some corner cases?
- Is the runtime performance acceptable?
- Are all configuration variables centralised in one place and easy to alter?
Now that the pull request is reviewed, let's proceed with Integrating it.
REANA reproducible analysis platform
blog.reana.io | docs.reana.io | forum.reana.io | www.reana.io |
@gitter | @mattermost | @twitter
Introduction
Getting started
- Setting up your system
- Cloning sources
- Using production-like development mode
- Using live-code-reload and debug mode
Issue lifecycle
Understanding code base
Technology tips and tricks
- Tips for Docker
- Tips for Git
- Tips for GitLab
- Tips for Keycloak
- Tips for Kind
- Tips for Kubernetes
- Tips for OpenAPI
- Tips for PostgreSQL
- Tips for Python
- Tips for RabbitMQ
- Tips for SQLAlchemy