Branching Strategy
All Moko Consulting repositories follow this branching model.
Branch flow
feature/* --> dev --> main
Protected branches
| Branch | Direct push | Who can push | Merge via |
|---|---|---|---|
main |
Blocked | jmiller (whitelisted) | PR merge only |
dev |
Blocked | jmiller (whitelisted) | PR merge from feature/* |
rc/* |
Blocked | jmiller (whitelisted) | PR merge only |
alpha/* |
Blocked | jmiller (whitelisted) | PR merge only |
beta/* |
Blocked | jmiller (whitelisted) | PR merge only |
feature/* |
Open | Anyone | N/A (source branch) |
version/* |
Auto-created | CI bot | Auto-created by auto-release |
Developer workflow
-
Start from
dev:git checkout dev && git pull git checkout -b feature/my-change -
Make changes and commit to
feature/* -
Open a PR:
feature/my-change->dev -
After review and merge, open a PR:
dev->main(when ready for release) -
Merging to
maintriggersauto-release.ymlwhich:- Bumps version (minor)
- Builds ZIP/tar.gz
- Creates Gitea release
- Updates updates.xml
- Recreates dev from main
Automated cascading
cascade-dev.yml runs on every push to main and forward-merges changes to dev. If there are conflicts, it creates a PR automatically.
This ensures dev is never behind main after a release.
Pre-release channels
Use pre-release.yml (manual dispatch) to build from any branch:
| Channel | Tag | Use case |
|---|---|---|
| development | development |
Nightly/latest from dev |
| alpha | alpha |
Early testing |
| beta | beta |
Feature-complete testing |
| release-candidate | release-candidate |
Final validation |
Pre-releases cascade: stable deletes all, rc deletes beta+alpha+dev, etc.
Branch protection enforcement
Branch protection is applied org-wide via the Gitea API. The jmiller user is whitelisted for push on all protected branches because:
- CI workflows (cascade-dev, auto-release, pre-release) authenticate with
GA_TOKENwhich belongs tojmiller - All other contributors must use PRs
To verify protection on a repo:
curl -sf -H "Authorization: token $TOKEN" \
"https://git.mokoconsulting.tech/api/v1/repos/MokoConsulting/REPO/branch_protections" | jq