Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Git feature branch workflow is a simple, yet powerful way to develop new features in an encapsulated environment while at the same time fostering collaboration within the community. The idea is create short-lived branches where new development will take place and eventually merge the completed feature branch back into the main into trunk. A short-lived branch could mean anywhere from several days to several months depending on the extent of the feature and how often the branch is merged back into trunk.

Feature branches are also useful for changes which are not necessarily considered to be new features. They can be for proof-of-concept changes or architectural changes which have the likelihood of destabilizing trunk.

Benefits

  • Allows incremental work to proceed without destabilizing the main trunk of source control.
  • Smaller commits means smaller and clearer code reviews. 
  • Each code review is not required to be fully functional allowing a more agile approach to gathering feedback on the progress of the feature.
  • Maintains Git history and allows for code to be backed out easily after merging.

...

  • Requires frequent merges from trunk into  into your feature branch to keep merge conflicts to a minimum. 
  • May require period periodic merges of the feature branch back into trunk during development to help mitigate frequent merge conflicts.
  • No continuous integration coverage on feature branches. Although this is not really a drawback since most feature branches will break some aspects of CI in the early stages of the feature.

Guidelines to Follow

The following simple rules can help in keeping Ambari's approach to feature branch development simple and consistent.

...

  • When creating a feature branch, it should be given a meaningful name. Acceptable names include either the name of the feature or the name of the Ambari JiraJIRA. The branch should also always start with the text branch-feature-. Some examples of properly named feature branches include:
    • branch-feature-patch-upgrades
    • branch-feature-AMBARI-12345

...