Aller au contenu principal

Contributing

Read the relevant specification in docs/specs/ before changing a module (start with project.md); answered design questions are in docs/specs/decisions/.

Git​

  • Conventional commits: type(scope): subject, types feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert; subject up to 72 characters, ! for breaking changes. Example: feat(members): add CSV import.
  • Every commit is signed (git commit -S, GPG or SSH signing key).
  • No Co-Authored-By trailer and no AI attribution in commits or pull requests; the commit-msg hook rejects co-author trailers.
  • Branch prefixes are the commit types: feat/, fix/, docs/, refactor/, chore/, ci/, test/, perf/. Never commit directly on main.

Hooks (lefthook)​

Install once with make hooks (go tool lefthook install). Configuration: lefthook.yml.

HookCheck
pre-commitgolangci-lint on staged *.go (tools/golangci-lint.sh), Biome on staged web files, ruff check on staged *.py (in parallel)
commit-msgtools/commit-msg.sh: conventional commit subject, no co-author trailer

Code style​

  • Google style for Go, TypeScript and Python. Doc comments: godoc (Go), TSDoc (TS), Google docstrings (Python); keep them short and only where needed.
  • Go is the backend language; TypeScript only for the frontend; Python only with a real incentive (vision).
  • Linters: golangci-lint (.golangci.yml: gofmt, goimports, gosec, revive, errorlint, …), Biome, ruff.
  • File size: target under 300 lines, 600 lines maximum. Generated files (protobuf, mocks, OpenAPI clients) and configuration files are excluded.
  • Code and developer documentation in English; UI and seeded data in French (with an English translation).

Rules for every change​

  • Configuration through env vars only; no data on local volumes (databases and S3 only).
  • Every list endpoint is cursor-paginated (pkg/pagination).
  • Every write is audited (pkg/audit), with identifiers only — no PII in audit records.
  • IDs: Keycloak ID for users, ULID elsewhere (pkg/ids).
  • Permissions: declare them in pkg/catalog, check them through authz (pkg/authzclient), deny by default.
  • Events go through the outbox (pkg/outbox); PII in events is encrypted per subject (pkg/cryptox).
  • Errors are RFC 9457 problems (pkg/problem).

Tests​

  • Coverage target 85–90 % (make cover).
  • Unit tests with fakes (make test-short), integration tests with testcontainers (make test, needs Docker).
  • Run make lint and make test before opening a pull request.

Adding a service​

  1. Create services/<name>/ with its own go.mod, add it to go.work, and cmd/<name>/main.go + internal/config (env vars, defaults suited to local development).
  2. Declare its permissions in pkg/catalog/permissions.go (elevated / sensitive flags where relevant).
  3. Write services/<name>/openapi.yaml: the API reference of this site is generated from it (add the service to docs/site/api-services.ts if it is not listed).
  4. Add a route in the gateway (GATEWAY_ROUTES) and a service in docker-compose.yml (profile apps).
  5. Document it: a page under docs/site/docs/dev/services/, the Kafka topics table, and the French user guide.

Documentation​

This site lives in docs/site (Docusaurus). pnpm build must pass: broken links and anchors fail the build. User documentation is written in French (docs/guide), developer documentation in English (docs/dev).