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@latest

Building

# Build the CLI
go build -o bin/melange ./cmd/melange

# Build test utilities
go build -o bin/dumptest ./test/cmd/dumptest

Running Tests

# Run all tests
go test ./...

# Run with verbose output
go test -v ./...

# Run specific package
go test -v ./test/...

Quick Links

Development Workflow

  1. Make changes to the relevant files
  2. Run tests to ensure nothing breaks: go test ./...
  3. Run the OpenFGA test suite for compatibility: just test-openfga
  4. Run benchmarks if performance-sensitive: just bench-openfga
  5. 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>