Note: This page is still a work in progress and may contain incomplete or inaccurate data.
"Feature Branch" -- Any branch used to track distinct work related to a particular Azure DevOps ticket that has been reviewed by the team. This might include bug.123.release, story.123.release, or task.123.release branches.
"Merging" -- All references to merging X branch into Y branch refers to creating a Pull Request in Azure DevOps.
-
More Info | Workflow Example: Ideal Workflow
- Feature branches should ALWAYS be based on either the
mainbranch or another feature branch.
- Feature branches should ALWAYS be based on either the
-
More Info | Workflow Example: Ideal Workflow
- The
scotch-envbranch should only ever have feature branches merged into it. - The
staging.candidatebranch should only ever have feature branches merged into it. - The
release.candidatebranch should only ever have thestaging.candidatebranch merged into it - The
mainbranch should only ever have therelease.candidatebranch merged into it.
- The
New feature branches should always be based on either the main branch or another feature branch. This is to ensure that the branch can distinctly be merged into the scotch-env and release.candidate branches without any need for cherry picking.
graph LR
subgraph "Core"
scotch-env(fa:fa-code-branch scotch-env)
main(fa:fa-code-branch main)
staging.candidate(fa:fa-code-branch staging.candidate)
end
subgraph "Feature"
TASK[fa:fa-code-branch task.1]
TASK2[fa:fa-code-branch task.2]
TASK3[fa:fa-code-branch task.3]
end
main -.- TASK -.- TASK3
main -.- TASK2
When propagating the changes made in a feature branch, the branch should be merged separately to both the scotch-env branch and the release.candidate branch.
- If the intention is to deploy it to
scotch-envfor basic testing, the feature branch can be merged / deployed to thescotch-envbranch at any time. - When features in
scotch-envpasses QA, they can be merged intostaging.candidate - When all features in
staging.candidatepass regression, the branch can be merged intorelease.candidate
graph LR
subgraph "Feature"
FEAT[fa:fa-code-branch story.123]
end
subgraph "Core"
SCOTCH(fa:fa-code-branch scotch-env)
STAGING(fa:fa-code-branch staging.candidate)
RELEASE(fa:fa-code-branch release.candidate)
main(fa:fa-code-branch main)
end
FEAT --> SCOTCH & STAGING
STAGING --> RELEASE --> main
After a release, the scotch-env will need to be re-synced with the main branch. We can do this by back porting main into scotch-env after each release with a pull request
graph LR
SCOTCH(fa:fa-code-branch scotch-env)
main(fa:fa-code-branch main)
SCOTCH --> main
In this example:
task.123is created from themainbranch.task.123has changes added to it.- PR is made for
task.123intoscotch-envfor team to code review. task.123is merged toscotch-envfor dev and manual qa testing.- Once the feature has passed manual QA testing, PR is made for
task.123intostaging.candidate. - Once regression passes on
staging.candidatethe branch is merged torelease.candidate. release.candidateis merged intomainduring the release process.- The day after a release,
mainis back ported toscotch-env.
gitGraph
commit id:"..."
branch release.candidate
branch staging.candidate
branch scotch-env
checkout main
commit id:" "
checkout main
branch task.123
commit id:"commit 1"
commit id:"commit 2"
checkout scotch-env
merge task.123
commit id:"QA Passes" type: HIGHLIGHT
checkout staging.candidate
merge task.123
commit id:"Regression Passes" type: HIGHLIGHT
checkout release.candidate
merge staging.candidate
commit id:"Release to Prod" type: HIGHLIGHT
checkout main
merge release.candidate
commit id:"Backport"
checkout scotch-env
merge main
In this example:
task.123is created from themainbranch.task.123has changes added to it.- PR is made for
task.123intoscotch-envfor team to code review. task.123is merged toscotch-envfor dev and manual qa testing.task.123fails QA.task.123is reverted fromscotch-envvia the PR made in step 4.- The fix is implemented in the
task.123branch. - PR is made for
task.123intoscotch-envfor team to code review the fix. - Once the feature has passed manual QA testing, PR is made for
task.123intostaging.candidate. - Once regression passes on
staging.candidatethe branch is merged torelease.candidate. release.candidateis merged intomainduring the release process.- The day after a release,
mainis back ported toscotch-env.
gitGraph
commit id:"..."
branch release.candidate
branch staging.candidate
branch scotch-env
checkout main
commit id:" "
checkout main
branch task.123
commit id:"commit 1"
commit id:"commit 2"
checkout scotch-env
merge task.123
commit id:"Revert task.123 fails QA" type: REVERSE
checkout task.123
commit id:"Patch QA Issue"
checkout scotch-env
merge task.123
commit id:"QA Passes" type: HIGHLIGHT
checkout staging.candidate
merge task.123
commit id:"Regression Passes" type: HIGHLIGHT
checkout release.candidate
merge staging.candidate
commit id:"Release to Prod" type: HIGHLIGHT
checkout main
merge release.candidate
commit id:"Backport"
checkout scotch-env
merge main
This workflow will cover how to handle stories that rely on each other.
In this example we have story ticket 1 and story ticket 2. Ticket 1 is to create a new settings page. Ticket 2 is to add a form to that new settings page.
story.1.releaseis created from themainbranch.story.1.devis created fromstory.1.releasestory.1.devhas changes added to itstory.1.devis merged tostory.1.releasevia a PRstory.1.releaseis merged toscotch-envfor dev and qa testing via a PR- Once story 1 has passed regression it is then merged into
release.candidateby the QA team story.2.releaseis created from thestory.1.releasebranchstory.2.devis created from thestory.2.releasebranchstory.2.devhas changes added to it.story.2.devis merged intostory.2.releasevia a PRstory.2.releaseis deployed toscotch-envvia a PR- Once the story 2 has passed regression it is then merged into
release.candidateby the QA team - Later on, once the feature is released to production,
mainis back ported toscotch-envvia a PR to
gitGraph
commit id:"..."
branch release.candidate
branch scotch
checkout main
commit id:" "
checkout main
branch story.1.release
checkout story.1.release
branch story.1.dev
checkout story.1.dev
commit id:"commit 1.1"
commit id:"commit 1.2"
checkout story.1.release
merge story.1.dev
checkout scotch
merge story.1.release
commit id:"Regression 1 Passes" type: HIGHLIGHT
checkout release.candidate
merge story.1.release
checkout story.1.release
branch story.2.release
branch story.2.dev
commit id:"commit 2.1"
commit id:"commit 2.2"
checkout story.2.release
merge story.2.dev
checkout scotch
merge story.2.release
commit id:"Regression 2 Passes" type: HIGHLIGHT
checkout release.candidate
merge story.2.release
checkout main
merge release.candidate
commit id:"Backport"
checkout scotch
merge main