Thanks for your interest in improving MTUI. This document covers the
day-to-day workflow; see docs/src/developer.md for a deeper walk-through
of the codebase and AGENTS.md for the full architecture and Definition
of Done.
- Base all work on
main; one logical change per PR. - Larger refactors should be split into reviewable commits or, if they cross subsystems, into a series of PRs.
- Rebase rather than merge when bringing your branch up to date.
- CI must be green before review (fmt, clippy, rustdoc, test, and the feature matrix).
- Keep both surfaces (
mtuiandmtui-mcp) building and passing when touching commands,Session, the registry, or the entrypoints.
We use Conventional Commits. Common prefixes used in this repository:
feat:for user-visible new behaviourfix:for a bug fixdocs:for documentation onlytest:for test-only changesrefactor:for internal restructuring with no behaviour changechore:/build:/ci:for tooling, packaging, CI
Reference SUSE Bugzilla / Bugzilla.opensuse.org issues with the standard
keywords (bsc#NNNN, boo#NNNN) in the commit body when applicable.
The project is a Cargo workspace and uses the standard Rust toolchain
(edition 2024, MSRV 1.96); no rustup is assumed.
Build everything (produces both mtui and mtui-mcp):
cargo build --workspaceRun mtui from the checkout:
cargo run -p suse-mtui -- --help
cargo run -p suse-mtui --bin mtui-mcp -- --helpRun these locally before opening a PR (CI runs the same commands):
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --all-features --document-private-items
cargo test --workspaceWarnings are errors under clippy and rustdoc. Tests run against default
features; the long pole is cold compilation, not the test run itself. CI also
runs msrv and macos jobs.
Also run the compile-only feature matrix, which catches feature-gate rot:
cargo build --workspace --no-default-features
cargo build --workspace --all-featuresDo not routinely test --all-features — CI only compiles it.
Auto-format:
cargo fmt --allpre-commit installInstalls hooks for cargo fmt and cargo clippy. The clippy hook runs
without --all-features, so it is a subset of the CI gate and purely a
convenience.
- Unit tests are colocated (
#[cfg(test)]); integration tests live incrates/*/tests/. - Add a new integration test as a
modline in the crate'stests/it.rs(one integration-test binary per crate), not as a new top-leveltests/*.rs.mtui-core,mtui-configandxtaskare the exceptions: their integration tests are per-file. - Mock, don't hit the network/hosts: HTTP via
wiremock, SSH via aMockConnection, subprocesses via a command-runner trait or a stub onPATH. Gate real hosts/containers behind#[ignore]+ an env flag; those tests run locally only. - Snapshot text contracts (report document goldens, MCP schemas,
lock-file format) with
insta. - New/changed code needs >=80% patch coverage.
Mergify merges a PR with a rebase when the PR targets main, has linear
history, carries neither the acceptance-tests-needed nor the not-ready
label, and has no failing or pending check, with codecov/project (target 81%)
reporting success. The merge also needs two approving reviews, no
changes-requested review and no outstanding review request. The merge-fast
label skips those three review conditions, not the checks.
User-visible changes belong in the top-most unreleased section of
CHANGELOG.md. Internal refactors do not need an entry.
By participating you agree to abide by the Code of Conduct.