Skip to content

feature: implement List grpc health_server method#139

Merged
rustatian merged 1 commit into
masterfrom
feature/implement-list-grpc-status
Apr 23, 2025
Merged

feature: implement List grpc health_server method#139
rustatian merged 1 commit into
masterfrom
feature/implement-list-grpc-status

Conversation

@rustatian

@rustatian rustatian commented Apr 23, 2025

Copy link
Copy Markdown
Member

Reason for This PR

closes: roadrunner-server/roadrunner#2162

Description of Changes

  • Add method List introduced by google health-server interface (thank you google for breaking changes in the minor version).

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

Summary by CodeRabbit

  • New Features

    • Added the ability to list the health statuses of available services via the health check interface.
  • Chores

    • Updated Go toolchain and dependency versions for improved stability and compatibility.

Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
@rustatian
rustatian requested a review from Copilot April 23, 2025 10:15
@rustatian rustatian self-assigned this Apr 23, 2025
@coderabbitai

coderabbitai Bot commented Apr 23, 2025

Copy link
Copy Markdown

Walkthrough

The changes update the Go toolchain and several dependencies, most notably upgrading google.golang.org/grpc to v1.72.0. Additionally, the HealthCheckServer type now implements a new List method, aligning it with the updated HealthServer interface required by the latest gRPC version. The List method provides a snapshot of service health statuses, currently returning only the "grpc" service. No other exported entities or existing logic were modified.

Changes

File(s) Change Summary
go.mod Updated Go toolchain to 1.24.2. Upgraded dependencies: google.golang.org/grpc to v1.72.0, genproto modules, and github.com/prometheus/procfs to v0.16.1.
health_server.go Added List method to HealthCheckServer to implement the updated HealthServer interface as required by gRPC v1.72.0.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant HealthCheckServer

    Client->>HealthCheckServer: List(HealthListRequest)
    HealthCheckServer-->>Client: HealthListResponse (with "grpc" service status)
Loading

Assessment against linked issues

Objective Addressed Explanation
Patch custom HealthCheckServer to implement the new List method required by grpc v1.72.0 (#2162)
Upgrade google.golang.org/grpc dependency to v1.72.0 (#2162)

Poem

A hop, a skip, a version bump,
The health server gets a thump!
Now it lists with gRPC’s new call,
Dependencies updated, standing tall.
With every check, we’re up to date,
This rabbit’s code is feeling great! 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (1.64.8)

Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2
Failed executing command with error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rustatian rustatian added the enhancement New feature or request label Apr 23, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the List method to the gRPC health server to implement the google health-server interface and support a non-atomic snapshot view of service health.

  • Added a List method with inline documentation to support health status listing.
  • Returns a basic map with health status for the "grpc" service.
Files not reviewed (2)
  • go.mod: Language not supported
  • go.work.sum: Language not supported
Comments suppressed due to low confidence (1)

health_server.go:44

  • [nitpick] Consider naming the context parameter (e.g., 'ctx') to improve clarity and consistency within the code.
func (h *HealthCheckServer) List(context.Context, *grpc_health_v1.HealthListRequest) (*grpc_health_v1.HealthListResponse, error) {

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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)
health_server.go (1)

46-50: Consider future extensibility of service statuses

The current implementation only includes the 'grpc' service in the statuses map. As the codebase evolves, you might want to extend this to include other services or components.

If you plan to support more services in the future, consider adding a comment indicating this is intentionally limited to just the gRPC service for now:

  return &grpc_health_v1.HealthListResponse{
    Statuses: map[string]*grpc_health_v1.HealthCheckResponse{
      "grpc": {
        Status: h.status,
      },
+     // Additional services can be added here as needed
    },
  }, nil
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 54f9de6 and 9a3b8ce.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • go.work.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod (3 hunks)
  • health_server.go (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
health_server.go (1)
tests/php_test_files/src/Health/HealthCheckResponse.php (1)
  • HealthCheckResponse (14-57)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (go)
  • GitHub Check: gRPC plugin (Go stable, PHP 8.4, OS ubuntu-latest)
🔇 Additional comments (4)
go.mod (3)

5-5: Toolchain update looks good

Updating to the latest Go 1.24.2 toolchain is a sensible choice for keeping the project current.


23-25: Well-coordinated Google API dependencies

These dependency updates are necessary to support the new List method implementation. Specifically, the upgrade to gRPC v1.72.0 is required because this version mandates the implementation of the List method in the health service interface.


41-41: Prometheus dependency update looks good

The indirect dependency update for prometheus/procfs is appropriate alongside the other dependency changes.

health_server.go (1)

33-52: Implementation of List method aligns with the gRPC health check interface requirements

The List method implementation is well-documented with comprehensive comments explaining its purpose, potential issues, and usage recommendations. The current implementation returns a snapshot containing only the 'grpc' service status, which is sufficient for the basic health check functionality.

This change properly implements the interface required by the updated gRPC v1.72.0 dependency, resolving the issue mentioned in the PR description.

@rustatian
rustatian merged commit 3160a86 into master Apr 23, 2025
@rustatian
rustatian deleted the feature/implement-list-grpc-status branch April 23, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🧹 CHORE]: upgrade gRPC to support google.golang.org/grpc@v1.72.0.

2 participants