6.1 KiB
Contributing to Sablier
Thank you for your interest in contributing to Sablier! This guide will help you get started with contributing to the project.
Table of Contents
- Contributing to Sablier
Getting Started
Fork the Repository
- Navigate to the Sablier repository
- Click the Fork button in the top-right corner
- This creates a copy of the repository under your GitHub account
Clone Your Fork
git clone https://github.com/YOUR_USERNAME/sablier.git
cd sablier
Create a Branch
Create a new branch for your feature or bug fix:
git checkout -b my-new-feature
Contribution Guidelines
Conventional Commits
We use Conventional Commits for commit messages. This leads to more readable messages and helps with automated versioning and changelog generation.
Format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, missing semicolons, etc.)refactor: Code refactoring without changing functionalityperf: Performance improvementstest: Adding or updating testsbuild: Changes to build system or dependenciesci: Changes to CI configurationchore: Other changes that don't modify src or test files
Examples:
git commit -m "feat(provider): add Podman support"
git commit -m "fix(api): resolve race condition in session management"
git commit -m "docs: update installation guide with new Docker image"
git commit -m "test(kubernetes): add integration tests for StatefulSets"
Breaking Changes:
For breaking changes, add ! after the type or add BREAKING CHANGE: in the footer:
git commit -m "feat(api)!: remove deprecated /v1/start endpoint"
# or
git commit -m "feat(api): update authentication mechanism
BREAKING CHANGE: API now requires API key in header instead of query parameter"
Development Guide
Compiling
Build the Binary
make build
This creates a binary in the current directory (e.g., sablier_draft_linux-amd64).
Build for Specific Platform
# Linux
GOOS=linux GOARCH=amd64 make build
# macOS
GOOS=darwin GOARCH=amd64 make build
# Windows
GOOS=windows GOARCH=amd64 make build
Run Locally
# Build and run
make build
./sablier_draft_linux-amd64 start --help
# Or run directly
go run cmd/sablier/sablier.go start --provider.name=docker
Build Docker Image
docker build -t sablier:dev .
Testing
Run All Tests
make test
Or using Go directly:
go test ./...
Run Linters
make lint
Running Long Tests (Testcontainers)
Some tests use Testcontainers to spin up real containers (Docker, Kubernetes, etc.). These tests are longer-running and require Docker to be installed and running.
Running Testcontainer Tests
By default, testcontainer tests are included in the regular test suite:
make test
Skipping Long Tests
If you want to skip testcontainer tests during development:
go test -short ./...
Mark long-running tests with:
func TestMyLongRunningTest(t *testing.T) {
if testing.Short() {
t.Skip("Skipping long-running test")
}
// Test code...
}
Submitting Your Contribution
Before Submitting
make fmt
make test
make lint
Create a Pull Request
-
Push your branch:
git push origin my-new-feature -
Open a Pull Request on GitHub:
- Go to your fork on GitHub
- Click "Compare & pull request"
- Fill in the PR template with:
- Description of changes
- Related issues (if any)
- Testing done
- Screenshots (if UI changes)
-
PR Title: Follow conventional commit format:
feat(provider): add Podman support fix(api): resolve session race condition -
Address review comments:
- Make requested changes
- Push additional commits
- Re-request review when ready
After Merge
Your changes will be included in the next release. Thank you for contributing! 🎉
Getting Help
- Discord: Join our Discord server for discussions and support
- Issues: Check existing issues or create a new one
- Documentation: Read the full documentation
Code of Conduct
Please note that this project is released with a Code of Conduct. By participating in this project you agree to abide by its terms.
License
By contributing to Sablier, you agree that your contributions will be licensed under the AGPL-3.0 License.
Thank you for contributing to Sablier! 🚀