This document describes the PR workflow for the Exograph repository and how to validate your changes locally before submitting.
Before creating a PR, run the pre-PR validation script:
npm run prepare:prThis will run all critical checks locally to catch issues before they hit CI.
- Dependencies - Verifies Rust, protoc, and Node.js are installed
- Node Modules - Checks if npm dependencies are installed
- Code Formatting - Runs
cargo fmt --all -- --check - Clippy Lints - Runs
cargo clippy --all-targets --all-features -- -D warnings --no-deps - Build - Compiles the project with
cargo build --workspace - Unit Tests - Runs
cargo test --workspace - Integration Tests - Runs
exo test integration-testswith introspection tests enabled - Error Reporting Tests - Validates error reporting functionality (if Node.js available)
- Git Status - Shows uncommitted changes
- Common Issues - Checks for TODO/FIXME comments and Cargo.lock consistency
When you create a PR, GitHub Actions will run the same checks across multiple platforms:
- Formatting check (
cargo fmt) - Clippy lints
- Runs on every PR and push to main
- Platforms: Ubuntu 22.04, macOS 14, Windows 2022
- Tests:
- Unit tests
- Integration tests with introspection
- Error reporting tests
- Builds: Targets
x86_64-unknown-linux-gnu,aarch64-apple-darwin,x86_64-pc-windows-msvc
- WebAssembly tests are temporarily disabled due to tokio networking incompatibility
cargo fmt --all
# Or
npm run lint:fixcargo clippy --all-targets --all-features -- -D warnings --no-depsReview the warnings and fix them. Common issues:
- Unused variables (prefix with
_) - Unnecessary clones
- Missing documentation
cargo test --workspace --exclude postgres-resolver-dynamic --exclude postgres-builder-dynamic --exclude server-cf-workerCheck the test output for specific failures. Run individual tests:
cargo test test_nameMake sure PostgreSQL is running and properly configured:
# Check if postgres is running
pg_isready
# Run integration tests with full output
EXO_RUN_INTROSPECTION_TESTS=true ./target/debug/exo test integration-testsClean and rebuild:
cargo clean
cargo build --workspace --exclude postgres-resolver-dynamic --exclude postgres-builder-dynamic --exclude server-cf-workerBeyond automated checks, consider manual testing:
-
Navigate to a test project:
cd integration-tests/basic-model-no-auth -
Run in yolo mode (creates temp database):
cargo run --bin exo yolo
-
Test in the GraphQL playground
-
Verify queries and mutations work as expected
# Create a test database
createdb test-db
# Run dev mode
EXO_JWT_SECRET="test-secret" \
EXO_POSTGRES_URL=postgresql://localhost:5432/test-db \
EXO_POSTGRES_USER=$USER \
cargo run --bin exo dev- Run
npm run prepare:prand ensure all critical checks pass - Review your changes with
git diff - Write a clear PR description explaining what changed and why
- Add tests for new functionality
- Update documentation if needed
- Check that commit messages follow conventional commits
We use commitlint to enforce conventional commit messages. The format is:
type(scope): subject
body
footer
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksperf: Performance improvementsci: CI/CD changes
feat(postgres): add support for pgvector similarity search
Implements vector similarity search using the pgvector extension.
Adds new query operators for cosine and euclidean distance.
Closes #123
fix(cli): handle missing config file gracefully
Previously crashed with panic. Now shows helpful error message.
The GitHub Actions workflow can take 10+ minutes. To speed up feedback:
- Run checks locally first - Catch issues before pushing
- Use draft PRs - Mark PR as draft if still working on fixes
- Push complete changes - Avoid multiple small commits that trigger CI
- Watch for platform-specific issues - If tests pass locally but fail in CI, check the platform (Linux/macOS/Windows)
- Check existing PRs for examples
- Review the DEVELOPMENT.md guide
- Ask in the team chat if stuck on a specific issue
Possible causes:
- Platform differences (especially Windows)
- Missing dependencies in CI environment
- Timing issues in integration tests
- Postgres version differences
Debug steps:
- Check which platform failed in the workflow
- Review the full CI logs for that platform
- Look for environment-specific errors
- Consider adding platform-specific handling if needed
Possible causes:
- Different Rust versions
- Different clippy version
- Feature flags affecting code paths
Debug steps:
- Update Rust toolchain:
rustup update - Run with same flags as CI:
cargo clippy --all-targets --all-features -- -D warnings --no-deps - Check if you're on a different branch that has different clippy config
Tips:
- Run specific test directories:
./target/debug/exo test integration-tests/basic-model-no-auth - Use
cargo test --libfor unit tests only - Keep PostgreSQL running between test runs
- Consider using
cargo watchduring development
# Terminal 1: Watch and rebuild on changes
cargo watch -c -x 'build --workspace --exclude postgres-resolver-dynamic --exclude postgres-builder-dynamic --exclude server-cf-worker'
# Terminal 2: Run specific tests as needed
cargo test specific_test_name# Quick validation (just formatting and clippy)
npm run lint
# Full validation
npm run prepare:pr# Final check
npm run prepare:pr
# Review changes
git diff main...HEAD
# Push
git push origin your-branch