Apply conversion script to all *.md files. authored by Alexander Hansen Færøy's avatar Alexander Hansen Færøy
= Development Workflow =
# Development Workflow
--------------------------------------
This is a proposed formalisation of our accepted common development workflow. This text is taken from one of the wiki pages of another project I work on, and I thought it was really convenient for preventing people from getting really confused about each other's git branches. We should discuss this, add any changes after discussing them, and finalise this. <(A)3 isis
== Overview / tl;dr ==
In addition to each ooni developer's personal repositories, there are two common repositories. The [https://gitweb.torproject.org/ooniprobe.git official one is here] on torproject.org. The other is [https://github.com/TheTorProject/ooni-probe on github], and is used mainly for our code review process between developers, although it also exists as a friendlier interface for pull requests from potential contributors.
## Overview / tl;dr
In addition to each ooni developer's personal repositories, there are two common repositories. The [official one is here](https://gitweb.torproject.org/ooniprobe.git) on torproject.org. The other is [on github](https://github.com/TheTorProject/ooni-probe), and is used mainly for our code review process between developers, although it also exists as a friendlier interface for pull requests from potential contributors.
The main branching workflow looks like this:
{{{
```
__________ ________
|==|=======| |==|=====|
| | tor | | | git |
......@@ -58,31 +58,31 @@ The main branching workflow looks like this:
*********** ** I don't want to draw | .------------------------------.
* ioerror * all of the things. '->( hellais/fix/####-supercatsulla )
*********** '------------------------------'
}}}
```
'''Create a new feature'''
**Create a new feature**
1. branch from develop
2. code
3. review
4. merge back into develop
'''Create a release'''
**Create a release**
1. branch from develop
2. bug fix
3. QA
4. tag, and merge back into develop and master
== Branches ==
See [http://nvie.com/posts/a-successful-git-branching-model/ A successful git branching model] for more information. The slight modification we make is that release tags are made in the release branch before getting merged to master, rather than getting tagged in master.
## Branches
See [A successful git branching model](http://nvie.com/posts/a-successful-git-branching-model/) for more information. The slight modification we make is that release tags are made in the release branch before getting merged to master, rather than getting tagged in master.
=== master branch ===
### master branch
HEAD always represents a production ready state.
* immortal: this branch lives forever
* merge from: release
* branch to: hotfix
=== develop branch ===
### develop branch
HEAD always represents staging for next release.
* immortal: this branch lives forever
......@@ -90,10 +90,10 @@ HEAD always represents staging for next release.
* merge from: release branches, feature branches.
* branch to: feature branches
=== testing branch ===
### testing branch
HEAD represents the tip of the branch currently being tested, rebased onto the develop branch.
The purpose of this branch is to push a temporary testing stage to [https://travis-ci.org/TheTorProject/ooni-probe Travis-CI].
The purpose of this branch is to push a temporary testing stage to [Travis-CI](https://travis-ci.org/TheTorProject/ooni-probe).
* named 'testing/<name of branch being rebased onto develop for testing>'
* mortal: only exists while waiting for the build results from the continuous integration system
......@@ -102,7 +102,7 @@ The purpose of this branch is to push a temporary testing stage to [https://trav
* commits: none
For example, if isis is reviewing hellais' code in hellais' branch 'fix/1234-fix-some-bug' and wants to check that merging the pull request into the current common staging area (the 'develop' branch) will not result in any unforeseen errors:
{{{
```
## update the commonly-shared staging area:
git fetch tpo-common
git checkout develop
......@@ -114,10 +114,10 @@ git checkout hellais/fix/1234-fix-some-bug
git checkout -b testing/hellais/fix/1234-fix-some-bug
git rebase develop
git push isislovecruft testing/hellais/fix/1234-fix-some-bug
}}}
```
=== release branches ===
One branch per release; only bugfix commits may be made directly on these branches. Once it is tagged (tag ''must'' be signed) with release version number, it gets merged back into both master and develop and is then killed off.
### release branches
One branch per release; only bugfix commits may be made directly on these branches. Once it is tagged (tag _must_ be signed) with release version number, it gets merged back into both master and develop and is then killed off.
* name starts with 'release-'
* mortal: live for a limited time
......@@ -129,20 +129,20 @@ One branch per release; only bugfix commits may be made directly on these branch
Creating a new release branch
straight git:
{{{
```
git checkout -b release-1.2 develop
./bump-version.sh 1.2
git commit -a -m "Bumped version number to 1.2"
}}}
```
with git-flow:
{{{
```
git flow release start <release>
}}}
```
Finalizing a release
straight git:
{{{
```
git checkout release-1.2
git tag -a 1.2 -s
git checkout master
......@@ -150,14 +150,14 @@ git merge --no-ff release-1.2
git checkout develop
git merge --no-ff release-1.2
git branch -d release-1.2
}}}
```
with git-flow:
{{{
```
git flow release finish <release>
}}}
```
=== feature branches ===
### feature branches
Most development happens here. Merges from and to develop branch only.
* mortal: live for a limited time
......@@ -165,59 +165,59 @@ Most development happens here. Merges from and to develop branch only.
* branch from: develop
* merge to: develop
'''Creating feature branch'''
**Creating feature branch**
straight git:
{{{
```
git checkout -b myfeature develop
}}}
```
with git-flow:
{{{
```
git flow feature start <feature>
}}}
```
'''Pushing/fetching feature branch to server (optional)'''
**Pushing/fetching feature branch to server (optional)**
straight git:
{{{
```
git push origin myfeature
}}}
```
with git-flow:
{{{
```
git flow feature publish <feature>
git flow feature pull <remote> <feature>
}}}
```
'''Merging feature back into develop'''
**Merging feature back into develop**
straight git:
{{{
```
git checkout develop
git merge --no-ff myfeature
git branch -d myfeature
git push origin develop
}}}
```
with git-flow:
{{{
```
git flow feature finish <feature>
}}}
```
'''Deleting remote branches after merge'''
**Deleting remote branches after merge**
straight git:
{{{
```
git push origin :myfeature
}}}
```
with git-flow:
{{{
```
funktion not implemented
}}}
```
=== hotfix branches ===
### hotfix branches
A temporary development branch for quick and urgent changes to the current master branch. It is like a release branch combined with a develop branch.
* name starts with 'hotfix-'
......@@ -225,14 +225,14 @@ A temporary development branch for quick and urgent changes to the current maste
* merge to: develop, master
Creating a hotfix branch
{{{
```
git checkout -b hotfix-1.2.1 master
./bump-version.sh 1.2.1
git commit -a -m "Bumped version number to 1.2.1"
}}}
```
Finalizing a hotfix
{{{
```
git checkout hotfix-1.2.1
git tag -a 1.2.1 -s
git checkout master
......@@ -240,4 +240,4 @@ git merge --no-ff hotfix-1.2.1
git checkout develop
git merge --no-ff hotfix-1.2.1
git branch -d hotfix-1.2.1
}}}
```