fix: not include all dependencies in the generated code of the server#14
fix: not include all dependencies in the generated code of the server#14Bechma merged 1 commit intocyberfabric:mainfrom
Conversation
Signed-off-by: Bechma <19294519+Bechma@users.noreply.github.com>
📝 WalkthroughWalkthroughA single parameter in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/cli/src/common.rs (1)
241-268: Add a regression test for this dependency-selection behavior.This is easy to accidentally revert. Please add a test asserting generated
src/main.rsincludes imports fromcurrent_dependenciesand excludes deps introduced only bycreate_required_deps.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/cli/src/common.rs` around lines 241 - 268, Add a regression test to ensure generate_server_structure selects dependencies correctly: call generate_server_structure (or its helpers) with a controlled current_dependencies and a create_required_deps that would add extra deps, then read the produced "src/main.rs" (created via create_file_structure) and assert that imports rendered by prepare_cargo_server_main include symbols from current_dependencies but do NOT include symbols from deps only returned by create_required_deps; target the behavior in generate_server_structure, prepare_cargo_server_main, create_required_deps and create_file_structure so the test fails if dependency-selection is accidentally reverted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@crates/cli/src/common.rs`:
- Around line 241-268: Add a regression test to ensure generate_server_structure
selects dependencies correctly: call generate_server_structure (or its helpers)
with a controlled current_dependencies and a create_required_deps that would add
extra deps, then read the produced "src/main.rs" (created via
create_file_structure) and assert that imports rendered by
prepare_cargo_server_main include symbols from current_dependencies but do NOT
include symbols from deps only returned by create_required_deps; target the
behavior in generate_server_structure, prepare_cargo_server_main,
create_required_deps and create_file_structure so the test fails if
dependency-selection is accidentally reverted.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ef1193ba-32b2-4a11-a7dc-663bfca0d367
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (1)
crates/cli/src/common.rs
Summary by CodeRabbit