2.0 KiB
2.0 KiB
Git Flow Governance
Scope
Governance rules for branch protections, PR gates, branch naming, and merge discipline.
Branch Protection
Protected branches:
mainstaging
Apply protections using:
- Gitea UI settings
- or automation script:
.gitea/scripts/configure-branch-protection.sh
Minimum policy:
- no direct pushes
- PR merge required
- required status checks
- at least one reviewer approval
Branch Protection Verification Checklist
Use this checklist in Gitea repository settings after applying policy:
mainprotection exists and direct push is disabled.stagingprotection exists and direct push is disabled.- Required checks include:
Governance ChecksLint Typecheck Unit E2E
- Pull request approval is required.
- Branch must be up to date before merge (recommended in protected branches).
API automation example:
sh .gitea/scripts/configure-branch-protection.sh \
"$GITEA_URL" \
"$GITEA_OWNER" \
"$GITEA_REPO" \
"$GITEA_ADMIN_TOKEN"
Notes:
- The script applies baseline protection for
mainandstaging. - Final verification is still required in the Gitea UI to confirm repository-specific policies.
PR Gates
Required checks are implemented in .gitea/workflows/ci.yml:
- Governance Checks
- Lint Typecheck Unit E2E
Branch Naming and TODO Scope
Allowed branch prefixes:
todo/refactor/code/
Validation script:
.gitea/scripts/check-branch-name.sh
Rule:
- one primary TODO item per delivery branch
PR TODO reference enforcement:
- template:
.gitea/PULL_REQUEST_TEMPLATE.md - CI check:
.gitea/scripts/check-pr-todo-reference.sh
Branch Lifecycle
- Create short-lived branch from latest integration tip.
- Implement one primary scope.
- Open PR and pass required checks.
- Merge into
dev. - Promote
dev -> staging -> main.
Commit and Tag Policy
- Conventional commits required (
CONTRIBUTING.md) - release tags:
vX.Y.Z - changelog generated from commit history