Thank you for your interest in contributing to Spooled Backend! This document provides guidelines and information for contributors.
By participating in this project, you agree to abide by our Code of Conduct.
- Check if the bug has already been reported in Issues
- If not, create a new issue using the bug report template
- Include as much detail as possible: version, environment, steps to reproduce
- Check existing issues and discussions for similar suggestions
- Create a new issue using the feature request template
- Explain the use case and why it would benefit others
- Rust 1.96 or later
- Docker and Docker Compose
- PostgreSQL 16+ (via Docker)
- Redis 7+ (via Docker)
# Clone the repository
git clone https://github.com/spooled-cloud/spooled-backend.git
cd spooled-backend
# Start dependencies
docker compose up -d postgres redis pgbouncer
# Configure the local process (PostgreSQL is published on host port 5433)
export DATABASE_URL=postgres://spooled:spooled_password@localhost:5433/spooled
export REDIS_URL=redis://localhost:6379
export RUST_ENV=development
export JWT_SECRET=development-secret-change-in-production
# Run the server (migrations apply automatically)
cargo run
# Run tests
cargo test- Fork the repository
- Create a branch for your changes:
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix - Make your changes following our coding standards
- Write tests for new functionality
- Run the test suite:
cargo nextest run --all-features --no-fail-fast cargo clippy --lib --bins -- -D warnings -A dead_code -A unused_imports cargo fmt --all -- --check
- Commit with a clear message:
git commit -m "feat: add new feature X" # or git commit -m "fix: resolve issue with Y"
- Push to your fork and create a Pull Request
We follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code changes that neither fix bugs nor add featuresperf: Performance improvementstest: Adding or updating testschore: Maintenance tasksci: CI/CD changes
Examples:
feat(api): add bulk job creation endpoint
fix(queue): resolve race condition in job dequeue
docs: update API usage guide
test(auth): add tests for JWT refresh flow
- Follow the Rust API Guidelines
- Use
cargo fmtfor formatting - Use
cargo clippyfor linting - Write documentation for public APIs
src/
├── api/ # REST API handlers and routing (Axum)
├── cache/ # Redis caching
├── config/ # Configuration
├── db/ # Database operations
├── error/ # Error types
├── grpc/ # gRPC service (Tonic)
│ ├── auth.rs # API key authentication interceptor
│ ├── convert.rs # Protobuf ↔ DB model conversions
│ ├── server.rs # Server bootstrap, health, reflection
│ └── services/ # QueueService, WorkerService implementations
├── models/ # Data models
├── observability/# Metrics and tracing
├── queue/ # Queue management
├── scheduler/ # Cron scheduling
├── webhook/ # Webhook delivery
└── worker/ # Worker implementation
proto/
└── spooled.proto # Protocol Buffer definitions (source for tonic-build)
When modifying the gRPC API:
- Update
proto/spooled.protowith your changes - Run
cargo buildto regenerate Rust code viatonic-build - Update the service implementation in
src/grpc/services/ - Update conversion functions in
src/grpc/convert.rsif adding new types - Test with
grpcurl:grpcurl -plaintext localhost:50051 list grpcurl -plaintext -H "x-api-key: sp_test_xxx" \ -d '{"queue_name":"test"}' \ localhost:50051 spooled.v1.QueueService/Enqueue
- Write unit tests for new functions
- Write integration tests for API endpoints (REST and gRPC)
- Test edge cases and error conditions
- Aim for meaningful coverage, not just high numbers
# Run the CI-equivalent suite (requires cargo-nextest)
cargo nextest run --all-features --no-fail-fast
# Or run tests with Cargo
cargo test
# Run specific test
cargo test test_name
# Run with output
cargo test -- --nocapture
# Run integration tests only
cargo test --test '*'- Add doc comments to public APIs
- Update README if adding new features
- Update OpenAPI spec for API changes
- Include examples in documentation
- Ensure all tests pass
- Update documentation as needed
- Add entry to CHANGELOG.md (if applicable)
- Request review from maintainers
- Address review feedback
- Squash commits if requested
- Tests added/updated
- Documentation updated
- CHANGELOG.md updated (for user-facing changes)
- No new warnings from
cargo clippy - Code formatted with
cargo fmt
Before tagging, update Cargo.toml, the root spooled-backend entry in Cargo.lock, and CHANGELOG.md, then follow the release and deployment evidence checklist. The release tag must be v plus the Cargo version.
RELEASE_VERSION=0.1.98
RELEASE_TAG="v${RELEASE_VERSION}"
# Commit the synchronized manifest, lockfile, changelog, and intended release changes first.
git tag "${RELEASE_TAG}"
git push origin "${RELEASE_TAG}"The tag-triggered workflow verifies Cargo manifest/lock identity, builds and publishes multi-architecture GHCR images, and creates a GitHub Release. The normal CI workflow remains separate; verify its required checks on the release commit before tagging. Artifact publication is not production deployment.
- Open a Discussion
- Check existing issues and PRs
- Read the documentation
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.