Lately we switched our version control (GIT) workflow to better control our QA, and each phase of it, in our regular development / code-deployment process.
- Version control system (GIT).
- Task management (redmine).
- Remote server assignments (Jenkins).
- Hotfix - Short term task (no more than a few hours), with a single developer.
- Release - Long term task (usually a few tasks with the same theme), with multi developers. Or just one of the two.
- Master branch - is the stable branch, which acts as feeder to all of the developers’ feature branches. Updated only by the QA guy with approved production tags. Master is updated with the current production tag.
- Feature branches for release-type tasks - remote gets updated.
- Feature branches for hot fixes - remote does not get updated, local branch only.
- Local - developers’ local environments.
- Development (multi) - for pre QA testing and sharing. Updated using GIT tags.
- Stage/QA (multi) - updated only by QA with GIT tags.
- Production - updated only by QA with approved GIT tags.
- All work is done in feature branches.
- Never update Master branch.
- Master branch will be updated only by QA from approved GIT tag.
- Feature branches are updated (merge) frequently from Master branch.
- Done tasks will be committed and tagged, e.g. q-1.1, and pushed to remote.
- Feature branch gets deleted once it’s no longer needed.
- Tags are tested one at a time. A new tag gets tested after the previous one has finished the cycle, and has been updated on Master branch:
- The new tag is checked out and merged-to from Master (with the latest approved features in it).
- Stage environments are updated with testing tag, e.g. r-1.1, which contains Master branch (equal to prod) with the new feature.
- Approved tags are re-tagged, e.g. p-1.1, for production update.
- Approved tags are merged into Master, for feeding all developers and next tags.
- Create a new branch updated and equal to Master.
- If it’s a release task, push the branch to remote.
- Perform the task, in the best way you can, and commit.
- Merge from Master (git pull to update local Master from remote Master, and then git merge to your branch from local master).
- Tag the current state for QA testing, e.g. q-1.1.
- Push the tag to remote and assign the task as QA in the issue tracking system.
- Fetch the tag and checkout to be on it.
- Merge from Master branch, to get the latest approved features and updates.
- Create a new tag for a stage test, e.g. r-1.1, which contains Master branch (equal to prod) with the new feature.
- For approved tags, re-tag for production, e.g. p-1.1.
- Update production with the new tag and test the environment.
- Merge to Master the latest tag and push Master to remote.
- Close the task in the issue tracking system.
In GIT language:
For QA guy:
Get all tags
git fetch --tags
Move to the tag
git checkout q-1.1
Update from Master
git merge master
Create new tag for testing
git tag r-1.2
Push the tag to remote
git push origin r-1.2 / git push --tags
Test on stage and approved
Move to the approved tag
git checkout r-1.2
Create new tag for update production
git tag p-1.1
Push the prod tag to remote
git push origin p-1.2
Update Prod test and approve
Move to Master branch
git checkout master
Merge the approved prod tag to Master
git merge p-1.1
Push updated Master branch to remote
Create new feature branch up from master
git checkout -b f1234
git commit -am”message”
Update local master from remote
git pull origin master:master
Merge feature branch from master
git merge master
Make sure nothing break
Create tag for QA testing
git tag q-1.1 -am”message”
Push the tag to remote and QA
git push origin q-1.1 OR git push --tags (for all)
Coming back to master
git checkout master
Delete feature branch
git branch -D f1234