We welcome bug reports, feature ideas, and pull requests! This guide outlines the development workflow, coding standards, and expectations for contributors.
- Install Rust 1.90 or newer using rustup.
- Install libvips and build prerequisites:
- Debian / Ubuntu:
sudo apt-get install libvips-dev libvips pkg-config build-essential - macOS (Homebrew):
brew install vips pkg-config
- Debian / Ubuntu:
- Clone the repository and install any project-specific Git hooks you rely on.
Project layout (selected files):
src/
main.rs # Entrypoint
server.rs # Axum router and runtime wiring
handlers.rs # HTTP handlers and common flow
processing/ # Option parsing, transforms, save pipeline
caching/ # Cache adapters backed by Foyer
url.rs # Path parsing and signature validation
Refer to Installation for a comprehensive setup checklist and Request Lifecycle for architectural context.
- Run
cargo fmtto ensure code adheres to.rustfmt.toml. - Address
cargo clippy --all-targets --all-featureswarnings before submitting. - Favor idiomatic async Rust; keep functions short and well-scoped.
- Document new functionality and update numbered docs under
doc/when behavior changes. - Use structured logging via
tracingrather thanprintln!.
Run the full test suite locally:
cargo test
cargo test --all -- --test-threads=1 # integration tests expect serialized executionIntegration tests under tests/ contact external services (e.g., httpbin.org). Ensure outbound network access is available or adapt fixtures to local mocks.
- Build in release mode for representative numbers:
cargo build --release. - Exercise endpoints with
wrkorvegeta. - Use
perf,cargo flamegraph, or sampling profilers to locate hotspots.
- Branch from
mainusing a descriptive name (e.g.,feat/resize-presetsordocs/cache-guidelines). - Keep commits focused and reference relevant issues or tickets in commit messages.
- Include tests for new behavior and update documentation where applicable (see Caching, Error Troubleshooting, etc.).
- Fill out the pull request template with testing evidence and operational considerations.
- Expect review feedback; incorporate changes and re-run tests before requesting re-review.
Please provide the following details to help triage quickly:
- imgforge version (
cargo pkgidor git commit SHA). - Operating system and libvips version (
vips --version). - Full request path (redact signatures if necessary) and the resulting status code.
- Relevant log excerpts (including
X-Request-IDvalues) and metrics snapshots. - Configuration values tied to the issue (timeouts, cache mode, security flags).
Review Error Troubleshooting before filing; many common pitfalls and solutions are documented there.
Thank you for investing in imgforge! Your contributions make the project faster, safer, and easier to operate.