-
Notifications
You must be signed in to change notification settings - Fork 245
fix(ci): update error checking for CLI ci to catch errors #1737
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
Conversation
WalkthroughIn the Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration 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: 2
Outside diff range and nitpick comments (2)
cmd/rollkit/commands/run_node.go (2)
Line range hint
257-265: Enhance error messaging for better debugging support.When starting the mock server fails, the error message could provide more context to help with troubleshooting.
- return nil, err + return nil, fmt.Errorf("failed to start mock JSONRPC server: %w", err)
Line range hint
269-314: Standardize error handling and improve logging.Error handling in file operations should be consistent. Also, consider enhancing the logging for better traceability of operations.
- return err + return fmt.Errorf("error generating node key: %w", err) ... - return err + return fmt.Errorf("error saving genesis file: %w", err)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- cmd/rollkit/commands/run_node.go (1 hunks)
Additional comments not posted (1)
cmd/rollkit/commands/run_node.go (1)
Line range hint
243-254: Command-line flags setup appears robust.The method for adding node flags is appropriately structured and uses the established libraries and patterns for CLI applications in Go. Good job maintaining consistency with the existing codebase.
tuxcanfly
left a comment
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.
OK.
Co-authored-by: Javed Khan <[email protected]>
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- cmd/rollkit/commands/run_node.go (1 hunks)
Additional context used
golangci-lint
cmd/rollkit/commands/run_node.go
186-186: File is not
goimports-ed with -local github.com/rollkit(goimports)
Additional comments not posted (1)
cmd/rollkit/commands/run_node.go (1)
182-188: Refactor error handling to improve clarity and maintainability.The changes made to improve error checking in the CI process are crucial for ensuring the node's reliability. However, the order of checks and the clarity of error messages can be further improved. Specifically, checking if the node is running should come before checking the block height to avoid unnecessary operations if the node isn't running. Additionally, the error message can be more descriptive to aid in troubleshooting.
[REFACTOR_SUGGESTion]
- if res.Block.Height == 0 { - return fmt.Errorf("node hasn't produced any blocks") - } - if !rollnode.IsRunning() { + if !rollnode.IsRunning() { + return fmt.Errorf("node is not running") + } + if res.Block.Height == 0 { return fmt.Errorf("node hasn't produced any blocks, ensure your configuration is correct and the network is operational") }Tools
golangci-lint
186-186: File is not
goimports-ed with -local github.com/rollkit(goimports)
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: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- cmd/rollkit/commands/run_node.go (1 hunks)
Additional context used
golangci-lint
cmd/rollkit/commands/run_node.go
191-191: File is not
goimports-ed with -local github.com/rollkit(goimports)
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- cmd/rollkit/commands/run_node.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- cmd/rollkit/commands/run_node.go
tuxcanfly
left a comment
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.
OK.
Overview
Related to #1736
CI wasn't catching errors when the node can't start but also can't stop.
Note: this is uncovering a bug on main so the CI is expected to now be failing until the fix is corrected.
Summary by CodeRabbit