Development workflow
Branch strategy
Work is done on feature branches off main. Branch names typically follow the pattern feat/<topic>, fix/<topic>, or chore/<topic>. After review, branches are squash-merged to main via GitHub pull requests.
Day-to-day cycle
- Pull latest
mainand create a feature branch. - Start the database and run migrations:
just db-migrate - Start the server:
just server # or, with auto-reload on source changes: just server-watch - Make changes, run the relevant tests (see testing).
- Lint before pushing:
cargo fmt --check cargo clippy --all-targets - Open a pull request against
main.
Key just recipes
| Recipe | What it does |
|---|---|
just server |
Run ocg-server with the default config |
just server-watch |
Run with watchexec for auto-reload |
just server-tests |
Run all Rust tests |
just db-migrate |
Apply pending schema migrations |
just db-create |
Create the main database |
just db-recreate |
Drop and recreate the main database |
just db-tests |
Run pgTAP database tests |
just db-contract-tests |
Run Rust DB contract tests |
just e2e-tests |
Run Playwright end-to-end tests |
just e2e-server |
Start server in e2e mode |
just lint-templates |
Run djlint on MiniJinja templates |
just lint-js |
Run prettier on JavaScript files |
Run just --list in the repository root for a complete reference.
CI checks
The CI pipeline (.github/workflows/ci.yml) uses path filters so only the jobs relevant to changed files run. Jobs include:
audit-dependencies—cargo auditfor known CVEslint-server—cargo fmt --checkandcargo clippytest-server—cargo testtest-database— pgTAP migrations and SQL teststest-database-contracts— Rust DB contract testslint-javascript—prettier --checklint-templates—djlintlint-markdown— markdown lintcheck-mcp—node --checkonmcp/server.mjs
A separate e2e.yml workflow runs Playwright tests. build-images.yml builds and pushes Docker images on pushes to main.
Adding a new database migration
- Create a new
.sqlfile indatabase/migrations/schema/with the next sequential number (e.g.,0100_my_change.sql). - Run
just db-migratelocally to verify it applies cleanly. - Never edit existing migration files — only add new ones.
Changing configuration
Configuration is loaded from a YAML file and OCG_* env vars. If you add a new config key, update ocg-server/src/config.rs and document the new key in reference/configuration.md.