chore: Rust format and testing in CI#2205
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Greptile SummaryThis PR introduces a
Confidence Score: 5/5Safe to merge — the workflow correctly discovers workspaces, runs all three cargo checks with appropriate flags, and gates ci-complete on the new job. The cargo commands are well-formed, workspace flags are consistent across all three steps, and the heredoc output pattern is correctly used. The only gap is that the workspace loops run sequentially rather than in parallel, but this is a performance concern, not a correctness one. No files require special attention; the single changed file is straightforward CI configuration. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Push / PR event] --> B[rust job]
B --> C[Checkout]
C --> D[Find Cargo workspace roots\nfind Cargo.lock → crates output]
D --> E[Install Rust toolchain\nrustfmt + clippy]
E --> F[Cache cargo build\nSwatinem/rust-cache]
F --> G[cargo fmt loop\nfor each workspace sequentially]
G --> H[cargo clippy loop\nfor each workspace sequentially]
H --> I[cargo test loop\nfor each workspace sequentially]
I --> J[ci-complete gate\nalls-green check]
J -->|pass| K[Branch protection satisfied]
J -->|fail| L[PR blocked]
Reviews (4): Last reviewed commit: "Remove crate matrix and discovery job" | Re-trigger Greptile |
|
@Dreamsorcerer can you review? |
Co-authored-by: Sam Bull <git@sambull.org>
Co-authored-by: Sam Bull <git@sambull.org>
Co-authored-by: Sam Bull <git@sambull.org>
| matrix: | ||
| crate: ${{ fromJSON(needs.rust-discover.outputs.crates) }} |
There was a problem hiding this comment.
One blocking detail here I think. I don't think we should be using a matrix here, atleast from what I see of the current run.
Currently, this results in 3 separate jobs, requiring 3 workers. Each job only takes ~20s with about 50% of that time doing the setup/teardown of the job.
So currently this is basically 3 x 20s, instead of 1 x 40s. The difference today is neglible, but if we start adding in more crates over time, then this will lead to worker starvation and delay the other (slower) test jobs.
There was a problem hiding this comment.
oops I approved, but disabled auto-merge, letting you guys decide, just ping me when you need approval
There was a problem hiding this comment.
That's a good point, I'll change that
There was a problem hiding this comment.
should be fixed now, also removed the separate discover job
Problem
Need to run Rust formatting checks and tests in CI
Closes DIM-938
Solution
Added auto discovery job to find all Rust workspaces in the repository based on
Cargo.lock. Then runcargo fmt,cargo clippy,cargo testin all work spaces in parallel.How to Test
Run in CI, result of all three commands matches local results. All workspaces are automatically detected without any hardcoded paths.
Contributor License Agreement