From 5977f912f4e72b2fae8ada66fd2f2a59018fcae7 Mon Sep 17 00:00:00 2001 From: Oliver Anyanwu Date: Tue, 21 Jul 2026 16:46:53 +0200 Subject: [PATCH 1/4] Expand contributing guide with setup, testing and pre-PR checks The external contributor section explained the fork and branch workflow but did not say how to actually build, test, or run the checks that CI enforces. Add short subsections covering environment setup and the Linux build dependencies, running the test suite, and running do_checks.sh before opening a pull request so contributors can reproduce the CI static checks locally. --- CONTRIBUTING.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3d4cef8730..abf9232bd3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,51 @@ As an outside contributor, your first step will be to fork the repo and create y As you make your changes, ensure the code is as clean as possible and well documented so that it's clear to us what you're up to when we review it and it is thoroughly tested. Make sure that the old tests still pass, as well as any tests you've added. We will only merge code with all the tests passing in CI. +### Setting up your environment + +Once rust is installed, clone your fork and build the workspace: + +``` +git clone https://github.com//mintlayer-core.git +cd mintlayer-core +cargo build +``` + +On Linux you will also need a few system packages before the build succeeds, mainly for the hardware wallet support. On a Debian or Ubuntu based system these are: + +``` +sudo apt-get install build-essential libdbus-1-dev libusb-1.0-0-dev +``` + +The static checks described below run through a small helper script that uses Python, so make sure you have Python 3.11 or newer available as well. + +### Running the tests + +Most of the test suite runs with a normal cargo invocation. We run it in release mode in CI because some of the tests are slow in a debug build: + +``` +cargo test --release --workspace +``` + +Some of the heavier tests, such as the functional tests, are marked as ignored so they don't run by default. If your change touches an area covered by them, you can run them explicitly by passing `-- --ignored`. When you add new behaviour, please add tests for it, and when you fix a bug, a test that would have caught it is very welcome. + +### Before you open a pull request + +We keep the static checks in one place so you can run locally exactly what CI will run. From the root of the repository: + +``` +./do_checks.sh +``` + +This checks formatting with `cargo fmt`, runs `cargo clippy` with the lint configuration we use, and runs `cargo deny` and `cargo vet` over the dependency tree. The last two come from separate tools, so install them once with: + +``` +cargo install cargo-deny --locked +cargo install cargo-vet --locked +``` + +If `do_checks.sh` passes locally, your pull request should get through the static checks in CI too, which makes the review quicker for everyone. A draft pull request is always welcome if you would like early feedback, just mark it as such. + ## Internal contributors By internal contributors, we mean people who are members of the Mintlayer organization. If you are not employed full-time to work on Mintlayer but have substantial contributions, drop us a message, and we'll see what can be done about adding you. From 5984ee6ed2ae73d54f5a253dda34769c3218694f Mon Sep 17 00:00:00 2001 From: nullPointerEnjoyer Date: Wed, 18 Nov 2026 22:21:37 +0100 Subject: [PATCH 2/4] docs: correct the ignored-tests guidance and static-checks description --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index abf9232bd3..61a891db1c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,7 @@ Most of the test suite runs with a normal cargo invocation. We run it in release cargo test --release --workspace ``` -Some of the heavier tests, such as the functional tests, are marked as ignored so they don't run by default. If your change touches an area covered by them, you can run them explicitly by passing `-- --ignored`. When you add new behaviour, please add tests for it, and when you fix a bug, a test that would have caught it is very welcome. +Some of the heavier tests, such as the functional tests, are marked as ignored so they don't run by default. If your change touches an area covered by them, you can run them explicitly by passing `-- --ignored`. When you add new behavior, please add tests for it, and when you fix a bug, a test that would have caught it is very welcome. ### Before you open a pull request @@ -50,7 +50,7 @@ We keep the static checks in one place so you can run locally exactly what CI wi ./do_checks.sh ``` -This checks formatting with `cargo fmt`, runs `cargo clippy` with the lint configuration we use, and runs `cargo deny` and `cargo vet` over the dependency tree. The last two come from separate tools, so install them once with: +This runs, in order: `cargo fmt`, `cargo deny` and `cargo vet` over the dependency graph, `cargo clippy` with the lint configuration we use, and a few repo-specific checks (including a WASM API documentation check, which needs Python 3.11+). The deny and vet tools come separately, so install them once with: ``` cargo install cargo-deny --locked From 7971363b1e941604c5304039f008a3a3901ea532 Mon Sep 17 00:00:00 2001 From: nullPointerEnjoyer Date: Wed, 18 Nov 2026 22:26:55 +0100 Subject: [PATCH 3/4] docs: attribute the Python requirement to the repo checks --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 61a891db1c..50628f4ddb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,7 @@ We keep the static checks in one place so you can run locally exactly what CI wi ./do_checks.sh ``` -This runs, in order: `cargo fmt`, `cargo deny` and `cargo vet` over the dependency graph, `cargo clippy` with the lint configuration we use, and a few repo-specific checks (including a WASM API documentation check, which needs Python 3.11+). The deny and vet tools come separately, so install them once with: +This runs, in order: `cargo fmt`, `cargo deny` and `cargo vet` over the dependency graph, `cargo clippy` with the lint configuration we use, and a few repo-specific checks, which need Python 3.11+ (including a WASM API documentation check). The deny and vet tools come separately, so install them once with: ``` cargo install cargo-deny --locked From f91fee139f46a85211b1b18d1d21e2a5fed95bcd Mon Sep 17 00:00:00 2001 From: nullPointerEnjoyer Date: Wed, 18 Nov 2026 22:31:38 +0100 Subject: [PATCH 4/4] docs: give the targeted functional-test command --- CONTRIBUTING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 50628f4ddb..9282133d40 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,13 @@ Most of the test suite runs with a normal cargo invocation. We run it in release cargo test --release --workspace ``` -Some of the heavier tests, such as the functional tests, are marked as ignored so they don't run by default. If your change touches an area covered by them, you can run them explicitly by passing `-- --ignored`. When you add new behavior, please add tests for it, and when you fix a bug, a test that would have caught it is very welcome. +Some of the heavier tests, such as the functional tests, are marked as ignored so they don't run by default. If your change touches an area covered by them, run the functional test suite explicitly: + +``` +cargo test -p mintlayer-test --test functional -- --ignored +``` + +(See `test/README.md` for details; passing a bare `-- --ignored` to the whole workspace would also run deliberately disabled tests that are expected to fail.) When you add new behavior, please add tests for it, and when you fix a bug, a test that would have caught it is very welcome. ### Before you open a pull request