ci: modernize tooling checks and example execution - #122
Conversation
This reverts commit a4b9f64.
📝 WalkthroughWalkthroughThis 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. ChangesRust-native Tooling Migration & Supporting Infrastructure
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
justfile (1)
331-332: 💤 Low valueConsider: 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" doneHowever, 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
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (10)
.github/workflows/ci.yml.github/workflows/codacy.ymlAGENTS.mdREADME.mdcliff.tomljustfilepyproject.tomlscripts/tag_release.pyscripts/tests/test_subprocess_utils.pysemgrep.yaml
| #!/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 |
There was a problem hiding this comment.
🧩 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 | sortRepository: 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 || trueRepository: 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.tomlRepository: 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
doneRepository: 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
fiRepository: acgetchell/la-stack
Length of output: 2729
Drop the redundant first build in justfile (build once with --features exact)
cargo build --examplesis unnecessary:cargo build --features exact --examplesalready succeeds and will compile all the examples you later run (including the non-exact_*ones and theexact_*ones).- The example list is still hardcoded (maintainability); consider deriving it from
examples/*.rsorcargo 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.
Closes #111
Closes #112
Closes #113
Summary by CodeRabbit
Documentation
Chores
Tests
Style