Skip to content

Add GitHub Actions CI, pin Rust toolchain, and enable workspace lints; fix clippy issues#6

Merged
PhantomInTheWire merged 5 commits into
masterfrom
codex/add-ci-for-formatting-and-testing
Mar 23, 2026
Merged

Add GitHub Actions CI, pin Rust toolchain, and enable workspace lints; fix clippy issues#6
PhantomInTheWire merged 5 commits into
masterfrom
codex/add-ci-for-formatting-and-testing

Conversation

@PhantomInTheWire

@PhantomInTheWire PhantomInTheWire commented Mar 19, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Provide a reproducible, CI-enforced Rust quality gate (formatting, linting, tests) for the workspace.
  • Pin the local/CI toolchain so rustfmt/clippy behavior is consistent across environments.
  • Centralize workspace lint policy and perform minimal code/test adjustments so cargo clippy --workspace --all-targets --all-features -- -D warnings can run under a single policy.

Description

  • Add CI workflow at .github/workflows/ci.yml with three jobs: formatting (runs cargo fmt --all --check), clippy (runs cargo clippy --workspace --all-targets --all-features -- -D warnings), and test (runs cargo test --workspace --all-targets --all-features).
  • Add rust-toolchain.toml pinned to 1.92.0 and request clippy/rustfmt components so local and CI toolchains match.
  • Add workspace-level lints in Cargo.toml ([workspace.lints.clippy]) and opt each crate into the shared lint policy by adding [lints] workspace = true to crate Cargo.tomls.
  • Make small code and test hygiene fixes required by Clippy and formatting: collapse a nested if in crates/garuda-segment/src/lib.rs, add #![allow(dead_code)] to test helpers in crates/garuda-engine/tests/common.rs, add an #[expect(...)] justification on a test that must call set_readonly(false), replace a OptimizeOptions::default() call with OptimizeOptions in a test, and apply repository-wide cargo fmt normalization (minor formatting changes in crates/garuda-engine/src/query.rs, crates/garuda-engine/src/validation.rs, garuda/src/main.rs, and test files).

Testing

  • Ran cargo fmt --all --check locally and it passed after running cargo fmt --all to normalize formatting.
  • Ran cargo clippy --workspace --all-targets --all-features -- -D warnings locally and resolved lints so Clippy now completes under the workspace policy.
  • Ran cargo test --workspace --all-targets --all-features locally and observed the existing test failures remain: three failing tests in crates/garuda-engine/tests/test_collection_exception.rs (add_column_rolls_back_state_when_persist_fails, failed_checkpoint_restores_rewritten_segment_files, and failed_persist_does_not_publish_new_manifest_on_reopen), so the CI test job reflects the repository's current behavior rather than masking those failures.

Codex Task

Summary by CodeRabbit

  • New Features

    • Added an is_empty() check for the flat index.
  • Chores

    • Added automated CI pipeline for formatting, linting, and tests.
    • Pinned Rust toolchain to 1.92.0 with clippy and rustfmt.
    • Enforced workspace-wide lint settings and upgraded clippy rules to treat certain patterns as errors.
  • Refactor

    • Minor internal control-flow and style refinements across modules.

Open with Devin

@coderabbitai

coderabbitai Bot commented Mar 19, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9cf992d3-dc25-4621-85e6-1bd73fc88554

📥 Commits

Reviewing files that changed from the base of the PR and between 5ac47f8 and f6cb3c0.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

Adds GitHub Actions CI and pins Rust toolchain to 1.92.0; introduces workspace-level Clippy lints denying dbg_macro and todo; propagates lint inheritance to crate manifests; small test attribute tweaks and minor refactors including a new FlatIndex::is_empty method.

Changes

Cohort / File(s) Summary
CI & Toolchain
\.github/workflows/ci.yml, rust-toolchain.toml
Adds GitHub Actions workflow running cargo fmt, cargo clippy, cargo test on push/PR; pins Rust toolchain to 1.92.0 with clippy and rustfmt components.
Workspace lints
Cargo.toml, crates/.../Cargo.toml, garuda/Cargo.toml
Introduces [workspace.lints.clippy] denying dbg_macro and todo; adds [lints] workspace = true to multiple crate manifests so they inherit workspace lint settings.
Crate manifest updates
crates/garuda-engine/Cargo.toml, crates/garuda-index-flat/Cargo.toml, crates/garuda-index-hnsw/Cargo.toml, crates/garuda-math/Cargo.toml, crates/garuda-meta/Cargo.toml, crates/garuda-planner/Cargo.toml, crates/garuda-segment/Cargo.toml, crates/garuda-storage/Cargo.toml, crates/garuda-types/Cargo.toml, garuda/Cargo.toml
Each crate now has a [lints] section with workspace = true to opt into workspace lint inheritance.
Tests & annotations
crates/garuda-engine/tests/common.rs, crates/garuda-engine/tests/test_collection_exception.rs, crates/garuda-engine/tests/test_collection_optimize.rs
Adds #![allow(dead_code)] to test helper; adds an #[expect(clippy::...)] attribute to one test; adjusts one test call argument from OptimizeOptions::default() to OptimizeOptions.
API addition
crates/garuda-index-flat/src/lib.rs
Adds pub fn is_empty(&self) -> bool to FlatIndex.
Refactors / control-flow simplifications
crates/garuda-index-hnsw/src/build.rs, crates/garuda-index-hnsw/src/search.rs, crates/garuda-segment/src/index.rs, crates/garuda-segment/src/search.rs
Replaces some explicit return with tail expressions, uses ? for early None return, and consolidates nested conditionals; no behavioral changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰
I hopped through code and linted stout,
CI now runs, the checks set out.
No dbg! nor todo left to find,
Small refactors, tidy mind.
A happy rabbit, build passed — hop! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.32% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and specifically captures all main objectives: adding GitHub Actions CI, pinning the Rust toolchain, enabling workspace lints, and fixing clippy issues.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-ci-for-formatting-and-testing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@PhantomInTheWire PhantomInTheWire force-pushed the codex/add-ci-for-formatting-and-testing branch from db9528d to 5ac47f8 Compare March 23, 2026 12:27
@PhantomInTheWire PhantomInTheWire merged commit 28bb6c7 into master Mar 23, 2026
5 checks passed
@PhantomInTheWire PhantomInTheWire deleted the codex/add-ci-for-formatting-and-testing branch March 23, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant