-
Notifications
You must be signed in to change notification settings - Fork 190
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
fix(katana-cli): ensure compilation without server feature #2896
Conversation
WalkthroughOhayo, sensei! The changes introduce conditional compilation for server-related features in the Katana CLI. The modifications focus on adding server and metrics configuration options that can be optionally included during compilation using the "server" feature flag. This approach allows for more flexible and modular code structure, enabling developers to include or exclude server-specific functionality based on their build requirements. Changes
Sequence DiagramsequenceDiagram
participant CLI as Katana CLI
participant Config as Configuration
participant Server as Server Module
alt Server Feature Enabled
CLI->>Config: Configure with server options
Config->>Server: Initialize server components
Server-->>Config: Server configuration complete
else Server Feature Disabled
CLI->>Config: Use default configuration
Config-->>CLI: Minimal configuration applied
end
The sequence diagram illustrates how the CLI handles configuration based on the server feature flag, showing the different paths for enabled and disabled server functionality. 🪧 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
🧹 Nitpick comments (1)
crates/katana/cli/src/args.rs (1)
206-220
: Consider tracking the TODO as a separate issue, sensei!The dev module check at the CLI level is a temporary solution. As noted in the TODO, this validation should be moved to the
katana-node
level for better architectural design.Would you like me to create a GitHub issue to track moving the dev module validation to the node level?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
crates/katana/cli/src/args.rs
(4 hunks)crates/katana/cli/src/options.rs
(2 hunks)
🔇 Additional comments (4)
crates/katana/cli/src/options.rs (3)
Line range hint
10-33
: Ohayo sensei! Clean organization of feature-gated imports.The server-related imports are properly wrapped with
#[cfg(feature = "server")]
, aligning well with the goal of making server features optional.
Line range hint
40-65
: Well-structured metrics configuration!The
MetricsOptions
struct is well-documented and properly feature-gated. The field dependencies are correctly handled through therequires
attribute.
Line range hint
82-127
: Excellent server configuration structure!The
ServerOptions
struct provides a comprehensive set of HTTP-RPC server settings with proper defaults and documentation. The CORS origins handling is particularly well-implemented with custom serialization.crates/katana/cli/src/args.rs (1)
235-235
: Clean default implementation!The default RPC config for non-server builds is appropriately minimal, perfectly aligning with the PR's objective of making server features optional.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2896 +/- ##
==========================================
- Coverage 55.85% 55.84% -0.01%
==========================================
Files 449 449
Lines 57730 57730
==========================================
- Hits 32245 32242 -3
- Misses 25485 25488 +3 ☔ View full report in Codecov by Sentry. |
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.
ah sorry for missing this
This PR ensures the compilation without the
server
feature can happen (mostly used in Slot CLI currently).Summary by CodeRabbit
Release Notes
New Features
Improvements
Configuration