Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Contributing to Kargo

Kargo is pre-1.0 and there is a lot to build. This section is for people working on Kargo itself; if you are using Kargo, start at Getting Started.

Setting up

RequirementNotes
Rust 1.91 or newerThe floor is [workspace.package].rust-version in Cargo.toml. Install via rustup.
Git
A JDKOnly for end-to-end tests that actually compile Kotlin.
git clone https://github.com/dejanradmanovic/kargo.git
cd kargo
cargo build
cargo test --workspace
cargo run -- new /tmp/scratch-app     # exercise the CLI

The Rust floor moves when a dependency bump requires it. If cargo build complains about an unsupported feature, run rustup update stable before anything else.

Enable the git hooks

Once per clone:

git config core.hooksPath .githooks
HookRunsWarm-cache cost
commit-msgthe subject conventioninstant
pre-commitcargo fmt --check, cargo clippy -- -D warnings~10s
pre-pushthe above plus cargo test --workspace~25s

They run the same gates as CI, so failures surface before a pull request does.

  • Bypass once with --no-verify, or set KARGO_SKIP_HOOKS=1.
  • Formatting is checked, not applied — the hooks never rewrite your files. Run cargo fmt --all yourself.
  • The checks see the working tree, not the staged snapshot, so a failure can come from unstaged work in progress.
  • They call plain cargo, honoring rustup's toolchain selection. Set RUSTUP_TOOLCHAIN if this repo needs a non-default toolchain.

The CI gates

Every pull request must pass:

cargo check --workspace --all-targets
cargo test --workspace                              # on Linux, macOS, Windows
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings

CI runs with RUSTFLAGS: -Dwarnings on dtolnay/rust-toolchain@stable. Clippy and fmt are hard gates — run both before pushing. Coverage is a hard gate too: cargo-llvm-cov measures the workspace and the job fails below 90% line coverage. See Testing.

Finding something to work on

Implementation Status is the map. Anything marked ⚪ is unbuilt, and the ones with the clearest specs are the easiest places to start:

  • kargo lint and kargo fmt — the crates are scaffolded and the rule set is specified
  • kargo publish — the Maven protocol is already implemented for reading
  • Hook dispatch — [hooks] parses, and the hook points are defined
  • Wiring flavors into the build path — types and BuildConfig generation exist

Open an issue before starting something large, so two people do not build the same thing twice.

Pull requests

  1. Branch descriptively: feat/resolver-nearest-wins, fix/core-empty-sourceset.
  2. Follow the code conventions and testing conventions.
  3. Run the CI gates locally.
  4. Update the docs in the same PR — including Implementation Status if you changed what works.
  5. Write a conventional commit subject — and give the pull request the same form. It is squash-merged, so the title is what lands on main, and a CI check enforces it.
  6. Resolve every review thread before merging — see Review and approval.

A PR that implements a documented feature should flip its status marker. A PR that changes documented behavior should change the documentation. Both live in this repository, so there is no excuse for them to drift.

Review and approval

Every pull request is reviewed by CodeRabbit, and its approval counts: the main ruleset asks for one approving review, and CodeRabbit can be the one.

GateWhat satisfies it
One approving reviewCodeRabbit, or a maintainer
Every review thread resolvedyou, before you merge
13 required status checks, plus CodeQLCI

.coderabbit.yaml at the repository root is what makes that workable. Two settings decide the shape of a review:

  • auto_approvals.max_merge_risk: low — CodeRabbit approves what it rates low risk and withholds on moderate and above, which is where a person looks.
  • auto_approvals.allow_author_approval: false — you cannot satisfy the required review on your own pull request by commenting @coderabbitai approve on it.

Threads are merge gates

required_review_thread_resolution is on, so every thread CodeRabbit opens has to be resolved before the merge button works.

Resolving is not agreeing. When a finding is wrong, or asks for something the conventions refuse — a comment that would break scripts/check-comment-budget.sh is the recurring one — say why and resolve the thread. CodeRabbit reads the conventions from CLAUDE.md and the nested crates/*/CLAUDE.md, which are in its default guideline patterns, so the config carries no second copy of them.

The approval is not durable

dismiss_stale_reviews_on_push is on, so a push dismisses the approval and CodeRabbit re-reviews the new head to re-earn it. That is why the config sets auto_review.auto_pause_after_reviewed_commits: 0: at the default of 5, CodeRabbit stops reviewing partway through a long-running branch, and the dismissed approval would then be permanently out of reach.

One more ruleset parameter can ask for a second approval CodeRabbit cannot give: require_extra_approval_for_unattributed_changes demands it when a commit's author is not attributable to a GitHub account. Set user.email to the address on your GitHub account and it never fires.

Why there is no CODEOWNERS

require_code_owner_review is on, and this repository has no CODEOWNERS file, which makes the requirement vacuous — no path is owned, so no owner review is demanded.

That is deliberate. GitHub Apps cannot be listed in CODEOWNERS; only users and teams can. A CODEOWNERS covering the changed paths would therefore make CodeRabbit's approval unable to satisfy the gate however it is configured, and every pull request would need a human approval. Adding one means choosing that; until it is chosen, the file stays absent.

Development tips

cargo test -p kargo-core              # one crate
cargo test -p kargo-resolver resolve  # one test by name
RUST_LOG=debug cargo run -- build     # internal tracing output
cargo build --release                 # target/release/kargo
cargo run -- --help

To try your build against a real project:

cargo install --path crates/kargo-cli --force
cd /path/to/a/kotlin/project
kargo build -v

Where to look next