Contributing to Patinas
Thank you for contributing. This repository targets resilient media transport with strong reliability and observability guarantees. Please follow these best practices:
Branching, commits, and PRs
- Create feature branches from
main. - Keep PRs small and focused; include motivation and testing notes.
- Use clear commit messages (Conventional Commits encouraged, e.g.,
feat(core): add adaptive jitter policy). - Link issues and update docs/tests alongside code.
Merge policy (integrity)
- Changes to
mainmust land via pull request (no direct pushes). - PRs must have:
- required CI checks passing (see
docs/testing/TESTING.md“CI contract”) - at least one reviewer approval (CODEOWNERS where applicable)
- required CI checks passing (see
- Bypassing protections should be treated as break-glass only (e.g., incident response), and the rationale should be documented in the PR/commit message.
Code quality
- Run
cargo fmt,cargo clippy -- -D warnings, andcargo testlocally. - Avoid
unsafe. If unavoidable, isolate and document invariants. - Prefer small traits and dependency inversion (Hexagonal).
- Use bounded channels and explicit drop strategies to avoid backpressure.
- No global singletons; pass small
Arcs and explicit dependencies.
Testing and KPIs
- Add unit tests for algorithms and property-like behavior.
- Add integration smoke where applicable (publish/subscribe paths, metrics exposure).
- Update observability (metrics/logs) in-sync with behavior changes.
Observability and logging
- Emit Prometheus series via
MetricsPortwith stable names and sorted-label ordering. - Use structured JSON logging via
tracingwith relevant context (e.g.,stream_id).
Security and configuration
- No secrets in logs. Avoid secrets in env for production; prefer files under
/etc/patinas. - For QUIC, use mTLS (when feature available), CA pinning, and support SIGHUP rotation.
Documentation
- Update
docs/architecture/ARCHITECTURE_DETAILED.mdandCODING_STANDARDS.mdwhen adding architectural or policy changes. - Add crate-level Rustdoc and function docs where logic is non-trivial.
Review checklist (submitter)
- Tests added/updated (unit/integration)
-
cargo fmtandclippyclean - Metrics/logging updated and validated
- Docs updated (architecture/coding standards/README)
- No secrets in code or logs; config handled securely