Contributing
#Prerequisites
mise installs the pinned Go, prek, gotestsum and pinact:
mise install
prek install # hooks on every commit: gofmt, go mod tidy, go vet (macOS and Linux), go test, Markdown, pinned Actions
cp config.example.json config.json
# Edit config.json: set at least one notifierGo standard library only: don't add a module.
#Running locally
make run # go run ./cmd/baba start --config config.json
make build # cross-compile release binaries into ./dist (VERSION=x.y.z)
make docker # build the image#Tests
make test # unit tests, then integration tests that build and drive the real binary
make cover # coverage of cmd/ and internal/ across all tests; fails under 70%
make lint # every prek hook on every fileIntegration tests run baba against the host it runs on (thresholds at 0 so every check alerts) and send alerts to a fake Discord webhook.
docs/env.md and schema/config.schema.json are written by hand; unit tests
fail when they drift from the Config struct and its env vars.
#Adding a notifier
- Add its fields to
config.Notifierand its validation toConfig.validate - Add its request to
notify.Alert - Add its
BABA_NOTIFIERS_*env vars toapplyEnv - Document it in
docs/notifiers.md,docs/env.mdand the schema
#Release process
Every merge to main ships a canary (vX.Y.Z-canary.N, a GitHub prerelease and
the :canary image), versioned from Conventional Commits. The stable release
waits in the chore(release): X.Y.Z PR; merging it cuts vX.Y.Z, which
baba update and the install script pick up.
To contribute:
- Fork the repository
- Create a new branch for your changes
- Make your changes and commit them
- Push your changes to your fork
- Create a pull request against the main repository
This guide lives in the project repo: edit it there, and this page follows with the next release.