Thanks for your interest in contributing. This document captures the
day-to-day workflow used by the maintainers so that outside contributors can
match the same conventions. For project architecture see
README.md and docs/ARCHITECTURE.md;
for security disclosures see SECURITY.md.
oc-rsync uses a push-and-let-CI-verify workflow. Local builds are kept to the minimum needed for a fast, lock-free edit/push cycle; the full validation matrix runs in CI on every push.
cargo fmt --all- always run before pushing.cargo fmt --all -- --check- pre-push sanity check; matches the CI gate.- Standard
gittooling for diff and history inspection.
Leave these to CI. Running them locally is not required and is actively discouraged because concurrent invocations have caused multi-minute build-lock hangs on shared workstations:
cargo clippy --workspace --all-targets --all-features --no-deps -- -D warningscargo nextest run --workspace --all-featurescargo build/cargo checkagainst the full workspace
CI runs the full matrix (fmt + clippy, nextest on stable, Windows, macOS, Linux musl) on every push. If you need to reproduce a failure locally, scope the run to a single crate and test pattern:
cargo nextest run -p <crate> --all-features -E 'test(<pattern>)'Use cargo-nextest rather than cargo test; configuration lives in
.config/nextest.toml.
- Add the crate to the relevant per-crate
Cargo.toml, under either[dependencies]or a platform-conditional table such as[target.'cfg(target_os = "linux")'.dependencies], withoptional = trueand a matching entry in[features]. - Run
cargo updateonce so the new entry is registered inCargo.lock. This will also rewrite unrelated lock entries with patch-level bumps; that is normal cargo behaviour - accept the diff as-is. - For platform-conditional optional deps, mirror the
iouring-send-zcpattern incrates/fast_io/Cargo.toml: declare the depoptional = trueunder a[target.'cfg(...)'.dependencies]block, then expose it as a named feature that re-exports the underlying capability.
- Branch naming. Use
<category>/<short-description>[-<task-id>], for examplefeat/parallel-delta-2087ordocs/contributing-push-and-ci-workflow. - Conventional prefixes. Both commit messages and PR titles must use one
of:
feat:,fix:,perf:,docs:,chore:,style:,test:,refactor:,ci:. A labeler workflow auto-applies release-note categories from the PR title, so the prefix is load-bearing. - Title length. Keep PR titles under 70 characters; put detail in the body.
- CI gate. All required checks must pass before merge: fmt + clippy,
nextest (stable), Windows, macOS, Linux musl. PRs require one approving
review. Master is protected; merge via GitHub (
gh pr merge). - Authorship hygiene. PR titles, PR bodies, branch names, commit messages,
and added files must not reference internal tooling or non-human authoring
aids. Use hyphens (
-) rather than em-dashes in prose.
If you write a test that sets an OC_RSYNC_BUFFER_POOL_* env var (or
otherwise mutates BufferPool capacity state), wrap the env-var
manipulation in EnvGuard (from platform::env::EnvGuard). The CI lint
at tools/ci/check_envguard.sh walks every #[test] and
#[tokio::test] body in the workspace and flags any cap-touching test
that does not also hold an EnvGuard.
The lint runs in the fmt + clippy job. It is currently in warn-only
mode and will be flipped to strict (via OC_RSYNC_ENVGUARD_LINT_STRICT=1)
once BPF-3 (#2821) closes the existing gap. To silence a known-safe
test, add a <repo-relative-path>::<fn_name> entry to
tools/ci/envguard_lint.ignore. See
docs/design/bpf-4-envguard-ci-lint-spec.md for the full design and the
EOL plan; the lint is removed once BPF-9 replaces the global OnceLock
singleton with a per-test factory.
- Worktrees recommended. Use
git worktree addso each in-flight branch has its own checkout. This keeps cargo build state isolated per branch and avoids the lock contention that arises when several shells or agents share one target directory. - Cross-tree fix bundles allowed. If a flake or regression on master is blocking several in-flight PRs, fix it in whichever branch is closest to mergeable rather than spinning up a separate hotfix PR.
By contributing you agree that your contributions will be licensed under
GPL-3.0-or-later, matching the project license in LICENSE.