Skip to content

Git Workflow

Branch, commit, and PR conventions for dichit-backend.

Commit messages (Conventional Commits)

Commit messages are validated by commitlint (.commitlintrc) using Conventional Commits. Releases are automated by release-please, which derives versions/changelogs from these messages — so message quality directly affects releases.

type(scope): subject

feat(auctions): add bid cancellation endpoint
fix(ws): handle stale snapshot on reconnect
chore(deps): bump @fastify/websocket
refactor(payments): extract gateway adapter

Common types: feat, fix, chore, refactor, test, docs, perf, revert. Breaking changes: append ! (e.g. feat!(users): drop v1 field) or a BREAKING CHANGE: footer.

Branching

Environment branches drive deploys (see deployment/ci-cd.md):

dev        ← auto-deploys to the development environment (cd-dev.yml)
staging    ← auto-deploys to staging (cd-staging.yml)
prod       ← production; release-please + prod-release runs here
feature/xyz← work in progress (PR)
fix/xyz    ← bug fixes
docs/xyz   ← documentation-only changes
flowchart LR
    F["feature/*"] -->|PR| DEV[dev]
    DEV -->|promote| STG[staging]
    STG -->|promote| PRD[prod]
    PRD --> R["release-please → version + changelog"]
    R --> CDP["prod-release.yml"]
  • Keep branches small and short-lived.
  • Rebase on the target branch before opening/updating a PR.
  • Production merges to prod are back-merged to dev automatically (backmerge.yml) so environments don't drift.
  • No direct pushes to dev/staging/prod.

Pull requests

  • Use the repo PR template (see .github/ / apply-pr-template.yml).
  • PR CI runs ci.yml: lint, typecheck, build, unit + functional tests, plus security scans (see deployment/ci-cd.md).
  • Update docs in the same PR as the behavior change (see contributing.md).
  • Squash-merge with a clean Conventional Commit message.

Pre-commit hooks

  • husky + lint-staged: prettier + eslint on staged files.
  • commitlint-msg validates the commit message.
pnpm prepare   # install hooks after clone (already run at install)

Full local verification before pushing

pnpm docker:test:up -> pnpm check -> pnpm build:ci -> pnpm test -> pnpm docker:test:down

Releases

release-please creates version bumps + CHANGELOG.md from Conventional Commits and drives the deploy pipelines (see release-process.md).