diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49a83d316..85b6fd3f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,14 @@ jobs: components: rustfmt - run: cargo fmt --all --check + cargo-version-sync: + name: Cargo Version Sync + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: dtolnay/rust-toolchain@stable + - run: scripts/check-cargo-version-sync.sh + clippy: name: Lint runs-on: ubuntu-latest @@ -59,7 +67,7 @@ jobs: with: components: clippy - uses: Swatinem/rust-cache@v2 - - run: cargo clippy -p claudette -p claudette-server --all-targets --all-features + - run: cargo clippy -p claudette -p claudette-server -p claudette-cli --all-targets --all-features test: name: Test @@ -72,7 +80,7 @@ jobs: - uses: taiki-e/install-action@cargo-llvm-cov - uses: Swatinem/rust-cache@v2 - name: Run tests with coverage - run: cargo llvm-cov -p claudette -p claudette-server --all-features --lcov --output-path lcov.info + run: cargo llvm-cov -p claudette -p claudette-server -p claudette-cli --all-features --lcov --output-path lcov.info - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: diff --git a/release-please-config.json b/release-please-config.json index 18d36af03..e6b6caf81 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -10,11 +10,7 @@ ], "packages": { ".": { - "include-component-in-tag": false, - "extra-files": [ - "src-tauri/Cargo.toml", - "src-cli/Cargo.toml" - ] + "include-component-in-tag": false } } } diff --git a/scripts/check-cargo-version-sync.sh b/scripts/check-cargo-version-sync.sh new file mode 100755 index 000000000..d1daff42d --- /dev/null +++ b/scripts/check-cargo-version-sync.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -euo pipefail + +repo_root="$(cd "$(dirname "$0")/.." && pwd)" +cd "$repo_root" + +cargo metadata --locked --format-version 1 --no-deps | + python3 -c ' +import json +import sys + +metadata = json.load(sys.stdin) +workspace_members = set(metadata["workspace_members"]) +packages = [ + package + for package in metadata["packages"] + if package["id"] in workspace_members +] + +versions = {} +for package in packages: + versions.setdefault(package["version"], []).append( + (package["name"], package["manifest_path"]) + ) + +if len(versions) != 1: + print("workspace package versions are not in sync", file=sys.stderr) + for version, version_packages in sorted(versions.items()): + print(f" {version}:", file=sys.stderr) + for name, manifest_path in sorted(version_packages): + print(f" - {name}: {manifest_path}", file=sys.stderr) + sys.exit(1) + +version, version_packages = next(iter(versions.items())) +print( + f"Cargo workspace package versions are in sync: " + f"{version} ({len(version_packages)} packages)" +) +' diff --git a/src/agent/naming.rs b/src/agent/naming.rs index 48d8aa769..43ff49351 100644 --- a/src/agent/naming.rs +++ b/src/agent/naming.rs @@ -174,12 +174,10 @@ pub async fn generate_session_name( env.apply(&mut cmd); } - let output = cmd.output().await.map_err(|e| { - format!( - "Failed to spawn claude at {:?} for session name: {e}", - claude_path - ) - })?; + let output = cmd + .output() + .await + .map_err(|e| format!("Failed to spawn claude at {claude_path:?} for session name: {e}"))?; if !output.status.success() { let stderr = String::from_utf8_lossy(&output.stderr); diff --git a/src/db/test_support.rs b/src/db/test_support.rs index 0fe2d636b..8b1eb6e30 100644 --- a/src/db/test_support.rs +++ b/src/db/test_support.rs @@ -3,8 +3,6 @@ //! Each domain module's `mod tests` imports from here so we don't duplicate //! the same `make_*` helpers across files. -#![cfg(test)] - use crate::model::{AgentStatus, ChatMessage, ChatRole, Repository, Workspace, WorkspaceStatus}; use super::Database;