Contributing
Contributing
This section covers how to contribute to Melange development, including running tests, benchmarks, and understanding the project structure.
Getting Started
Clone the repository and install dependencies:
git clone https://github.com/pthm/melange.git
cd melange
# Install development tools
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latestBuilding
# Build the CLI
go build -o bin/melange ./cmd/melange
# Build test utilities
go build -o bin/dumptest ./test/cmd/dumptestRunning Tests
# Run all tests
go test ./...
# Run with verbose output
go test -v ./...
# Run specific package
go test -v ./test/...Quick Links
Run the OpenFGA compatibility test suite
Performance testing and profiling
Understand the codebase layout
Development Workflow
- Make changes to the relevant files
- Run tests to ensure nothing breaks:
go test ./... - Run the OpenFGA test suite for compatibility:
just test-openfga - Run benchmarks if performance-sensitive:
just bench-openfga - Submit a pull request
Key Commands
# Validate your schema changes
melange validate --schema schemas/schema.fga
# Run OpenFGA compatibility tests
just test-openfga
# Run benchmarks
just bench-openfga
# Inspect a specific test case
just dump-openfga <test_name>