-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
refactor(hubl): handle the case when grpc endpoints is nil #20603
Conversation
WalkthroughWalkthroughThe recent changes in Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Registry
participant ChainRegistryEntry
User->>Registry: Call GetChainRegistryEntry(chain)
Registry->>ChainRegistryEntry: Retrieve entry
ChainRegistryEntry-->>Registry: Return entry
Registry->>Registry: Clean up API addresses
Registry-->>User: Return cleaned entry or error message
User->>Registry: Call SelectGRPCEndpoints(chain)
Registry->>ChainRegistryEntry: Retrieve entry
ChainRegistryEntry-->>Registry: Return entry
Registry->>Registry: Clean up API addresses
Registry->>User: Prompt for gRPC endpoint selection
User-->>Registry: Select endpoint
Registry-->>User: Return selected endpoint or error message
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: 1
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- tools/hubl/internal/registry.go (2 hunks)
Additional context used
Path-based instructions (1)
tools/hubl/internal/registry.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (2)
tools/hubl/internal/registry.go (2)
44-45
: LGTM! The logic to remove the "http(s)://" prefix is implemented correctly.
78-78
: The display of available gRPC endpoints is clear and user-friendly.Also applies to: 81-81
if err != nil || len(entry.APIs.GRPC) == 0 { | ||
if err != nil { | ||
// print error here so that user can know what happened and decide what to do next | ||
fmt.Printf("Failed to load data for %s in the chain registry: %v\n", chain, err) | ||
} else { | ||
fmt.Printf("Found empty gRPC endpoint of %s in the chain registry.\n", chain) | ||
} | ||
fmt.Println("Specify a custom gRPC endpoint manually.") |
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.
The error handling and user prompts are well-implemented. However, consider handling the case of empty gRPC endpoints more proactively by suggesting default endpoints or providing more guidance.
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.
utACK! Tysm
Summary by CodeRabbit