Docs/Developer Guide/Git & Contribution Workflow

Git & Contribution Workflow

Basis
CONTRIBUTING.md, .github/PULL_REQUEST_TEMPLATE.md, .github/CODEOWNERS, .githooks/pre-push, scripts/dev/install-git-hooks.sh.
License
Apache-2.0; contributions accepted under the Developer Certificate of Origin.

1. The normal path (CONTRIBUTING.md)

  1. Open an issue first for anything bigger than a bug fix.
  2. Branch from main, keep the change focused, include tests.
  3. Commit messages follow Conventional Commits, type(scope): summary, scope being the module or app — e.g. feat(knowledge): add web-crawl connector, fix(tenancy): ..., docs: ....
  4. Sign off every commit (DCO): git commit -s -m "fix(tenancy): ...".
  5. Open a pull request using the template and say exactly how you verified it.

The PR template asks for: what and why; how it was verified; and a checklist — commits signed off, new Flyway migration has a unique version across controlplane/ and tenant/ (bash scripts/ci/flyway-lint.sh), no secrets/tokens/personal data, docs or .env.example updated if behaviour or configuration changed. CODEOWNERS assigns default ownership and requires explicit maintainer review for migrations, core/crypto/, core/security/, .github/ and scripts/ci/. Security issues go through SECURITY.md, never a public issue.

2. Git hooks

make hooks                                 # once per clone; sets core.hooksPath = .githooks (or: bash scripts/dev/install-git-hooks.sh)
git config --unset core.hooksPath          # uninstall

Hooks live in the tracked .githooks/ directory, because .git/hooks is local and untracked. .githooks/pre-push reads the pushed refs and runs:

Push targetChecks run
mainThe full static-gates suite: Flyway lint, bean/entity name guards, expired test-skip check, plan-price and file-size ratchets — plus the secret scan.
Any other branch touching core/app/src/main/resources/db/migrationFlyway lint, plus the secret scan.
Anything elseSecret scan only. It is skipped with a message when gitleaks is not installed.
Why the hook exists
A Flyway version collision that reaches main through a local merge fires no pull_request event, so CI never sees it, and it stops every core instance at boot. The hook is local enforcement that catches this before the push; it protects only clones where it is installed, so also require the CI OK and Static gates checks with branch protection. git push --no-verify bypasses it — never use it on a migration change.

3. Working with worktrees

4. Merge, CI and deploy — what "done" means

Evidence & references