We use a branching model that is a simplified version of Vincent Driessen's branching model, also known as Git Flow.
We have two main branches that are never deleted:
- The
master
branch always reflects a production-ready state. - The
develop
branch, which runs parallel tomaster
, always contains the latest delivered development changes for the next "release". We put "release" in quotes because we do not have versioned releases. We simply mergedevelop
intomaster
when we believedevelop
reflects a production-ready state.
We also two types of branches which are frequently created and deleted:
- A feature branch, prefixed with
feature/
, must branch fromdevelop
. It can be discarded, or merged intodevelop
and then deleted. A feature branch should have a cohesive goal. This includes implementing actual features, functionality which other feature branches require, or any other targeted well-scoped changes. Thedevelop
branch can be merged into a feature branch to pick up new changes. - A hotfix branch, prefixed with
hotfix/
, must branch frommaster
. It can be discarded, or merged into bothmaster
anddevelop
and then deleted. A hotfix branch should only be used to fix bugs onmaster
. Of course, we aim to minimize the use of hotfix branches by not introducing bugs intomaster
.
The text after branch prefixes should be in dash-case.
We mainly create issues for bugs on the two main branches, develop
and master
, or for new features. An intermediate step in the fixing of a bug or the development of a feature does not have an associated issue. Instead, intermediate steps are represented as task lists in issues comprising the entire bug or feature. Issues are displayed on the repository's single project board that is configured to use automated kanban with review.
All merges into the two main branches are reviewed.
We prefer commit messages in the present tense (i.e. "Adds..." over "Added...").
All non-trivial functionality should be tested. However, care must be taken to test the post-conditions and invariants of functions and classes, respectively, rather than irrelevant implementation details. See Testing Rails Applications for a primer on testing in Rails.