Thank you for your interest in contributing. This document covers the setup, standards, and process for submitting changes.
git clone https://github.com/soapbucket/sbproxy.git
cd sbproxy
make build
make testRequirements:
- Go 1.25+
- golangci-lint (for
make lint) - Docker (optional, for container builds)
- Format with
gofmt(enforced by CI). Runmake fmtto auto-format. - All exported types and functions must have godoc comments.
- Tests are required for new functionality.
- Run
make lintbefore submitting. - Error handling must be explicit (
if err != nil). No panics in production code. - Context (
ctx) must be the first argument in functions that accept it.
- Fork the repository.
- Create a feature branch from
main. - Make your changes. Keep each commit to one logical change.
- Run
make testandmake lint. - Submit a PR against
main. - Wait for CI to pass and a maintainer review.
Tips for a smooth review:
- Keep PRs focused. One feature or fix per PR.
- Include tests that cover the new or changed behavior.
- If the PR changes public API in
pkg/, call that out in the description. - Reference any related issues with
Fixes #123orRelated #456.
pkg/- Public API. Changes here require careful review since external consumers depend on these interfaces.internal/- Private implementation. Not importable by external projects.cmd/- Binary entry points (cmd/sbproxy/).examples/- Configuration examples (YAML files).docs/- Documentation.
- Packages: lowercase, single word when possible (
cache,config,engine,policy). - Files: lowercase with underscores (
rate_limiter.go,action_ai_proxy.go). - Interfaces: named by what they do (
ActionHandler,AuthProvider,EventBus). - Test files:
*_test.goin the same package.
make test # All tests
make test-race # With race detector
make bench # Benchmarks
make lint # Linter
make fmt # Auto-format
make validate CONFIG=path/to/sb.yml # Validate a config file- Use GitHub Issues for bugs and feature requests.
- Include your Go version, OS, and a minimal config that reproduces the problem.
- For security vulnerabilities, see SECURITY.md.
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.