Thank you for your interest in contributing to Stellar-K8s! This project aims to provide a robust, cloud-native Kubernetes operator for managing Stellar infrastructure.
- Rust: Latest stable version (1.75+)
- Kubernetes: A local cluster like
kindorminikube - Docker: For building container images
- Cargo-audit: For security scans (
cargo install cargo-audit)
- Clone the repository:
git clone https://github.com/stellar/stellar-k8s.git cd stellar-k8s - Run local checks:
# Comprehensive pre-push check cargo fmt --all -- --check && \ cargo clippy --all-targets --all-features -- -D warnings && \ cargo test --all-features && \ cargo test --doc && \ cargo audit
- Formatting: Always run
cargo fmtbefore committing. - Linting: We use Clippy for linting. Ensure
cargo clippy --all-targets --all-features -- -D warningspasses. We follow a "zero-warning" policy for pushes tomain. - Security: All dependencies must be audited. We resolve all
RUSTSECadvisories immediately. - Error Handling: Use
thiserrorfor library errors andanyhowfor application-level logic. Prefer theResult<T>type defined insrc/error.rs.
We take security seriously. If you find a vulnerability (e.g., in a dependency or the code), please do not open a public issue. Instead, follow the security reporting process described in SECURITY.md (if available) or contact the maintainers directly.
If a dependency scan fails due to a RUSTSEC advisory:
- Identify the crate and version causing the issue.
- Upgrade the dependency in
Cargo.toml. - If the vulnerability is in an internal transitive dependency, use
cargo tree -i <vulnerable-crate>to find the source and upgrade the parent.
- Create a new branch for your feature or fix.
- Ensure all tests pass, including the 62+ unit tests for
StellarNodeSpecvalidation. - Update the
CHANGELOG.md(if applicable). - Submit your PR against the
developbranch.
Our CI pipeline (GitHub Actions) runs:
- Lint & Format: Checks code style and Clippy warnings.
- Audit Dependencies: Checks for known vulnerabilities in the dependency tree.
- Test Suite: Runs all unit and doc tests.
- Build & Push: Builds the Docker image and pushes to the registry.
- Security Scan: Runs Trivy on the built container image.