Contributing
Contributing
Melange compiles OpenFGA schemas into PostgreSQL functions through a multi-stage pipeline: parse the DSL, analyze relation patterns, compute transitive closures, generate specialized SQL, and install it. Understanding this pipeline is key to contributing effectively.
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 OpenFGA compatibility suite
just test-openfga
# Run benchmarks
just bench-openfgaQuick Links
Compilation pipeline, SQL generation, and key design decisions
Step-by-step guide for new OpenFGA feature support
Run the OpenFGA compatibility test suite
Performance testing and profiling
Codebase layout, modules, and key files
Development Workflow
- Make changes to the relevant files.
- Run tests to ensure nothing breaks:
just test-openfga - Run benchmarks if performance-sensitive:
just bench-openfga - Submit a pull request.
Good First Issues
Look for issues labelled good first issue on GitHub. These typically involve:
- Adding test cases for edge cases in existing patterns.
- Improving error messages or doctor check output.
- Documentation improvements.
- Small refactors with clear scope.