From 59acc02153302bf643239d6c14dcee87f89cad3d Mon Sep 17 00:00:00 2001 From: Sam & Claude Date: Thu, 4 Jun 2026 20:45:30 +0200 Subject: [PATCH 1/2] style: tidy formatting so all checks pass (Sam & Claude) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `cargo fmt --check` was failing on main in two spots: - crates/colibri-client/src/bin/colibri.rs (register-skill error arm) - crates/colibri-contracts/tests/golden.rs (USB_INV const) Ran `cargo fmt` to resolve them. No behavior change. With this, the whole project is green: fmt, clippy (-D warnings), tests (workspace), and the markdown gate — so the CI workflow (separate PR) lands green on arrival. Co-Authored-By: Claude Opus 4.8 --- crates/colibri-client/src/bin/colibri.rs | 7 ++++++- crates/colibri-contracts/tests/golden.rs | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/colibri-client/src/bin/colibri.rs b/crates/colibri-client/src/bin/colibri.rs index 94b91d9..2f12a4f 100644 --- a/crates/colibri-client/src/bin/colibri.rs +++ b/crates/colibri-client/src/bin/colibri.rs @@ -348,7 +348,12 @@ fn parse_skill_options(args: &[String]) -> Result<(Option, Option return Err(format!("unknown register-skill option: {other}\n\n{}", usage())), + other => { + return Err(format!( + "unknown register-skill option: {other}\n\n{}", + usage() + )) + } } } Ok((description, category)) diff --git a/crates/colibri-contracts/tests/golden.rs b/crates/colibri-contracts/tests/golden.rs index 919dd79..6fd6b82 100644 --- a/crates/colibri-contracts/tests/golden.rs +++ b/crates/colibri-contracts/tests/golden.rs @@ -21,8 +21,7 @@ const OSA_WATCHDOG_STATUS: &str = const OSA_WATCHDOG_RUN: &str = include_str!("../../../manifests/2026-05-26-osa-watchdog-host-status-run-manifest.json"); const DEBBY_INV: &str = include_str!("../../../manifests/2026-05-26-debby-runtime-inventory.json"); -const USB_INV: &str = - include_str!("../../../manifests/2026-06-04-usb-runtime-inventory.json"); +const USB_INV: &str = include_str!("../../../manifests/2026-06-04-usb-runtime-inventory.json"); fn roundtrip_eq(value: &T) where -- 2.45.3 From fe8551f010938ba80ea07982305523d1fc87f22e Mon Sep 17 00:00:00 2001 From: Sam & Claude Date: Thu, 4 Jun 2026 20:47:00 +0200 Subject: [PATCH 2/2] ci: add Forgejo Actions gate (fmt, clippy, tests, markdown) (Sam & Claude) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit colibri had no CI, so a non-compiling main slipped through (the build-break PR #23 had to fix) and the markdown gate from #22 was honor-system only. - .forgejo/workflows/ci.yml: runs on push-to-main + PRs. Two jobs — rust (cargo fmt --check, clippy -D warnings, cargo test --workspace) and markdown (./scripts/check-format.sh). - scripts/ci-checks.sh: same gates in one script, runnable locally before pushing (the workflow and humans share it). Validated: scripts/ci-checks.sh passes end-to-end on this branch (exit 0). NOTE: requires a registered Forgejo Actions runner with an `ubuntu-latest` label that can pull the rust/node images. Adjust runs-on to match the runner. Stacked on `all-checks-green` (the fmt fix) so the first CI run is green; merge that PR first. Co-Authored-By: Claude Opus 4.8 --- .forgejo/workflows/ci.yml | 41 +++++++++++++++++++++++++++++++++++++++ scripts/ci-checks.sh | 25 ++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .forgejo/workflows/ci.yml create mode 100755 scripts/ci-checks.sh diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..84e5e36 --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,41 @@ +# Forgejo Actions CI for Colibri. +# +# Gates every push to main and every pull request on the same checks agents are +# expected to run locally (./scripts/ci-checks.sh): rustfmt, clippy, workspace +# tests, and the markdown format gate. This is what would have caught the +# build-break that PR #23 had to fix. +# +# Requirements (verify on the Forgejo instance): +# - A registered Forgejo Actions runner whose labels include `ubuntu-latest` +# (adjust `runs-on` below to match your runner's label if different). +# - The runner can pull the `rust` and `node` container images and reach +# crates.io / npm for dependencies. +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + rust: + runs-on: ubuntu-latest + container: rust:1.95 + steps: + - uses: actions/checkout@v4 + - name: Ensure rustfmt + clippy are present + run: rustup component add rustfmt clippy + - name: cargo fmt --check + run: cargo fmt --check + - name: cargo clippy (warnings = errors) + run: cargo clippy --workspace --all-targets -- -D warnings + - name: cargo test --workspace + run: cargo test --workspace + + markdown: + runs-on: ubuntu-latest + container: node:20 + steps: + - uses: actions/checkout@v4 + - name: Markdown format gate + run: ./scripts/check-format.sh diff --git a/scripts/ci-checks.sh b/scripts/ci-checks.sh new file mode 100755 index 0000000..bf33164 --- /dev/null +++ b/scripts/ci-checks.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# Run every repository gate, the same set CI runs. Use this before pushing. +# +# ./scripts/ci-checks.sh +# +# Gates: rustfmt, clippy (warnings = errors), workspace tests, markdown format. + +set -eu + +ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)" +cd "$ROOT_DIR" + +echo "==> cargo fmt --check" +cargo fmt --check + +echo "==> cargo clippy --workspace --all-targets -- -D warnings" +cargo clippy --workspace --all-targets -- -D warnings + +echo "==> cargo test --workspace" +cargo test --workspace + +echo "==> markdown format gate" +./scripts/check-format.sh + +echo "All checks passed." -- 2.45.3