Code review

The principles and reasoning for code reviews are laid out in the General principles section of the Epiverse-TRACE blueprints. This section explores more of the technical details around conducting a productive code review.

The ways of working for code reviews within Epiverse-TRACE packages follows many of the guidelines covered in the Tidyteam code review principles. Instead of repeating all of the information from the Tidyteams documents here we highlight a few areas of similarity between the Tidyteam and Epiverse-TRACE for clarity.

One difference to highlight between the Tidyteam principles and Epiverse-TRACE is not directly related to code reviews and more to merging strategies. Within Epiverse-TRACE we prefer rebase and merge, to maintain a linear commit history, over the tidyverse preference of squash and merge.

Reviewers can be assigned in Github. Those assigned should review at their earliest convenience or notify the PR author assigning them that they are unable to review. It is not mandatory for reviewers to be assigned, and reviewing a PR without being assigned can help the PR author complete the merge sooner.

It is left to the maintainer or one of the authors of a package to merge the PR once reviewed. This ensures that code quality is maintained throughout development. The maintainer may be the PR author, in the case of requesting a code review from another member of the team, or may be the PR reviewer, when PR is opened by a contributor. PR authors cannot approve their own PRs even if they are the package maintainer.

Code review can be skipped in cases when the package maintainer or authors makes minimal changes, these include, but are not limited to: not touching user-facing functions, only changing package accessories (e.g. Github actions) or minor documentation fixes. In these cases a “Merge without waiting for requirements to be met (bypass branch protections)” option can be ticked and the PR can be merged. For more information on merging see the Standards for branching and merging.

If suggested changes fall outside the scope of the PR, utilise Github’s feature of generating issues from PR comments. Clicking the ellipsis in the PR comment and selecting “Reference in new issue” will open an issue with reference to the PR.