TARAXA
|
In Taraxa, we are using git-flow workflow based on this git-branching-model.
master, develop
Feature branches, Hot-fix Branches, Release Branches Unlike the main branches (master, develop) these branches always have a limited life time since they will be removed eventually. Each of these branches have a specific purpose, e.g. developing a new feature.
Feature branches are used to develop new features and merged back to develop. Basically all features, bug-fixes, refactors, etc...
May branch off from:
develop
Must merge back into:
develop
Branch naming convention:
no prefix
is used as 99% of branches will be feature branches, such prefix would be redundant.
Same logic applies as for Standard feature branches
with one minor change. This is a feature that we expect to work on for relatively long time and multiple developers might be working on it simultaneously. They would use this feature/*
branch as base branch so it would basically become a temporary develop for them...
Such cases are rare though...
May branch off from:
develop
Must merge back into:
develop
Branch naming convention:
feature/*
Hotfix branches are very much like release branches in that they are also meant to prepare for a new production release, albeit unplanned. They arise from the necessity to act immediately upon an undesired state of a live production version. When a critical bug in a production version must be resolved immediately, a hotfix branch may be branched off from the corresponding tag on the master branch that marks the production version.
May branch off from:
master
Must merge back into:
develop
and master
Branch naming convention:
hotfix/*
Release branches support the preparation of a new production release. They allow for minor bug fixes (can be contained in bugfix branch) and preparing meta-data for a release. By doing all of this work on a release branch, the develop branch is cleared to receive features for the next big release.
Next, that commit on master must be tagged for easy future reference to this historical version. Finally, the changes made on the release branch need to be merged back into develop, so that future releases also contain these bug fixes.
May branch off from:
develop
Must merge back into:
develop
and master
Branch naming convention:
release/*
Every month will be deleted by automatic script(TODO):
When a developer is finished working on an feature or issue, another developer looks over the code and considers questions like:
Requiring code review before merging upstream ensures that no code gets in unreviewed. Another required action before enabling merge are successful builds and all kind of tests on all platform. At least 2 approvals are required before PR can be merged.
!!! Important: // If there were some new commits pushed to the base branch while working on your branch, always use rebase pull git pull --rebase origin <BASE BRANCH>>
In Taraxa, we are using commit messages based on this conventions.
A typical git commit message will look like:
<type>(<scope>): <subject>
build
: Build related changes (eg: npm related/ adding external dependencies)
chore
: A code change that external user won't see (won't affect him), e.g.: (change to .gitignore file, change to internal build system - jenkins, merge conflicts fixes, etc..)
feat
: A new feature
fix
: A bug fix
docs
: Documentation related changes
refactor
: A code that neither fix bug nor adds a feature. (eg: You can use this when there is semantic changes like renaming a variable/ function name)
perf
: A code that improves performance
style
: A code that is related to styling
test
: Adding new test or making changes to existing test
Scope must be noun and it represents the section of the section of the codebase, e.g. consesnus, dag, network, etc...
use imperative, present tense (eg: use "add" instead of "added" or "adds")
don't use dot(.) at end
don't capitalize first letter
We use github issues for tasks/tracking. To automatically link your PR to the github issue (and vice versa), use branch naming convention:
issue-<NUMBER>/*
e.g. :
issue-1234/new-best-feature
Let's take this doc change as an example.
standard feature
branch, so no prefix
for branch name should be useddevelop
issue-<NUMBER>/*
branch naming convention should be useddocs
commit type is usedgit-flow
in this example, code-related scopes might be for examples: consensus
, dag
, etc...git checkout develop git checkout -b "issue-760/proposed-git-flow-conventions" // do changes to the repo files... git add <files> git commit -m "docs(git-flow): added proposed conventions for git-flow (branches, commits)" git push origin issue-760/proposed-git-flow-conventions // If there were some new changes added to the develop branch in the meantime, use rebase pull git pull --rebase origin develop // create PR back to develop