Skip to content
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

feature: http health and readiness checks #130

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

rustatian
Copy link
Member

@rustatian rustatian commented Nov 29, 2023

Reason for This PR

ref: https://github.com/orgs/roadrunner-server/discussions/967

Description of Changes

  • Add the regular /health and /ready http endpoints.

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

  • Refactor

    • Removed goconst linter to streamline the linting process.
  • New Features

    • Integrated grpc package to enhance plugin communication capabilities.
    • Implemented Status() and Ready() functions for improved plugin status reporting.
  • Documentation

    • Updated configuration documentation to reflect new version '3' settings.
  • Tests

    • Updated test cases to align with the new version '2023.3.0'.
    • Expanded test configurations to include new GRPC service settings and RPC configurations.

@rustatian rustatian added the enhancement New feature or request label Nov 29, 2023
@rustatian rustatian requested a review from wolfy-j November 29, 2023 19:49
@rustatian rustatian self-assigned this Nov 29, 2023
Copy link

coderabbitai bot commented Nov 29, 2023

Walkthrough

The recent updates involve the removal of the goconst linter from the .golangci.yml configuration, indicating a shift in linting practices. In status.go, new dependencies and functions have been introduced, expanding the plugin's capabilities with grpc and status management. The tests/configs/.rr-grpc-status.yaml file has been configured for a new version with enhanced GRPC and server settings. Test files in the tests directory reflect an update to a new version 2023.3.0 and the addition of a new import related to status checking.

Changes

File Path Change Summary
.golangci.yml Removed goconst linter
status.go Added grpc package, new imports, and Status(), Ready() functions
tests/configs/.../.rr-grpc-status.yaml Added new version '3' config, RPC/server/status/GRPC service settings
tests/grpc_plugin_gzip_test.go
tests/grpc_plugin_test.go
Updated Version field from "2.9.0" to "2023.3.0", added status/v4 import in grpc_plugin_test.go

🐇✨
In the realm of code, where the rabbits hop,
We've trimmed our linters, and our GRPC won't stop.
With versions so new, and tests all a-gleam,
We leap through the pipelines, a dev's dream.
🌟🚀🐾


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 5

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 895c2dc and be8b322.
Files ignored due to filter (5)
  • go.mod
  • go.sum
  • go.work.sum
  • tests/go.mod
  • tests/go.sum
Files selected for processing (5)
  • .golangci.yml (1 hunks)
  • status.go (1 hunks)
  • tests/configs/.rr-grpc-status.yaml (1 hunks)
  • tests/grpc_plugin_gzip_test.go (5 hunks)
  • tests/grpc_plugin_test.go (12 hunks)
Additional comments: 13
.golangci.yml (1)
  • 53-58: The removal of goconst from the linters-settings section is consistent with the summary and pull request overview. However, ensure that the goconst linter is also removed from the enabled linters list if it was previously included.
tests/configs/.rr-grpc-status.yaml (3)
  • 1-30: The configuration file has been updated with new settings for version '3', including RPC, server, status, and GRPC service configurations. Ensure that these settings are compatible with the rest of the application and that the specified ports are not already in use or blocked by firewalls.

  • 19-20: The max_send_msg_size and max_recv_msg_size are set to 50, which may be too low for practical use. Verify that this limit is sufficient for the expected message sizes in the application.

  • 21-23: The max_connection_idle, max_connection_age, and max_connection_age_grace are set to '0s', which might indicate no limit. Confirm that this is the intended behavior, as it could lead to connections never being closed and potentially cause resource leaks.

tests/grpc_plugin_gzip_test.go (5)
  • 33-39: The update of the Version field in the config.Plugin struct to "2023.3.0" is consistent with the summary provided. This change is likely to align the tests with the new features and ensure compatibility with the updated version of the application.

  • 110-116: The update of the Version field in the config.Plugin struct to "2023.3.0" is consistent with the summary provided. This change is likely to align the tests with the new features and ensure compatibility with the updated version of the application.

  • 204-210: The update of the Version field in the config.Plugin struct to "2023.3.0" is consistent with the summary provided. This change is likely to align the tests with the new features and ensure compatibility with the updated version of the application.

  • 289-295: The update of the Version field in the config.Plugin struct to "2023.3.0" is consistent with the summary provided. This change is likely to align the tests with the new features and ensure compatibility with the updated version of the application.

  • 374-380: The update of the Version field in the config.Plugin struct to "2023.3.0" is consistent with the summary provided. This change is likely to align the tests with the new features and ensure compatibility with the updated version of the application.

tests/grpc_plugin_test.go (4)
  • 25-28: The addition of the status/v4 import aligns with the introduction of health and readiness endpoints as described in the summary.

  • 47-53: The update of the version in the cfg struct to "2023.3.0" is consistent with the summary and seems to be a necessary change to align the tests with the new application version.

  • 109-215: The version update to "2023.3.0" in the cfg struct is consistently applied across all test functions, ensuring compatibility with the new features and application version.

  • 25-31: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [432-434]

The TestGrpcFullErrorMessageIssue1193 function still uses the version "2.10.6". If this is intentional for testing backward compatibility or a specific issue, it may be acceptable. Otherwise, consider updating it to "2023.3.0" for consistency.

tests/configs/.rr-grpc-status.yaml Show resolved Hide resolved
status.go Show resolved Hide resolved
status.go Show resolved Hide resolved
status.go Show resolved Hide resolved
status.go Show resolved Hide resolved
@rustatian rustatian merged commit 72c6f83 into master Nov 29, 2023
6 checks passed
@rustatian rustatian deleted the feature/health-readiness-checks branch May 13, 2024 00:03
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
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

1 participant