Thank you for considering contributing to Iggy Sample! This document provides guidelines and information for contributors.
By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.
- Check existing issues before creating a new one
- Use the issue templates when available
- Provide clear reproduction steps for bugs
- Include relevant environment information (OS, Rust version, etc.)
- Fork the repository and create your branch from
main - Follow the commit convention (see below)
- Add tests for new functionality
- Ensure all tests pass:
cargo test - Run lints:
cargo clippy -- -D warnings - Format code:
cargo fmt - Update documentation if needed
This project uses Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesrefactor: Code refactoring (no functional change)test: Adding or updating testschore: Maintenance tasksperf: Performance improvementsci: CI/CD changes
Examples:
feat(messages): add batch message validation
fix(auth): handle empty API key gracefully
docs(readme): update configuration examples
- Rust 1.90+ (edition 2024)
- Docker & Docker Compose
- cargo-deny (for license/security checks)
# Clone your fork
git clone https://github.com/YOUR_USERNAME/iggy_sample.git
cd iggy_sample
# Start Iggy server
docker-compose up -d iggy
# Run tests
cargo test
# Run the application
cargo run# Unit tests
cargo test --lib
# Integration tests (requires Docker)
cargo test --test integration_tests
# All tests with verbose output
cargo test -- --nocapture
# Run specific test
cargo test test_health_endpointThis project enforces strict code quality:
# Format code
cargo fmt
# Run lints (must pass with no warnings)
cargo clippy -- -D warnings
# Check for security vulnerabilities
cargo audit
# Check licenses
cargo deny check# Install cargo-fuzz (requires nightly)
cargo +nightly install cargo-fuzz
# Run fuzz tests
cargo +nightly fuzz run fuzz_validation -- -max_total_time=60- No
unwrap()orexpect()in production code - Use proper error handling - Zero clippy warnings - All lints must pass
- Document public APIs - Use
///doc comments with examples - Explicit types - Prefer clarity over brevity
- Descriptive names - Even if longer
Use thiserror for custom error types:
use thiserror::Error;
#[derive(Error, Debug)]
pub enum MyError {
#[error("operation failed: {0}")]
OperationFailed(String),
}- Write tests alongside implementation
- Test edge cases and error paths
- Use descriptive test names:
#[test]
fn test_parse_returns_error_on_empty_input() { } // Good
#[test]
fn test_parse() { } // Too vaguesrc/
├── main.rs # Entry point
├── lib.rs # Library exports
├── config.rs # Configuration
├── error.rs # Error types
├── handlers/ # HTTP handlers
├── middleware/ # Axum middleware
├── models/ # Domain models
└── services/ # Business logic
- Open a Discussion for questions
- Check existing issues for similar problems
- Review the README and architecture.md
By contributing, you agree that your contributions will be licensed under the MIT License.