mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-09-15 22:21:51 +00:00
- Set dev as default branch, protect main (owner-only merge) - Add CI trigger for PRs targeting dev - Add PR template with checklist and branch targeting guide - Add CONTRIBUTING.md with branch strategy and review criteria - Update README clone command to use -b main for stable
2.7 KiB
2.7 KiB
Contributing to GoClaw
Branch Strategy
main (stable, protected — owner-only merge)
└── dev (default target for all PRs)
├── feat/xxx
├── fix/xxx
└── ...
Rules
- All PRs target
dev—mainis frozen for stable releases - Hotfixes — PR to
main, then cherry-pick todev - Releases — owner merges
dev→mainwhen stable - Direct push to
main— blocked (ruleset enforced)
Branch Naming
feat/description— new featuresfix/description— bug fixeshotfix/description— urgent production fixes (targetmain)refactor/description— code improvementsdocs/description— documentation changes
PR Guidelines
Before Submitting
go fix ./... # Apply Go upgrades
go build ./... # PG build check
go build -tags sqliteonly ./... # Desktop build check
go vet ./... # Static analysis
go test -race ./... # Tests with race detector
For web UI changes:
cd ui/web && pnpm build
PR Review Criteria
Based on our automated review checklist:
- Correctness: No logic errors, nil dereference, race conditions
- Security: Parameterized SQL, no hardcoded secrets, input validation
- Breaking changes: API contracts, DB migrations, config format
- Tenant isolation: All queries scoped by
tenant_id - i18n: User-facing strings in all 3 locales (en/vi/zh)
- SQLite parity: Changes compile with
-tags sqliteonly - Mobile UI:
h-dvhnoth-screen, 16px input fonts, safe areas
Commit Messages
Use conventional commits:
feat: add user preferences API
fix: prevent race condition in session cleanup
docs: update API reference for v2 endpoints
refactor: extract provider retry logic
Workflow
Developer Reviewer Owner
│ │ │
├─ create feat/xxx ──────────┤ │
├─ PR → dev ─────────────────┤ │
│ ├─ review + approve │
│ ├─ CI passes ──────────┤
│ │ ├─ merge to dev
│ │ │
│ │ (when stable) ├─ PR dev → main
│ │ ├─ merge → release
│ │ ├─ tag → CD triggers