Thanks for your interest in improving Forge. This guide covers how to get set up, what's expected of a change, and how to get it merged.
- Go 1.25+
- Task (optional but recommended —
brew install go-task) - Docker + Docker Compose (only for integration tests)
- golangci-lint v2.12.x — CI pins this version; match it locally to avoid surprises.
git clone https://github.com/datariot/forge
cd forge
task test # or: go test ./...task test # unit tests with the race detector
task test:coverage # coverage report (opens coverage.html)
task test:integration # integration tests — starts PostgreSQL + Redis via Docker, runs, tears down
task lint # gofmt check + go vet + golangci-lint
task fmt # format the tree
task build:all # build the framework and every example
task --list # all available tasksThe raw go commands (go test ./..., go build ./..., go vet ./...) work without Task if you prefer.
Before opening a pull request, make sure:
- It builds and passes —
go build ./...,go test ./... -race, and every module underexamples/builds. CI runs all three. - It's formatted —
gofmt -l .reports nothing. CI fails on unformatted code. - It lints clean —
golangci-lint runreports 0 issues. - It's tested — new behavior comes with tests. The project targets 70%+ coverage overall (CI enforces the threshold); the health and framework core aim higher.
- Exported symbols are documented — godoc comments on exported types, functions, and methods, starting with the symbol name. pkg.go.dev is the API reference, so this matters.
Bundles live under bundles/<name>/ and follow a consistent shape:
- A
Configstruct with aValidate() errormethod and aDefaultConfig()constructor. NewBundle(config Config) *Bundle.Name() string,Initialize(app *framework.App) error, andStop(ctx context.Context) error.- Health checks via the
HealthContributorinterface where the bundle manages a dependency. - Evaluate third-party dependencies carefully — Forge is "batteries included" but deliberately lightweight. A new direct dependency should earn its place; prefer the standard library where it's close enough.
Model new bundles on bundles/postgresql or bundles/redis.
- Use Conventional Commits (
feat:,fix:,docs:,refactor:,chore:; use!for breaking changes, e.g.refactor!:). - Keep pull requests focused; a reviewable diff beats a sweeping one.
- Note any breaking API change in the PR description and in CHANGELOG.md under "Unreleased".
- CI (unit tests with race detection, formatting, linting, example builds, coverage) must be green before merge.
Open a GitHub issue with the Forge version (or commit), Go version, a minimal reproduction if you can, and what you expected versus what happened.