Skip to content
moto-timoPublic

About

No description, website, or topics provided.

Resources

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

bodnuti

Automated review of Yocto Project and OpenEmbedded patches. bodnuti runs the checks OpenEmbedded already has, and reports only what a patch series adds. It also watches the OpenEmbedded and Yocto Project lists and publishes a report for each series at https://bodnuti.dev/reports/.

For layers and BitBake:

  • patchtest (OE-Core): commit message, shortlog, Signed-off-by, and the Upstream-Status, Signed-off-by and CVE: headers of added .patch files;
  • oelint-adv: recipe, class, include and configuration style and correctness rules;
  • shellcheck: shell in task functions and shipped scripts, run as /bin/sh, which is dash on many hosts;
  • leftover files: patch files a series drops from SRC_URI but leaves in the layer;
  • line length, license changes and CVE_CHECK_IGNORE: added lines over 200 characters, LIC_FILES_CHKSUM changes without a License-Update: line, and added CVE_CHECK_IGNORE after kirkstone, as patchtest's metadata suite reports them;
  • documentation (yocto-docs, BitBake manual): the Sphinx build, sphinx-lint, and yocto-docs' check-glossaries and check-confusables.

For other repositories on the lists, such as the Django applications layerindex-web and error-report-web:

  • cppcheck: its error and warning findings in the C files a series touches;
  • ruff and djLint: the Python files and Django templates a series touches;
  • Django's checks: manage.py check and makemigrations --check, in a venv with the application's dependencies;
  • trivy: known vulnerabilities in the application's dependency pins.

Each checker runs on the tree before and after the series, so existing problems are not blamed on the author. See designs/DESIGN.md for the design and docs/STATUS.md for the current state.

Usage

bodnuti check --repo <layer checkout> <Message-ID | lore URL | mbox files...>
  • A Message-ID or lore URL is fetched with b4 mbox. mbox files can be one b4 mbox or one git format-patch file per patch.
  • The base is --base, else a branch named by a subject tag such as [scarthgap], else origin/HEAD.
  • patchtest comes from an openembedded-core checkout: --oecore, defaulting to --repo.
  • --json prints the full report as JSON.

Exit status: 0 clean, 1 findings, 2 a checker could not run or bad input.

bodnuti poll and bodnuti publish are the watcher's commands; see docs/DEPLOY.md.

With pip

Each release has Linux wheels for x86_64 and aarch64. The wheel carries the binary and pulls in oelint-adv, b4 and patchtest's requirements; the docs extra adds Sphinx and sphinx-lint. Install one from the release into a venv, or build it with maturin:

pip install maturin
maturin build --release
python3 -m venv ~/.venvs/bodnuti
~/.venvs/bodnuti/bin/pip install 'target/wheels/bodnuti-<version>-<platform>.whl[docs]'
~/.venvs/bodnuti/bin/bodnuti check --repo <layer> <Message-ID>

The venv does not need to be activated: bodnuti uses the python3, oelint-adv and b4 installed beside it. b4 depends on pygit2, which may have no prebuilt wheel for the newest Python release; use the release before it if pip tries to compile pygit2.

In a container

Each release's image is ghcr.io/moto-timo/bodnuti:<version>, for amd64 and arm64; :main follows the main branch. The image carries oelint-adv, b4, shellcheck, cppcheck, ruff, djLint, trivy, patchtest's Python requirements, and Sphinx with the extensions yocto-docs uses. Mount a clone of the layer that bodnuti may write worktrees into, not your working checkout. It must not be a git clone --shared of a host repository: its object alternates point at host paths the container cannot see. For layers other than openembedded-core, also mount an openembedded-core checkout for patchtest and set BODNUTI_OECORE to it:

docker run --rm \
    -v ~/cache/openembedded-core:/repo \
    ghcr.io/moto-timo/bodnuti:0.5.0 check --repo /repo '<20261023192932.159420-1-peter.marko@siemens.com>'

docker build -t bodnuti -f Containerfile . builds the image from source. For a server deployment with rootless Podman, a read-only container and no network during checks, see docs/DEPLOY.md.

On the host

Install oelint-adv, b4, patchtest's requirements (meta/lib/patchtest/requirements.txt) and, for documentation, the packages in yocto-docs' documentation/Pipfile plus sphinx-lint, in one venv. Point bodnuti at it with --python, --oelint and --b4 (or BODNUTI_PYTHON, BODNUTI_OELINT, BODNUTI_B4). shellcheck runs from its container image by default; set --shellcheck shellcheck to use a local binary.

In Claude Code

The bodnuti plugin checks a series from Claude Code, in the container image; see plugins/bodnuti/README.md:

/plugin marketplace add moto-timo/bodnuti
/plugin install bodnuti@bodnuti

Verifying a release

Each release's wheels and container image carry SLSA build provenance and an SPDX 2.3 SBOM, both signed through Sigstore by the Release workflow, and the image a keyless cosign signature. The wheels' SBOM lists the Rust crates in the bodnuti binary; the image's, one per platform, its Debian, Python and Go packages. The SBOMs are also attached to the GitHub release.

gh attestation verify bodnuti-0.5.0-py3-none-manylinux_2_28_aarch64.whl --repo moto-timo/bodnuti
gh attestation verify oci://ghcr.io/moto-timo/bodnuti:0.5.0 --repo moto-timo/bodnuti
cosign verify ghcr.io/moto-timo/bodnuti:0.5.0 \
  --certificate-identity-regexp '^https://github.com/moto-timo/bodnuti/\.github/workflows/release\.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com
gh attestation verify oci://ghcr.io/moto-timo/bodnuti:0.5.0 --repo moto-timo/bodnuti \
  --predicate-type https://spdx.dev/Document/v2.3

The image of main, ghcr.io/moto-timo/bodnuti:main (and :main-<commit>), is built, attested and signed the same way by the Main image workflow on every push that changes what goes into it; its certificate names that workflow and main:

cosign verify ghcr.io/moto-timo/bodnuti:main \
  --certificate-identity https://github.com/moto-timo/bodnuti/.github/workflows/main-image.yml@refs/heads/main \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

The source has SLSA source provenance too: each push to main and each tag gets a signed source provenance attestation and verification summary, kept in git notes, which the SLSA source tool checks (tags from v0.3.0 on also carry tag provenance, and from v0.5.0 on at SLSA Source Level 3):

sourcetool verify moto-timo/bodnuti --tag v0.5.0

License

bodnuti is licensed under either of the MIT license or the Apache License, Version 2.0, at your option. Unless you say otherwise, a contribution you submit for inclusion is licensed the same way, without further terms.

The container image also carries the tools bodnuti runs, each under its own license: among them shellcheck and cppcheck (GPL-3.0), trivy (Apache-2.0), oelint-adv (BSD-2-Clause), b4 (GPL-2.0), and the Debian packages of the base image.

About

No description, website, or topics provided.

Resources

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages