Skip to content

ci: modernize tooling checks and example execution - #122

Merged
acgetchell merged 1 commit into
mainfrom
ci/111-112-tooling-speedups
Jun 3, 2026
Merged

ci: modernize tooling checks and example execution#122
acgetchell merged 1 commit into
mainfrom
ci/111-112-tooling-speedups

Conversation

@acgetchell

@acgetchell acgetchell commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Closes #111
Closes #112
Closes #113

Summary by CodeRabbit

  • Documentation

    • Updated README with details on repository tooling, CI validation, and platform coverage.
    • Refined developer guidance on command ordering.
  • Chores

    • Updated CI workflow configuration and pinned versions.
    • Enhanced Python version detection robustness.
    • Refined build example execution and tool installation logic.
  • Tests

    • Improved determinism of git helper tests with mocking.
  • Style

    • Added validation rule for consistent command documentation order.

@acgetchell acgetchell self-assigned this Jun 3, 2026
@acgetchell
acgetchell enabled auto-merge June 3, 2026 02:49
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR migrates the repository from Node-backed documentation and configuration tooling to Rust-native alternatives, hardens the justfile recipe infrastructure, optimizes example execution, and updates repository guidance and enforcement to reflect the change. Changes span CI workflows, documentation, justfile recipes, test infrastructure, and code-quality rules.

Changes

Rust-native Tooling Migration & Supporting Infrastructure

Layer / File(s) Summary
Repository Guidance & Enforcement
AGENTS.md, README.md, semgrep.yaml
Documents shift to Rust-native tools (rumdl, dprint, taplo, typos), reorders command examples to show just check before just fix, and adds a Semgrep rule that enforces this check-before-fix ordering across documentation and justfile to catch regressions.
Python & Release Infrastructure Setup
.github/workflows/ci.yml, .github/workflows/codacy.yml, scripts/tag_release.py, pyproject.toml
CI workflow reads Python version from .python-version file instead of hardcoding version; release script shebang updated to use uv run; pytest pinned to exact version 9.0.3; Codacy action comment updated to indicate v4.4.7.
Justfile Version Detection Robustness
justfile
Adds error suppression (2>/dev/null) and fallback (\|\| true) to version extraction across eight cargo-installed tools to prevent script breakage when version parsing fails or tools are missing.
Justfile New Recipes & Aliases
justfile
Introduces shell-fix (alias for shell-fmt), toml-check (composition of existing TOML lint and format checks), and toml-fix (alias for toml-fmt) to complete check/fix naming convention.
Justfile Examples Recipe Optimization
justfile
Examples recipe changed from running each example via cargo run to building examples once and directly executing compiled binaries from target/debug/examples/, including conditional .exe suffix for Windows.
Justfile setup-tools Smart Installation
justfile
Refines tool installation with combined presence and version-mismatch checks using parsed --version output; adds dedicated jq missing-notice block during setup to guide users when jq is unavailable.
Supporting Configuration & Tests
cliff.toml, scripts/tests/test_subprocess_utils.py
Changelog dependency-bump regex updated to match broader dependency update phrasing; git-helper test replaced with mocked deterministic version that patches subprocess calls, validates exact return values, and verifies call argument sequences.

🐰 From rust to native roots so deep,
No Node dependencies in the keep,
Recipes now check before they fix,
Examples run from binary mix,
Robustness springs from fallback's trick!

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: modernize tooling checks and example execution' directly reflects the main changes: updating CI workflow configuration, replacing Node tools with Rust-native tooling, and refactoring example execution from cargo run to binary execution.
Linked Issues check ✅ Passed The PR addresses all three linked issues: #111 (Rust-native tooling and Semgrep rules), #112 (example compilation speedup), and #113 (CI shape optimization) through justfile recipes, workflow updates, documentation, and configuration changes.
Out of Scope Changes check ✅ Passed All changes are directly aligned with stated objectives: CI workflow updates, tooling configuration modernization, example execution refactoring, documentation updates, and recipe standardization. No unrelated changes detected.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/111-112-tooling-speedups

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

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.62%. Comparing base (a4b9f64) to head (758321a).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #122   +/-   ##
=======================================
  Coverage   99.62%   99.62%           
=======================================
  Files           5        5           
  Lines        2150     2150           
=======================================
  Hits         2142     2142           
  Misses          8        8           
Flag Coverage Δ
unittests 99.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
justfile (1)

331-332: 💤 Low value

Consider: Dynamic example discovery instead of hardcoded list.

The example list is hardcoded and must be manually updated when examples are added or removed. For better maintainability, consider dynamically discovering built examples:

for example_path in target/debug/examples/*"${exe_suffix}"; do
    [ -f "$example_path" ] || continue
    "$example_path"
done

However, this assumes all binaries in target/debug/examples/ are runnable examples. The current explicit list provides clarity and safety, so this is a trade-off between maintainability and control.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@justfile` around lines 331 - 332, The current for-loop in justfile that
iterates over the hardcoded examples list (det_5x5, solve_5x5, ldlt_solve_3x3,
etc.) should be changed to dynamically discover binaries under
target/debug/examples using a glob so you don't have to update the list
manually; iterate over target/debug/examples/*"${exe_suffix}", skip non-files
(use a file test) and invoke each found binary. Optionally add a filter or allow
an explicit whitelist/env override if you want to retain control over which
discovered files are executed. Ensure the change replaces the existing hardcoded
list loop (the line starting with for example in ...) and preserves exe_suffix
usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@justfile`:
- Around line 321-333: Remove the redundant plain build invocation and use a
single feature-enabled build: delete the line with "cargo build --examples" and
keep only "cargo build --features exact --examples"; then replace the hardcoded
example list in the "for example in det_5x5 ..." loop with a dynamic discovery
(e.g., globbing examples/*.rs and stripping .rs to produce each example name)
while preserving the exe_suffix logic and the invocation pattern
"target/debug/examples/${example}${exe_suffix}" so CI runs the exact-built
example binaries without manual list maintenance.

---

Nitpick comments:
In `@justfile`:
- Around line 331-332: The current for-loop in justfile that iterates over the
hardcoded examples list (det_5x5, solve_5x5, ldlt_solve_3x3, etc.) should be
changed to dynamically discover binaries under target/debug/examples using a
glob so you don't have to update the list manually; iterate over
target/debug/examples/*"${exe_suffix}", skip non-files (use a file test) and
invoke each found binary. Optionally add a filter or allow an explicit
whitelist/env override if you want to retain control over which discovered files
are executed. Ensure the change replaces the existing hardcoded list loop (the
line starting with for example in ...) and preserves exe_suffix usage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d5db70df-8304-4e77-acef-c81825a2a3d9

📥 Commits

Reviewing files that changed from the base of the PR and between a4b9f64 and 758321a.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • .github/workflows/ci.yml
  • .github/workflows/codacy.yml
  • AGENTS.md
  • README.md
  • cliff.toml
  • justfile
  • pyproject.toml
  • scripts/tag_release.py
  • scripts/tests/test_subprocess_utils.py
  • semgrep.yaml

Comment thread justfile
Comment on lines +321 to +333
#!/usr/bin/env bash
set -euo pipefail
cargo build --examples
cargo build --features exact --examples

exe_suffix=""
if [[ "${OS:-}" == "Windows_NT" ]]; then
exe_suffix=".exe"
fi

for example in det_5x5 solve_5x5 ldlt_solve_3x3 const_det_4x4 exact_det_3x3 exact_sign_3x3 exact_solve_3x3; do
"target/debug/examples/${example}${exe_suffix}"
done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify if all examples compile without and with the exact feature.

echo "Testing: cargo build --examples (no features)"
if cargo build --examples 2>&1 | tee /tmp/build-no-features.log; then
  echo "✓ All examples built without features"
else
  echo "✗ Some examples failed without features"
  echo "Failed examples (if any):"
  grep -i "could not compile\|error" /tmp/build-no-features.log | head -10
fi

echo ""
echo "Testing: cargo build --features exact --examples"
if cargo build --features exact --examples 2>&1 | tee /tmp/build-with-exact.log; then
  echo "✓ All examples built with exact feature"
else
  echo "✗ Some examples failed with exact feature"
fi

echo ""
echo "Checking which examples exist:"
fd -t f . target/debug/examples/ -x basename | sort

Repository: acgetchell/la-stack

Length of output: 572


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Cargo.toml: required-features for examples =="
rg -n --hidden -S --no-messages "required-features" Cargo.toml || true
rg -n --hidden -S --no-messages "\\[\\[example\\]\\]" Cargo.toml || true

echo
echo "== Cargo.toml: feature named 'exact' definition ==" 
rg -n --hidden -S --no-messages "^[[:space:]]*exact[[:space:]]*=" Cargo.toml || true
rg -n --hidden -S --no-messages "\\bfeatures\\b" Cargo.toml | head -50

echo
echo "== Search for cfg(feature = \"exact\") usage (examples + src) =="
rg -n --hidden -S --no-messages "cfg\\(.*feature\\s*=\\s*\"exact\".*\\)" Cargo.toml src examples . || true

echo
echo "== Search example sources for exact APIs (det_exact/solve_exact/etc.) =="
rg -n --hidden -S --no-messages "\\bdet_exact\\b|\\bdet_exact_f64\\b|\\bdet_sign_exact\\b|\\bsolve_exact\\b|\\bsolve_exact_f64\\b" examples src || true

echo
echo "== List example files that likely correspond to the justfile names =="
fd -t f -a -S "exact_(det|sign|solve)_3x3|exact_det_3x3|exact_sign_3x3|exact_solve_3x3|det_5x5|solve_5x5|ldlt_solve_3x3|const_det_4x4" -E target . || true

echo
echo "== Show those example files (header area + exact feature usage if present) =="
# Attempt to locate and print small sections only
fd -t f -a -S "examples/(exact_(det|sign|solve)_3x3|det_5x5|solve_5x5|ldlt_solve_3x3|const_det_4x4)\\.rs$" . -e rs || true

Repository: acgetchell/la-stack

Length of output: 13006


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Cargo.toml example blocks (lines 25-80) =="
nl -ba Cargo.toml | sed -n '1,120p' | sed -n '25,120p'

Repository: acgetchell/la-stack

Length of output: 170


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Cargo.toml section around required-features = [ \"exact\" ] (lines ~20-70) =="
cat -n Cargo.toml | sed -n '20,80p'

Repository: acgetchell/la-stack

Length of output: 1491


🏁 Script executed:

#!/bin/bash
set -euo pipefail

for ex in det_5x5 solve_5x5 ldlt_solve_3x3 const_det_4x4; do
  echo "== $ex =="
  rg -n "\\[\\[example\\]\\]|name = \"${ex}\"|required-features" Cargo.toml -n || true
done

echo
echo "== All example blocks with required-features =="
rg -n "\\[\\[example\\]\\]|required-features" Cargo.toml

Repository: acgetchell/la-stack

Length of output: 1328


🏁 Script executed:

#!/bin/bash
set -euo pipefail

for ex in det_5x5 solve_5x5 ldlt_solve_3x3 const_det_4x4 exact_det_3x3 exact_sign_3x3 exact_solve_3x3; do
  echo "== Context for name = \"$ex\" =="
  rg -n --fixed-strings "name = \"$ex\"" Cargo.toml -C 6 || true
  echo
done

Repository: acgetchell/la-stack

Length of output: 1156


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== List example source files under examples/ =="
find examples -maxdepth 1 -type f -name "*.rs" -printf "%f\n" | sort || true

echo
echo "== Search for these example names in Cargo.toml =="
for ex in det_5x5 solve_5x5 ldlt_solve_3x3 const_det_4x4; do
  echo "-- $ex --"
  rg -n --fixed-strings "name = \"$ex\"" Cargo.toml || true
done

echo
echo "== Search for these example names in the repo =="
for ex in det_5x5 solve_5x5 ldlt_solve_3x3 const_det_4x4; do
  echo "-- $ex --"
  rg -n --fixed-strings "$ex" . || true
done

echo
echo "== Build logging (no tee): cargo build --examples =="
rm -f /tmp/build-no-features.log
if cargo build --examples > /tmp/build-no-features.log 2>&1; then
  echo "✓ cargo build --examples succeeded"
else
  echo "✗ cargo build --examples failed (showing tail of log)"
  tail -n 80 /tmp/build-no-features.log
fi

echo
echo "== Build logging: cargo build --features exact --examples =="
rm -f /tmp/build-with-exact.log
if cargo build --features exact --examples > /tmp/build-with-exact.log 2>&1; then
  echo "✓ cargo build --features exact --examples succeeded"
else
  echo "✗ cargo build --features exact --examples failed (showing tail of log)"
  tail -n 80 /tmp/build-with-exact.log
fi

Repository: acgetchell/la-stack

Length of output: 2729


Drop the redundant first build in justfile (build once with --features exact)

  • cargo build --examples is unnecessary: cargo build --features exact --examples already succeeds and will compile all the examples you later run (including the non-exact_* ones and the exact_* ones).
  • The example list is still hardcoded (maintainability); consider deriving it from examples/*.rs or cargo metadata.
  • ${OS:-} == "Windows_NT" handling is fine for typical Windows runners, but it won’t work in WSL (minor/optional).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@justfile` around lines 321 - 333, Remove the redundant plain build invocation
and use a single feature-enabled build: delete the line with "cargo build
--examples" and keep only "cargo build --features exact --examples"; then
replace the hardcoded example list in the "for example in det_5x5 ..." loop with
a dynamic discovery (e.g., globbing examples/*.rs and stripping .rs to produce
each example name) while preserving the exe_suffix logic and the invocation
pattern "target/debug/examples/${example}${exe_suffix}" so CI runs the
exact-built example binaries without manual list maintenance.

@acgetchell
acgetchell merged commit 1c6c20f into main Jun 3, 2026
17 checks passed
@acgetchell
acgetchell deleted the ci/111-112-tooling-speedups branch June 3, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant