Git Solution Team Conventions
A section to specify any agreed apon conventions our team follows in respect of GITBranch Prefixes
The Below prefixes are to be added to all branch names as a team standard convention.| Prefix | Branch Type | Related to |
|---|---|---|
| bug/ | Bug Resolve | A bug in existing code, doesn’t work as dev expected |
| enh/ | Enhancement Branch | A tweak or improvement on existing functionality |
| hot/ | Hotfix Branch | A hotfix launched straight to production |
| iss/ | Issue | An issue experienced by a user, something missed or wrong with existing functionality |
| fea/ | Feature Branch | Adding new functionality that didn’t exist |
Gihub saved replies
Use GitHub saved replies to help quickly add commonly used templates for issues, pull requests etc. GitHub saved repliesBuilding a pull request (PR)
To build a PR you can checkout a branch using the branch prefix convention mentioned above.git checkout -b fea/feature-name
There are a number of options to use as your base branch when checking out a new branch:
- In most cases you will use the
developbranch as a base - If you are doing work that requires the code from an existing PR branch, you checkout from that branch.
- If you are working on a hotfix you can branch off of the
mainbranch
Launching a pull request
When launching a pull request (PR):- Click the back arrow to add the Pull Request saved reply, this will add the PR checklist
- Launch in DRAFT - Select the arrow next to the
Create pull requestbutton and select Create draft pull request
Completing a PR checklist
Campus and Partner Applications
Gamma
gulp and gulp tailwindcss need to be run in order to minify any new CSS classes added to the branch. These minified classes are the ones used for styling on production, so without running these commands, the styling changes will not render correctly.
Similarly, the functions.php version needs to be bumped if:
- any new Tailwind classes have been added
- any changes have been made to the legacy themestyles
.scssand.jsfiles for them to render correctly on production.
Publishing the PR
Once the checklist has been completed, you can publish the PR by clickingReady for review at the bottom of the PR
Releases
During the development process a number of Pull Requests and code changes are made to thedevelop branch. At certain intervals you will want to release these changes to the production application. This article outlines the flows to achieve this. Note that most apps will have an intermediary branch and environment in between develop and production called staging. The staging environment is used to test the release before it goes to production. In addition to this, some apps will break up the testing phase into two distinct phases: internal UAT (which is represented by the qa branch and qa environment), and external UAT (which is represented by the staging branch and staging environment). For those apps with a simplified testing phase, the qa branch and environment will not exist and references to it in these docs can be ignored.
Production release flow
1. Launch to QA (internal UAT)
When code is ready for internal UAT (QA phase) you will mergedevelop into the qa branch. If an application is of a certain level, there will be a dedicated QA environment linked to the qa branch. This will allow an internal (non-dev) UAT process and to finalise that the release is stable for external UAT.
The time period that a release remains at this phase depends on requirements of the application and stakeholders.
Applications that are not yet in production do not usually require staging environment to speed up development. The flow can go straight to checklist (3)
2. Changes to release during QA period (internal UAT)
Small changes and PR merges are common during a QA period, but usually only critical changes (or insignificant changes) that will stabilise the release during the QA period are considered. All changes to QA can be done via direct commits or PR merges with theqa branch. These changes need to then be merged back into the develop branch.
3. Launch to staging (external UAT)
When code has passed internal UAT and is ready to be staged for external UAT release you will merge theqa branch into staging branch. If an application is of a certain level, there will be a dedicated staging environment linked to the staging branch. This will allow an external (non-dev) UAT process and to finalise that the release is stable for production.
The time period that a release remains at this phase also depends on requirements of the application and stakeholders. For the Salt Campus, the recommended staging period is 1 week. ie: the release is staged on the staging environment for a week prior to production release.
Applications that are not yet in production do not usually require staging environment to speed up development. The flow can go straight to checklist (3)
4. Changes to release during staging period (external UAT)
Small changes and PR merges are common during a staging (external UAT) period, but usually only critical changes (or insignificant changes) that will stabilise the release during the staging period are considered. All changes to staging can be done via direct commits or PR merges with thestaging branch. These changes need to then be merged back into the qa and develop branches.
5. Create release PR and complete the release checklist
When a staged release has passed external UAT and is ready for production release, you need to create a release PR and the following checklist needs to be completed (in order).6. Process release
You can now process the release by merging the release PR intomain / master. Once merged the automatic deployments should process and you can watch the Slack dev ops channels for notifications of successful release.
If the release was successful:
- Double check the production applications are working as expected
- Announce the release to stakeholders sharing release notes
- Merge
main/masterback intoqaandevelopbranches
Hotfix release flow
- Branch off of
masterwith hotfix branchhotfix/* - Create release PR pointing to
masterwith hotfix notes - Stakeholders review hotfix
- Merge with
masterto launch release - Merge
masterback intostaginganddevelop
