Contributing to Runix
Thank you for your interest in contributing to Runix! This guide covers the basics.
Code of Conduct
Be respectful, constructive, and collaborative.
How to Contribute
- Fork the repository
- Create a feature branch from
main:git checkout -b feat/my-feature - Make changes following the conventions below
- Run tests:
make test - Run lint:
make lint(if golangci-lint is installed) - Commit with conventional commit messages
- Open a pull request with a clear description
Commit Conventions
Use conventional commit prefixes:
| Prefix | Usage |
|---|---|
feat: | New feature |
fix: | Bug fix |
docs: | Documentation change |
refactor: | Code refactoring |
test: | Adding or updating tests |
chore: | Build, CI, tooling changes |
perf: | Performance improvement |
Examples:
feat: add --format json to list command
fix: prevent double-close on exited channel
docs: update configuration reference
test: add integration test for rolling reload
Code Conventions
Logging
- Use
zerologstructured logging:log.Info().Str("name", name).Msg("message") - Return errors; never log-and-return-nil
- Let the caller decide whether to log
Error Handling
- Wrap errors with context:
fmt.Errorf("failed to start %q: %w", name, err) - Don't suppress errors silently
Initialization
- No
init()functions — all setup is explicit viaNew*()constructors - Use
context.Background()when no context is available (nevercontext.TODO())
Build
CGO_ENABLED=0everywhere — no C dependencies-trimpathfor reproducible builds
Testing
- Standard library
testingonly — no testify or other test frameworks - Table-driven tests where applicable
- Co-locate tests in
_test.gofiles - E2E tests go in
internal/e2e/
Project Structure
cmd/runix/ CLI commands (thin cobra wrappers)
internal/ Internal packages (not importable externally)
pkg/types/ Shared types (importable, no internal deps)
configs/ Example configuration
docs/ Documentation
scripts/ Build and install scripts
See Architecture Overview for the full module map.
Where to Add Things
| Task | Location |
|---|---|
| CLI command | cmd/runix/<command>.go |
| Shared type | pkg/types/<name>.go |
| Internal logic | internal/<package>/<name>.go |
| E2E test | internal/e2e/<name>_test.go |
What's Next
- Building — Build and test commands
- Adding Commands — How to add a CLI command
- Adding Runtimes — How to add a runtime adapter