dev: include dependency checks in the local lint suite - #25399
Open
kumarUjjawal wants to merge 1 commit into
Open
kumarUjjawal wants to merge 1 commit into
kumarUjjawal wants to merge 1 commit into
Conversation
Expose the two dependency checks from the "Dependencies" workflow as shared scripts and run them from `dev/rust_lint.sh` as well, so a contributor sees a dependency cycle or an unused dependency before pushing instead of only in CI. `ci/scripts/check_circular_dependencies.sh` runs `cargo run --locked` in `dev/depcheck`, which is outside the root workspace and locates the root manifest from its own directory. `ci/scripts/check_unused_dependencies.sh` runs `cargo machete --with-metadata` from the repository root and requires `cargo-machete` without installing it. Both keep their command's output and exit status. `CARGO_MACHETE_VERSION="0.9"` moves into the shared tool version file. The workflow loads it into the environment and passes it to the existing install action, keeping the same `0.9` series selector. The lint runner installs a missing `cargo-machete` with `--version ^0.9`, the range Cargo requires for that selector, and registers both scripts as read-only steps after the security audit and before the Rust documentation build. Job IDs, names, containers, checkout options, action revisions, triggers, and permissions are unchanged. The depcheck step drops its `working-directory` because the script enters `dev/depcheck` itself. Partial progress on apache#21048.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25399 +/- ##
==========================================
- Coverage 82.28% 82.28% -0.01%
==========================================
Files 1137 1137
Lines 430173 430211 +38
Branches 430173 430211 +38
==========================================
+ Hits 353978 354002 +24
- Misses 54775 54784 +9
- Partials 21420 21425 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Rationale for this change
dev/rust_lint.shdoes not run the two dependency checks from the "Dependencies" workflow. A contributor finds a dependency cycle or an unused dependency only in CI.What changes are included in this PR?
ci/scripts/check_circular_dependencies.shrunscargo run --lockedindev/depcheck.ci/scripts/check_unused_dependencies.shrunscargo machete --with-metadatafrom the repository root.CARGO_MACHETE_VERSION="0.9"moves toci/scripts/utils/tool_versions.sh, and the workflow loads it from there.dev/rust_lint.shinstalls a missingcargo-macheteand runs both scripts as read-only steps.docs/source/contributor-guide/testing.mddocuments the standalone commands.What is the testing strategy for this PR?
mainexcept the changed steps. The full./dev/rust_lint.shpasses.Are there any user-facing changes?
No.