Contributing to Ferrum Edge
Bug fixes, features, plugins, docs, tests and benchmarks are all welcome. This guide gets you from a fresh clone to a pull request that passes CI on the first try.
Welcome, Contributor!
Ferrum Edge is built on the idea that performance and safety don't have to cost maintainability. We keep the codebase clean, well tested and approachable, and we appreciate every contribution, from a one-line docs fix to a new plugin.
This page summarizes the repository's CONTRIBUTING.md, which is the full reference. Everyone taking part is expected to follow our Code of Conduct.
Development Setup
Install Rust (stable)
The repository's rust-toolchain.toml pins the stable channel with rustfmt and clippy, so rustup switches to the latest stable on your first cargo command. CI lints on current stable too, so keep your toolchain up to date. The crate uses Rust Edition 2024.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup update stable
Install protoc
build.rs compiles the gRPC protobuf definitions in proto/, so the Protocol Buffers compiler must be on your PATH, or named by the PROTOC environment variable.
# macOS
brew install protobuf
# Ubuntu/Debian
sudo apt-get install -y protobuf-compiler
# Verify
protoc --version
Fork & Clone
# Fork the repo on GitHub first, then:
git clone https://github.com/YOUR_USERNAME/ferrum-edge.git
cd ferrum-edge
git remote add upstream https://github.com/ferrum-edge/ferrum-edge.git
Bootstrap Native Build Tools (once per machine)
./scripts/install-build-deps.sh
The script installs what the checked-in .cargo/config.toml and the bundled librdkafka build expect:
- Fast linkers:
clang+moldon x86_64/ARM64 GNU/Linux,lldon macOS. The repository config requires them on those platforms. cmakeand curl development headers, needed to compile librdkafka forkafka_logging.sccache, enabled in your user-level~/.cargo/config.toml(setFERRUM_SKIP_CARGO_WRAPPER_CONFIG=1to skip that step).
It supports macOS with Homebrew and apt- or dnf-based Linux with sudo. It does not install Rust or protoc. On other systems, install the same tools yourself or use the no-fast-linker build commands in
CONTRIBUTING.md. Windows builds use the system linker.
Build & Run the Fast Tests
cargo build
# Unit tests: four targets
cargo test --test unit_tests # config, admin, TLS, identity, secrets, CLI
cargo test --test unit_plugins_a_tests # plugin tests a–j
cargo test --test unit_plugins_b_tests # plugin tests k–z
cargo test --test unit_gateway_core_tests # core runtime
# Integration tests
cargo test --test integration_tests
If rustc runs out of memory on a smaller machine, build with CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_DEV_CODEGEN_UNITS=16 cargo build. A database (PostgreSQL, MySQL, SQLite or MongoDB) is optional, for testing database mode.
Contribution Workflow
Discuss Big Changes First
For a significant feature, open an issue describing the use case and your proposed approach so maintainers can give feedback before you invest the time. Small fixes can go straight to a pull request.
Create a Branch
Branch from main.
git checkout -b feature/my-feature-name
# or
git checkout -b fix/issue-description
Write Code, Tests & Docs
Follow the code standards below and add tests for new behavior: unit tests for logic, integration tests for component interaction, functional tests for end-to-end scenarios. Update docs/ for user-facing changes and add /// doc comments to public APIs.
Run the Full Checks
# All tests, then the ignored end-to-end tests (they need the binary)
cargo build --bin ferrum-edge
cargo test
cargo test -- --ignored
# Lint and formatting: zero warnings allowed
cargo clippy --all-targets -- -D warnings
cargo fmt --check
To run only the functional suite: cargo build --bin ferrum-edge && cargo test --test functional_tests -- --ignored. For performance-sensitive changes, the multi-protocol harness runs with cd tests/performance/multi_protocol && ./run_protocol_test.sh all.
Open a Pull Request
Push your branch and open a PR against main with a Conventional Commit-style title (see below). The PR template walks you through it; the items reviewers look for are:
- A clear description, the linked issue, and the tests you ran
- Breaking changes to config shapes, environment variables, schema or defaults recorded under
UnreleasedinCHANGELOG.md - Admin API endpoint, field, status-code or plugin schema changes reflected in
openapi.yaml - New
FERRUM_*environment variables documented indocs/configuration.mdandferrum.conf - Changes to Edge-owned contract surfaces linked to the matching ferrum-contracts update
Commit Messages & PR Titles
Commits follow Conventional Commits,
and PR titles use the same type prefixes, for example fix: resolve connection pool leak under high load.
<type>(<scope>): <description>
[optional body]
[optional footer]
| Type | When to Use | Example |
|---|---|---|
feat | New feature | feat: add WebSocket message compression plugin |
fix | Bug fix | fix: resolve connection pool leak under high load |
docs | Documentation only | docs: update TLS configuration examples |
style | Formatting, no code change | style(proxy): apply rustfmt |
refactor | Code restructuring, no behavior change | refactor(proxy): extract connection pool module |
perf | Performance improvement | perf(routing): precompute route index on reload |
test | Adding or correcting tests | test(jwt_auth): cover expired tokens |
chore | Maintenance: build, CI, dependencies | chore(deps): bump tokio |
Code Standards
Lock-Free Hot Paths
No mutexes on the proxy request path. Request-path reads use ArcSwap snapshots and precomputed caches; DashMap is for concurrent mutable maps.
No Per-Request Rebuilds
Avoid allocations and format!() in hot loops. Router, plugin, consumer and load-balancer caches are rebuilt on config reload, never per request.
Errors, Not Panics
Use Result types with descriptive errors and ?. No .unwrap() or .expect() in production paths without a documented invariant, and no panics on the request path. Tests are exempt.
Rust Edition 2024
The crate targets Edition 2024 on the stable toolchain. Use modern idioms.
Clippy Clean
All code must pass cargo clippy --all-targets -- -D warnings. CI enforces it, so run it before you push.
Formatting
Run cargo fmt before committing. The project uses default rustfmt settings, and CI rejects unformatted code.
Schema changes: Ferrum Edge is in active build-out, so core SQL changes are folded into the single initial-schema baseline rather than added as new migration versions. Recreate development databases after a baseline change. See the build-out schema policy.
Adding a New Plugin
- Open an issue first to discuss the design with maintainers.
- Read the Custom Plugins guide and the repository's CUSTOM_PLUGINS.md.
- Add unit tests, plus integration or functional tests for request-path behavior.
- Document config options with
///doc comments and indocs/, and keep the plugin schema inopenapi.yamlin sync.
Code Review
Every contribution is reviewed before it merges. Here's what to expect:
- Reviewers look at correctness, performance and adherence to the standards above
- CI must pass: build, tests, clippy with
-D warningsand rustfmt, and, when CI selects it, thecargo denydependency and license gate - Performance-sensitive changes may be asked for benchmark results
- Security-sensitive changes, such as auth plugins and TLS, get extra scrutiny
Licensing Your Contribution
There is no separate CLA or sign-off step. By contributing, you agree that your contribution is licensed under the project's PolyForm Noncommercial License 1.0.0, as stated in CONTRIBUTING.md. See Licensing for how Ferrum Edge is licensed.
The companion tools live in their own repositories in the ferrum-edge GitHub organization, and each one's README lists its own development checks.
Community & Support
Bug reports and feature requests, using the bug and feature request templates.
Open IssuePlease don't file vulnerabilities publicly. For Ferrum Edge, email [email protected] with a subject starting [SECURITY], or use GitHub's private reporting form if the repository offers it. The security page has the reporting links and policy for every Ferrum project.
Conduct concerns can be reported privately to [email protected], as described in the Code of Conduct.