Contributing¶
Workflow¶
- Create a feature branch:
feat/short-description - Implement with tests (≥90% coverage)
- Build via Docker — verify it compiles
- Run tests via Docker — verify they pass
- Commit using Conventional Commits
- Open PR for review
Commit Format¶
Types: feat, fix, docs, refactor, test, chore, perf
Scopes: controller, worker, ml, detection, replay, config, docs
Examples:
feat(detection): add disk I/O adaptive metric
fix(correlation): use service_name when pod is empty
docs(replay): add CLI usage examples
test(replay): add golden file test for markdown report
chore(deps): bump golang from 1.24 to 1.25
Code Style¶
Go¶
- Standard Go formatting (
gofmt) internal/for all business logic (not importable by external packages)- Context as first parameter
- Table-driven tests
errors.Is/Asfor error comparisonerrgroupfor concurrent operations
Python¶
- Type hints everywhere
async deffor I/O operationspytestwith@pytest.mark.asynciopyproject.tomlfor project metadata
Adding a New Detection Rule¶
- Add the rule to
controller/config.yamlunder the appropriate section - Test with replay:
controller --replay --from=24h --config=config.yaml - Verify anomaly count is reasonable
- Add suppression if needed for known-noisy namespaces
Adding a New Enrichment Query¶
- Add to
pod_bundleorservice_bundleinconfig.yaml - Use template variables (
$namespace,$pod,$service_name) - The query result becomes an alert annotation with the bundle item's
name
Modifying Protobuf¶
- Edit
.protofiles incontroller/proto/orml/proto/ - Regenerate Go stubs:
- Regenerate Python stubs:
Versioning¶
- Controller and ML are versioned independently
- Version bumps only on validated milestones (not per-commit)
- See Roadmap for milestone criteria
Documentation¶
Every user-visible change must update documentation:
- New feature → update relevant docs page
- Config change → update Configuration
- New metric → update Monitoring
- Bug fix → update Troubleshooting if relevant