Git flow and code reviews - DelphiWorlds/CodingStandards GitHub Wiki

Delphi Worlds use of git flow, along with our use of pull requests ensures quality code at all times.

Code reviews and pull requests

All development code should be done on feature branches (see git flow diagram below) and the only way it can be merged into develop branch is through a pull request (PR).

How to make a pull request

  • Push your local feature branch code the remote repo
  • Create a new PR on Github
  • Add any relevant reviewers; the Development Team Leader will be need to approve it
  • Check which branch the feature branch will be merged in to. In most cases you will be merging into the develop branch.

Anatomy of a good pull request (PR)

  • Clear, plain-speaking title
  • Clear description - this should give an overview of what was done in the feature, and should include the Github issue number
  • Confirmation that the PR was tested according to the test plans

Who merges PRs?

The project maintainer merges the feature into the official repository and closes the pull request

Code Reviews

How to review code properly

  • Foster a positive code review culture. Reviews should not be about placing blame but ensuring consistency and promoting quality
  • Leave comments inline so the context is clear
  • The advice from this post is extremely useful for code reviews

Git flow

The below diagram illustrates Delphi Worlds' git flow process for all projects, regardless of type

Git branch naming strategy

  • master (release)
  • develop (ongoing dev)
  • feature/<issuenumber>_<smalldescription> (pulled from develop, merged back into develop)
  • fix/<issuenumber>_<smalldescription> (pulled from develop, merged back into develop)
  • hotfix/<smalldescription> (pulled from master, merged back into master)

(Image borrowed from Nimbletank - please use above guide for naming) Delphi Worlds' Git flow diagram

Resources