Git and branching
GitFlow, branch naming, and what CI runs at each stage
We use Git to manage our code and use GitFlow as our workflow. Whenever possible, simply create a branch on the project repo rather than forking to another repository. This is because there are some workflows that only run on the main repository (such as build steps and Cypress cloud test submission). For testing it is important to have these workflows and artifacts in place. If you do not have proper permission to create a branch on the repository in question, please request access.
Branch naming
For each branch type defined by GitFlow, the following branch naming patterns are acceptable:
| Branch type | Pattern |
|---|---|
| main | main (preferred)mastertrunk |
| hotfix | hotfix/* - where * represents the semantic version number (e.g. hotfix/1.2.1) |
| release | release/* - where * represents the semantic version number (e.g. release/1.2.0) |
| develop | develop |
| feature | feature/* - new featureadd/* - new featureupdate/* - improve an existing featurefix/* - non-urgent bugfixestry/* - experimentsThe asterisks can be replaced with a descriptive name, or a ticket number. |
GitHub Actions
| Stage | Trigger | Actions |
|---|---|---|
| Feature | On push to a feature branch | Run linting and tests. Run a build (plugins and themes only) |
| Develop | On push or PR to the develop branch On alpha or beta release |
Run linting and tests. Run a build (plugins and themes only) Run linting and the full test matrix. Run a build (plugins and themes only) |
| Release | On push or PR to a release branch On a release candidate release |
Run linting and tests. Run a build (plugins and themes only) Run linting and the full test matrix. Run a build (plugins and themes only) |
| Hotfix | On push or PR to a hotfix branch On a release candidate release |
Run linting and tests. Run a build (plugins and themes only) Run linting and the full test matrix. Run a build (plugins and themes only) |
| Main | On push to the main branch | Run linting and full test matrix. Run a build (plugins and themes only) |
Version tagging conventions live in Releases. Who is permitted to review and release is covered in Code review and release restrictions.
Related
-
Releases and versioning
Release cadence, semantic versioning, and the tags each branch type may carry
-
Code review and release restrictions
Who reviews what, who is allowed to release, and the bar a PR must clear to merge