-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(deps): remove unused dependencies #631
Conversation
WalkthroughThe Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
Cargo.toml (1)
Based on the analysis of the dependencies and their usage in the codebase, I can now provide a final response:
Several dependencies appear to be unused or only used in tests
The following dependencies in Cargo.toml appear to be unused in the main codebase:
async-std
- No usage found in the codebasecriterion
- No usage found (likely only used for benchmarking)percent-encoding
- No usage found in the codebasetracing-subscriber
- No direct usage found despite being a dependencytracing-test
- Only used in tests (should be in dev-dependencies)Consider:
- Moving
tracing-test
to[dev-dependencies]
section- Removing unused dependencies:
async-std
,criterion
,percent-encoding
- Evaluating if
tracing-subscriber
is truly needed or if it's an indirect dependency🔗 Analysis chain
Line range hint
1-128
: PR objective mismatch: No dependencies were removedThe PR title "build(deps): remove unused dependencies" suggests that unused dependencies would be removed. However, the changes only reorganize the
dhat
dependency without removing any dependencies. This appears to be a mismatch between the PR objective and the actual changes.Consider either:
- Updating the PR title to reflect the actual changes (e.g., "build(deps): make dhat dependency optional")
- Or identifying and removing truly unused dependencies if that was the original intention
Let's verify if there are any unused dependencies that could be removed:
Let's gather more information to verify if there are any unused dependencies by comparing the dependencies listed in Cargo.toml with their actual usage in the code.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for potentially unused dependencies using cargo-udeps # Note: This is just a suggestion as cargo-udeps would need to be run locally # First, let's check which dependencies are actually imported in the code rg --type rust "^use\s+(\w+)(::|\s+as\s+)" -g '!target/**' --no-filename | sort -u # Also check for direct references to crate names rg --type rust "extern\s+crate\s+(\w+)" -g '!target/**' --no-filename | sort -uLength of output: 7696
Script:
#!/bin/bash # Get all dependency names from Cargo.toml echo "=== Dependencies from Cargo.toml ===" rg '^\w+ = .*$' Cargo.toml | grep -v '\[' | cut -d' ' -f1 | sort -u # Check for actual usage patterns for potentially unused dependencies echo -e "\n=== Usage Patterns ===" for dep in "async-std" "csv" "criterion" "dhat" "env_logger" "hxdmp" "insta" "jsonl" "pbjson" "percent-encoding" "procfs" "tempfile" "thousands" "tracing-subscriber" "tracing" "tracing-test" "zstd"; do echo "Checking $dep:" rg --type rust -i "\b${dep}[:\s]" --stats echo "---" doneLength of output: 26049
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (1)
Cargo.toml
(2 hunks)
🔇 Additional comments (2)
Cargo.toml (2)
14-14
: LGTM: Feature flag correctly configured
The dhat-heap
feature is now properly configured to depend on the optional dhat
dependency using the dep:
prefix.
82-85
: LGTM: Dependency correctly moved to optional section
The dhat
dependency has been appropriately moved to an optional dependency section, which is the correct way to handle feature-gated dependencies in Rust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
.github/workflows/rust.yml (1)
107-111
: LGTM! Consider expanding cache coverage.The cache configuration for RocksDB system bindings is well-placed before the build step and will help improve build times.
Consider caching additional directories for other system dependencies:
with: cache-directories: | ~/.cargo/registry/src/**/librocksdb-sys-* + ~/.cargo/registry/src/**/libsnappy-sys-* + ~/.cargo/registry/src/**/libsqlite3-sys-*
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/rust.yml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/rust.yml
119-119: property "release-please" is not defined in object type {formatting: {outputs: {}; result: string}}
(expression)
🔇 Additional comments (1)
.github/workflows/rust.yml (1)
Line range hint 1-1
: Verify alignment with PR objectives.
The PR's objective is to "remove unused dependencies", but this workflow file mainly contains changes related to caching and LFS support. Please clarify if these changes are related to dependency removal or if they should be in a separate PR.
🧰 Tools
🪛 actionlint (1.7.4)
119-119: property "release-please" is not defined in object type {formatting: {outputs: {}; result: string}}
(expression)
.github/workflows/rust.yml
Outdated
if: ${{ needs.release-please.outputs.release_created }} | ||
with: | ||
key: "covtest" | ||
cache-directories: | | ||
~/.cargo/registry/src/**/librocksdb-sys-* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix undefined job dependency.
The cache step depends on needs.release-please
but this job is not defined in the workflow. This will cause the condition to fail.
Either:
- Remove this duplicate cache step since it's redundant with the previous one, or
- Add the missing job dependency:
jobs:
+ release-please:
+ runs-on: ubuntu-24.04
+ outputs:
+ release_created: ${{ steps.release.outputs.release_created }}
+ steps:
+ - uses: google-github-actions/release-please-action@v3
+ id: release
Testing:
- needs: Formatting
+ needs: [Formatting, release-please]
runs-on: ubuntu-24.04
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 actionlint (1.7.4)
119-119: property "release-please" is not defined in object type {formatting: {outputs: {}; result: string}}
(expression)
Summary by CodeRabbit
dhat-heap
feature to depend on thedhat
package.dhat
dependency to an optional section, enhancing dependency management.tokio
dependency features for improved functionality.