Development¶
Contributor workflow for Ballet itself.
Workflow¶
Work is tracked as tickets; every branch is
feature/<ticket>_<short_title>fromdevelop; changes reachdevelopthrough reviewed pull requests;mainis the release branch.New behavior is developed test-first (Go, testify, table-driven tests).
Documentation is updated in the same change as the behavior it describes.
Make targets¶
The Makefile is the entry point for all routine tasks; CI runs the same
targets. make help lists them all.
Target |
Purpose |
|---|---|
|
Everything CI checks for Go and web: gofmt, vet, staticcheck, race tests, standalone module tests, build, web lint/type check/unit tests |
|
Go tests in every module (with the race detector) |
|
Go tests per module with |
|
gofmt (rewrite / verify) |
|
|
|
Service binaries into |
|
Binaries with the web UI embedded in Core / build and run the whole system (Run Ballet locally) |
|
Failure injection with the real binaries (below) |
|
Container images (Install Ballet on one host) / regenerate the Grafana dashboards |
|
|
|
Web dependencies, checks, Playwright end-to-end tests |
|
Documentation build, live preview, strict build + link check |
|
Remove build artifacts |
Before committing: make check and, when docs changed,
make docs-check.
Continuous integration¶
GitHub Actions (.github/workflows/ci.yml) runs on every pull request
and push to develop and main, with one job per area:
Job |
Runs |
|---|---|
Go |
|
Web |
|
Web e2e |
|
Agent (root) |
|
Failure injection |
|
Images |
|
Docs |
|
A pull request is merged only when all jobs pass.
Failure injection¶
make failure-test (core/test/failure) builds the real binaries and
runs Core, Knowledge, the LLM gateway, an agent
and the fake Anthropic API as processes on free ports, with an in-process
OIDC issuer. A shell script (fakeagent.sh) stands in for Claude Code:
it calls the gateway, works for a few seconds, calls it again and reports
a result. Each test starts a ticket on a one-stage pipeline and kills a
service (SIGKILL) while the session runs:
Core killed and restarted: the agent keeps the session and delivers its result to the new Core; the ticket finishes.
Agent killed and restarted: the session is lost; the stage fails and the ticket waits with a question for the humans.
Gateway restarted: the session’s next call reaches it; the ticket finishes.
Gateway down for good: the session fails; the ticket is flagged with a question.
The tests are skipped unless BALLET_FAILURE_TESTS=1 (the make target
sets it); a failing test prints the tail of every service’s log.