You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cargo-ensure-no-cyclic-deps): trace directed cycles in forward dependency order - #233
Each newly discovered node clones its entire path. A long SCC such as an N-package ring therefore turns the cycle reconstruction from linear work into O(N²) copied indices and allocations. Keep one predecessor per visited node and reconstruct the path only after finding the edge back to start.
This assertion covers reversed ordering in a simple ring, but not the branched/multi-cycle SCC case called out in the issue, where raw SCC order can imply edges that do not exist. Add a fixture with a branched SCC and assert an exact path whose every transition is a declared dependency; that specifically protects the new traversal rather than only its rotation behavior.
Updated cycle detection logic to handle specific cases of self-loops and multi-node cycles.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
❌ Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.9%. Comparing base (3cd0306) to head (5886090). ⚠️ Report is 2 commits behind head on main.
❌ Your project status has failed because the head coverage (97.9%) is below the target coverage (98.7%). You can increase the head coverage or adjust the target coverage.
All unit and integration tests pass locally, and the MSRV and mutation test suites in CI are green. However, Fast Checks and Tests and Coverage are currently failing in the Anvil runner. As an outside contributor, I cannot see the detailed runner logs for those jobs.
Could you please check what Anvil is reporting for those steps, or let me know if any formatting or test coverage adjustments are needed?
All unit and integration tests pass locally, and the MSRV and mutation test suites in CI are green. However, Fast Checks and Tests and Coverage are currently failing in the Anvil runner. As an outside contributor, I cannot see the detailed runner logs for those jobs.
Could you please check what Anvil is reporting for those steps, or let me know if any formatting or test coverage adjustments are needed?
Thanks!
error: spellcheck(Hunspell)
--> /home/runner/work/ox-tools/ox-tools/crates/cargo_ensure_no_cyclic_deps/src/lib.rs:196
|
196 | Finds a directed cycle path within an SCC by traversing graph edges.
| ^^^
| - CC, SEC, SCI, SIC, SAC, SOC, SCH, or one of 4 others
|
| Possible spelling mistake found.
25herror: recipe `anvil-spellcheck` failed with exit code 1
Hi Pato Sandaña (Pato Sandaña (Pato Sandaña (@psandana))) martin-kolinek,
Thanks for reviewing and approving the changes!
All unit and integration tests pass locally, and the MSRV and mutation test suites in CI are green. However, Fast Checks and Tests and Coverage are currently failing in the Anvil runner. As an outside contributor, I cannot see the detailed runner logs for those jobs.
Could you please check what Anvil is reporting for those steps, or let me know if any formatting or test coverage adjustments are needed?
Thanks!
error: spellcheck(Hunspell)
--> /home/runner/work/ox-tools/ox-tools/crates/cargo_ensure_no_cyclic_deps/src/lib.rs:196
|
196 | Finds a directed cycle path within an SCC by traversing graph edges.
| ^^^
| - CC, SEC, SCI, SIC, SAC, SOC, SCH, or one of 4 others
|
| Possible spelling mistake found.
25herror: recipe `anvil-spellcheck` failed with exit code 1
Hi Pato Sandaña (Pato Sandaña (Pato Sandaña (Pato Sandaña (@psandana)))) martin-kolinek,
Thanks for reviewing and approving the changes!
All unit and integration tests pass locally, and the MSRV and mutation test suites in CI are green. However, Fast Checks and Tests and Coverage are currently failing in the Anvil runner. As an outside contributor, I cannot see the detailed runner logs for those jobs.
Could you please check what Anvil is reporting for those steps, or let me know if any formatting or test coverage adjustments are needed?
Thanks!
error: spellcheck(Hunspell)
--> /home/runner/work/ox-tools/ox-tools/crates/cargo_ensure_no_cyclic_deps/src/lib.rs:196
|
196 | Finds a directed cycle path within an SCC by traversing graph edges.
| ^^^
| - CC, SEC, SCI, SIC, SAC, SOC, SCH, or one of 4 others
|
| Possible spelling mistake found.
25herror: recipe `anvil-spellcheck` failed with exit code 1
Thanks! Adding SCC to .spelling fixed the spellchecker, and all Fast Checks are now green (24 of 28 checks passing).
The only remaining failure is in Tests and Coverage (anvil-llvm-cov coverage gate). Could you let me know what you'd like done for the coverage gate here, or if there is a specific test case you would prefer added? Also happy to update the branch with main whenever you're ready.
The forward-edge traversal and the branching SCC regression look right. A couple of nonblocking suggestions for 9ab544e:
In the combined self-loop/branching test, could we insert graph.add_edge(a, a, ()) after the branch edges? Petgraph 0.8.3 visits the most recently added outgoing edge first. With the current insertion order, the FIFO traversal without the start seed reaches a valid closing branch before the duplicated-start path, so this construction does not distinguish omission of that guard. Adding the self-loop last strengthens that regression without changing the graph or requiring a particular branch: both [a, b] and [a, c] remain valid.
Optionally, could the crate documentation briefly clarify that reports show one representative directed cycle per multi-node SCC, with self-loops separate? Fixing the displayed cycle can leave another cycle in the same component. This is a small reporting clarification, not a request for exhaustive enumeration or stable ordering.
The existing exact-stderr feedback also remains applicable: the ring regression still uses contains at integration_tests.rs:42. Complete stderr equality would check the whole diagnostic; referencing that thread here rather than adding a duplicate finding.
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Fixes #232
tarjan_sccstack-pop order.Validation
cargo test -p cargo-ensure-no-cyclic-deps(all unit and integration tests pass).cargo clippy -p cargo-ensure-no-cyclic-deps --all-targets -- -D warnings(clean).tests/fixtures/with_cyclenow correctly outputscrate_a -> crate_b -> crate_c -> crate_ainstead ofcrate_c -> crate_b -> crate_a -> crate_c.