-
Notifications
You must be signed in to change notification settings - Fork 184
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
chore: remove unused deps #2489
Conversation
WalkthroughOhayo, sensei! The recent changes involve significant updates to multiple Changes
Possibly related PRs
Let me know if you need more details, sensei! 🪧 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
Documentation and Community
|
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 (5)
crates/dojo-test-utils/src/lib.rs (1)
1-1
: Ohayo, sensei! This change looks sugoi!Adding the
#![warn(unused_crate_dependencies)]
attribute is a great step towards keeping our codebase clean and efficient. It aligns perfectly with the PR objective of removing unused dependencies.Consider extending this practice to other crates in the project if it hasn't been done already. It could help identify more opportunities for optimization across the entire codebase.
crates/dojo-lang/src/lib.rs (1)
1-1
: Ohayo, sensei! This change looks great!Adding
#![warn(unused_crate_dependencies)]
is a fantastic move! It'll help us keep our crate dependencies lean and mean, just like a true coding ninja. This warning will alert us to any crates we're not actually using, which can speed up compile times and keep our project simpler.For even stricter dependency management, consider leveling up this warning to an error:
-#![warn(unused_crate_dependencies)] +#![deny(unused_crate_dependencies)]This way, we'll be forced to address any unused dependencies immediately, ensuring our codebase stays as clean as a freshly polished katana. What do you think, sensei?
crates/torii/grpc/src/lib.rs (1)
1-1
: Ohayo, sensei! Great addition of the lint directive!The new lint directive
#![warn(unused_crate_dependencies)]
is a fantastic step towards identifying unused dependencies. This aligns perfectly with our PR objective of removing unused deps.However, adding this directive is just the first step. To fully achieve our goal, we should:
- Run the build process to identify the warnings generated by this new directive.
- Remove the unused dependencies highlighted by these warnings.
- Update the
Cargo.toml
file to remove the unused crates.Would you like assistance in generating a script to identify the unused dependencies, sensei?
crates/torii/grpc/Cargo.toml (1)
49-49
: Ohayo, tokio-stream sensei! Let's keep our dependencies in harmony!I noticed that
tokio-stream
has an explicit version specified. For better consistency across the workspace, consider using a workspace reference instead. This approach aligns better with the project's dependency management style.Here's a suggested change:
-tokio-stream = "0.1.14" +tokio-stream.workspace = trueCargo.toml (1)
Line range hint
1-208
: Arigato for the updates, sensei! Here's a quick summary:
- We've added
tokio-util
andslot
, which seem to contradict our goal of removing unused deps.- The alloy dependencies update looks good, but we should verify it doesn't break anything.
- Consider using version numbers instead of git revisions for better reproducibility.
Overall, while some changes align with our objective, others need clarification. Could you provide more context on why we're adding new dependencies in a PR meant to remove unused ones?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (17)
- Cargo.toml (1 hunks)
- crates/dojo-lang/Cargo.toml (1 hunks)
- crates/dojo-lang/src/lib.rs (1 hunks)
- crates/dojo-test-utils/Cargo.toml (0 hunks)
- crates/dojo-test-utils/src/lib.rs (1 hunks)
- crates/katana/runner/macro/Cargo.toml (0 hunks)
- crates/katana/storage/provider/Cargo.toml (0 hunks)
- crates/katana/tasks/Cargo.toml (1 hunks)
- crates/sozo/ops/Cargo.toml (0 hunks)
- crates/torii/client/Cargo.toml (3 hunks)
- crates/torii/core/Cargo.toml (1 hunks)
- crates/torii/core/src/lib.rs (1 hunks)
- crates/torii/graphql/Cargo.toml (1 hunks)
- crates/torii/grpc/Cargo.toml (2 hunks)
- crates/torii/grpc/src/lib.rs (1 hunks)
- crates/torii/libp2p/Cargo.toml (1 hunks)
- crates/torii/libp2p/src/lib.rs (1 hunks)
💤 Files with no reviewable changes (4)
- crates/dojo-test-utils/Cargo.toml
- crates/katana/runner/macro/Cargo.toml
- crates/katana/storage/provider/Cargo.toml
- crates/sozo/ops/Cargo.toml
🔇 Additional comments (30)
crates/torii/libp2p/src/lib.rs (1)
1-1
: Ohayo, sensei! This change looks great!Adding the
#![warn(unused_crate_dependencies)]
attribute is a smart move. It'll help us keep our codebase clean and efficient by alerting us to any crate dependencies we're not actually using. This aligns perfectly with our goal of removing unused deps. Nice work!crates/torii/core/src/lib.rs (1)
1-1
: Ohayo, sensei! This change looks sugoi!Adding
#![warn(unused_crate_dependencies)]
is a great way to keep our codebase clean and efficient. It aligns perfectly with the PR objective of removing unused dependencies.To ensure we're not missing any indirectly used dependencies, let's run a quick check:
If this script returns any output, we might need to review those dependencies to see if they're actually unused or just indirectly used.
crates/katana/tasks/Cargo.toml (2)
14-14
: Ohayo, sensei! LGTM on this change!The modification to use workspace-level version management for tokio-util is a great move. It aligns well with the other dependencies and contributes to a more consistent and maintainable dependency structure.
13-13
: Verify the necessity of the tokio-metrics dependency, sensei.While we're cleaning up dependencies, it might be worth double-checking if tokio-metrics is still needed. If it's not being used, consider removing it to align with the PR objective.
Let's run a quick check to see if tokio-metrics is being used:
If this search doesn't return any results, we might want to consider removing this dependency, sensei.
crates/torii/grpc/src/lib.rs (1)
Line range hint
3-28
: Ohayo again, sensei! Let's talk about our existing code structure.The current file structure looks well-organized with its conditional compilations and modular approach. However, identifying unused dependencies might be tricky due to the different compilation scenarios (wasm32, client, server features).
To ensure we're thorough in our unused dependency removal:
We should verify unused dependencies across all possible compilation scenarios:
- wasm32 target
- client feature
- server feature
- combinations of the above
It might be helpful to use a tool like
cargo-udeps
to identify unused dependencies across different feature flags.Here's a script to help identify unused dependencies across different scenarios:
This script will help us identify unused dependencies across various compilation scenarios, sensei. Let me know if you'd like any modifications or additional checks!
crates/torii/client/Cargo.toml (5)
11-11
: Ohayo, dependency management sensei! LGTM!The change to use workspace reference for
dojo-types
is a great move. It aligns perfectly with our goal of standardizing dependency management across the project.
12-12
: Excellent work, dependency-dojo sensei!The update to
dojo-world
dependency is spot on. You've skillfully transitioned to the workspace reference while keeping the "contracts" feature intact. This change harmonizes well with our dependency management strategy.
23-24
: Ohayo, torii-master sensei! Your changes are impeccable!The updates to
torii-grpc
andtorii-relay
dependencies are perfectly executed. You've successfully transitioned both to workspace references, maintaining the crucial "client" feature fortorii-grpc
. This consistency in dependency management is truly admirable.
37-37
: Ohayo once more, dev-dependency dojo sensei!Your consistency is truly impressive! The shift to a workspace reference for the
dojo-world
dev-dependency is the perfect finishing touch. It's great to see this level of attention to detail, ensuring even the dev-dependencies align with our new management strategy.
Line range hint
11-37
: Ohayo, dependency management grandmaster sensei! Your PR is a work of art!I've thoroughly reviewed all the changes in this Cargo.toml file, and I'm impressed by the consistency and thoughtfulness of your updates. By transitioning all dependencies to use workspace references, you've significantly improved the project's dependency management. This change will likely lead to:
- Improved build times
- Better consistency across the project
- Easier maintenance of dependencies
Your work aligns perfectly with the PR objective of removing unused deps and standardizing dependency management. The careful preservation of necessary features (like "contracts" for dojo-world and "client" for torii-grpc) shows great attention to detail.
Overall, this is an excellent contribution that will benefit the project in the long run. Domo arigato for your diligent work!
crates/torii/core/Cargo.toml (5)
19-19
: Ohayo! Nice workspace optimization, sensei!The change to use
dojo-types.workspace = true
is a good move. It simplifies dependency management and aligns well with the project's structure.
20-20
: Ohayo! Excellent feature preservation, sensei!The modification of
dojo-world
to use workspace declaration while retaining the "contracts" and "manifest" features is spot on. It maintains functionality while improving dependency management.
35-35
: Ohayo! Nice workspace alignment, sensei!The change to use
tokio-util.workspace = true
is a good move. It simplifies dependency management and aligns well with the project's structure.
40-40
: Ohayo! Excellent dev-dependency optimization, sensei!The change to use
dojo-test-utils.workspace = true
in the dev-dependencies is a great move. It brings consistency to the project's dependency management approach.
15-35
: Ohayo, sensei! Great cleanup, but let's double-check!The removal of
hex
,lazy_static
,log
,scarb-ui
, andtokio-stream
aligns perfectly with our objective. Excellent work on identifying these unused dependencies!To ensure we haven't accidentally removed any necessary dependencies, could you run a quick build and test cycle? Here's a script to help:
crates/torii/graphql/Cargo.toml (5)
21-21
: Ohayo, sensei! Nice workspace specification for dojo-types!This change to use the workspace specification for
dojo-types
is a great move. It'll help keep our dependencies consistent across the project and might even speed up our builds a bit. Dojo master approves!
31-31
: Tokio gets the workspace treatment too, sensei! Excellent!Updating
tokio
to use the workspace specification is a smart move. It'll help us maintain consistency and potentially optimize our build process. Your Rust-fu is strong!
35-35
: Ohayo! Torii-core joins the workspace party!Great job updating
torii-core
to use the workspace specification, sensei. This change will help keep our project structure clean and our dependencies in harmony. You're truly mastering the art of Cargo!
42-42
: Dojo-test-utils leveling up with workspace power, sensei!Excellent work on updating
dojo-test-utils
to use the workspace specification while keeping the "build-examples" feature intact. This change shows great attention to detail, maintaining the necessary functionality while improving our project structure. You're a true Cargo ninja!
48-50
: Ohayo, sensei! New dependencies have entered the dojo!I see you've added
sozo-ops
andstarknet-crypto
as workspace dependencies. While this aligns with our workspace-fu, it seems to go against our mission of removing unused deps. Could you enlighten this humble student on why these new dependencies are necessary? Are they replacing some older deps or adding new functionality we need?To help us understand the usage of these new dependencies, could you run this script, sensei?
crates/torii/grpc/Cargo.toml (3)
9-11
: Ohayo, dependency-optimization sensei! These changes look great!The modification of
dojo-types
to use the workspace reference and retainingfutures-util
as a workspace dependency align well with the PR objective of removing unused dependencies while keeping the necessary ones.
50-50
: Ohayo, tonic-sensei! Let's make sure this addition is on key!I see we're adding
tonic
as a workspace dependency. While this seems to go against our goal of removing unused deps, I understand that tonic is a popular gRPC framework. Could you confirm if this addition is necessary for the project's functionality?To help verify the usage of
tonic
, you can run this script:#!/bin/bash # Description: Check for usage of tonic in the codebase # Test: Search for tonic usage rg --type rust 'use.*tonic' ./crates/toriiAlso, could you please explain the impact of this addition on the project? It would be helpful to understand how it fits into the overall architecture.
15-15
: Ohayo, crypto-sensei! Let's double-check this addition.The re-addition of
starknet-crypto
as a workspace dependency seems to go against our mission of removing unused deps. Could you confirm if this dependency is indeed necessary for the project?To help verify the usage of
starknet-crypto
, you can run this script:✅ Verification successful
Ohayo, sensei! It looks like the previous script didn't search for
starknet-crypto
as intended. Let's re-run the check to confirm ifstarknet-crypto
is being used in the project.
Ohayo, sensei!
After checking,starknet-crypto
is actively used in multiple parts of the project:
grpc/src/server/subscriptions/model_diff.rs
grpc/src/server/tests/entities_test.rs
libp2p/src/typed_data.rs
libp2p/src/server/mod.rs
libp2p/src/tests.rs
core/src/sql.rs
core/src/sql_test.rs
graphql/src/tests/subscription_test.rs
core/src/cache.rs
graphql/src/tests/entities_test.rs
The workspace addition of
starknet-crypto
is necessary for these usages.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usage of starknet-crypto in the codebase # Test: Search for starknet-crypto usage rg --type rust 'use.*starknet_crypto' ./crates/toriiLength of output: 448
Script:
#!/bin/bash # Description: Re-check usage of starknet-crypto in the codebase rg --type rust 'use.*starknet_crypto' ./crates/toriiLength of output: 963
crates/dojo-lang/Cargo.toml (3)
30-31
: Ohayo, dependency management sensei! These changes look sugoi!The updates to
dojo-types
anddojo-world
dependencies to use workspace specifications are a great move. This will help maintain consistency across the project and simplify version management.
Line range hint
1-53
: Ohayo once more, dependency-cleanup sensei! Your PR is truly sugoi!Overall, this PR does an excellent job of cleaning up and reorganizing the dependencies for the
dojo-lang
crate. Here's a summary of the improvements:
- Removed several unused dependencies (
cainome
,lazy_static
,num-traits
,once_cell
,serde_with
,starknet-crypto
,assert_fs
,directories
,pretty_assertions
).- Moved some dependencies to dev-dependencies, indicating they're now used only for development or testing.
- Updated many dependencies to use workspace specifications, which will improve consistency across the project.
These changes will lead to a cleaner, more maintainable project structure and potentially faster build times. Great work!
47-48
: Ohayo again, test-savvy sensei! These dev-dependency updates are sugoi desu!The changes to the dev-dependencies look great:
- Adding
cairo-lang-debug
andcairo-lang-parser
- Updating
dojo-test-utils
to use workspace- Adding
once_cell
andsalsa
These modifications align well with the PR objective of removing unused dependencies from the main list.
To ensure these new dev-dependencies are being utilized effectively, could you run this quick check?
Also applies to: 51-53
✅ Verification successful
Ohayo again, sensei! Let's dive a bit deeper to ensure everything's in order.
It seems the initial check didn't find any usage of the new dev-dependencies. To be thorough, let's broaden our search:
Ohayo again, sensei! All checks are go!
Great news—our new dev-dependencies are actively used in the test suite. 🎉
cairo-lang-debug
andcairo-lang-parser
are utilized insemantics/tests.rs
andplugin_test.rs
.once_cell
andsalsa
are effectively integrated withinsemantics/test_utils.rs
andplugin_test.rs
.These updates ensure our main dependencies remain lean, aligning perfectly with the PR's goal.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify usage of new dev-dependencies in test files # Test: Search for usage of new dev-dependencies in test files echo "Checking usage of new dev-dependencies in tests:" rg --type rust -g '**/tests/**' -e 'cairo_lang_debug|cairo_lang_parser|once_cell|salsa' crates/dojo-langLength of output: 213
Script:
# #!/bin/bash # Description: Verify usage of new dev-dependencies across the entire codebase echo "Checking usage of new dev-dependencies in the entire codebase:" rg --type rust -e 'cairo_lang_debug|cairo_lang_parser|once_cell|salsa' crates/dojo-langLength of output: 1515
crates/torii/libp2p/Cargo.toml (3)
Line range hint
43-46
: Ohayo once more, sensei! The WASM support is leveling up!The addition of
tracing-wasm
,wasm-bindgen-futures
,wasm-bindgen-test
, andwasm-timer
is a great move for enhancing our WASM capabilities. This will improve our tracing, testing, and async operations in WASM environments.Let's make sure our WASM-specific code is playing nice with these new additions:
#!/bin/bash # Description: Verify WASM-specific functionality with new dependencies # Check for usage of new WASM-specific dependencies rg --type rust "use.*tracing_wasm" crates/torii/libp2p/src rg --type rust "use.*wasm_bindgen_futures" crates/torii/libp2p/src rg --type rust "use.*wasm_bindgen_test" crates/torii/libp2p/src rg --type rust "use.*wasm_timer" crates/torii/libp2p/src # Verify WASM tests are present and using new dependencies rg --type rust "#\[wasm_bindgen_test\]" crates/torii/libp2p/src
34-38
: Ohayo again, sensei! Let's double-check thercgen
removal.The AI summary mentions the removal of
rcgen = "0.13.1"
, but I don't see it in the provided code. Could you confirm if this dependency was indeed removed?If it was removed, let's make sure it doesn't break anything:
#!/bin/bash # Description: Verify the removal of rcgen and its impact # Check if rcgen is still used anywhere in the crate rg --type rust "use.*rcgen" crates/torii/libp2p/src # Check if any certificate generation functionality is affected rg --type rust "generate.*certificate" crates/torii/libp2p/src
31-32
: Ohayo, sensei! LGTM on the dev dependencies update.The addition of
tokio
andtracing-subscriber
looks good. These will enhance our async testing capabilities and improve logging during development.Let's make sure our test suite is still happy with these changes:
Cargo.toml (1)
Line range hint
201-207
: Sugoi update to alloy dependencies, sensei!The update of alloy dependencies to version "0.3" with
default-features = false
looks good. This aligns well with the PR objective as it might help remove unused features.However, it's important to verify that disabling default features doesn't break any existing functionality.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2489 +/- ##
==========================================
- Coverage 68.98% 68.96% -0.02%
==========================================
Files 372 372
Lines 48526 48526
==========================================
- Hits 33475 33467 -8
- Misses 15051 15059 +8 ☔ View full report in Codecov by Sentry. |
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores