Files
sablier/CONTRIBUTING.md
2025-11-09 19:04:19 -05:00

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


Getting Started

Fork the Repository

  1. Navigate to the Sablier repository
  2. Click the Fork button in the top-right corner
  3. 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 feature
  • fix: A bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, missing semicolons, etc.)
  • refactor: Code refactoring without changing functionality
  • perf: Performance improvements
  • test: Adding or updating tests
  • build: Changes to build system or dependencies
  • ci: Changes to CI configuration
  • chore: 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

  1. Push your branch:

    git push origin my-new-feature
    
  2. 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)
  3. PR Title: Follow conventional commit format:

    feat(provider): add Podman support
    fix(api): resolve session race condition
    
  4. 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


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! 🚀