implement gateway health check - #3000
Conversation
|
Warning Review limit reached
Next review available in: 35 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughGateway health endpoints are defined, exposed as Envoy direct-response routes, and protected from API and LLM configuration conflicts. Path normalization and validation tests were added, and four gateway policy manifest versions were updated. ChangesGateway health endpoints
Policy manifest versions
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GatewayController
participant Envoy
participant HealthClient
GatewayController->>Envoy: Configure normalized routing and health direct-response routes
HealthClient->>Envoy: Request gateway health path
Envoy-->>HealthClient: Return static JSON health response
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gateway/gateway-controller/pkg/config/validator.go`:
- Around line 44-51: Update validateNotReservedHealthPath to canonicalize
resourcePath, or reject dot-segment paths, before comparing it with
constants.GatewayHealthPathPrefix so paths such as /foo/../_gateway-health/ready
are detected. Ensure every generated Envoy HttpConnectionManager sets
NormalizePath: true, and add regression coverage for both REST and LLM routes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: fa7e727d-1249-40fc-a652-74c1c2815912
📒 Files selected for processing (9)
gateway/build-manifest.yamlgateway/gateway-controller/pkg/config/api_validator.gogateway/gateway-controller/pkg/config/api_validator_test.gogateway/gateway-controller/pkg/config/llm_validator.gogateway/gateway-controller/pkg/config/llm_validator_test.gogateway/gateway-controller/pkg/config/validator.gogateway/gateway-controller/pkg/constants/constants.gogateway/gateway-controller/pkg/xds/translator.gogateway/gateway-controller/pkg/xds/translator_test.go
0e2d5a7 to
05b18ad
Compare
05b18ad to
43c09c9
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gateway/build-manifest.yaml`:
- Line 49: Update every affected policies[].version entry in the manifest,
including the entries near the visible version and the additional referenced
entries, to use major-only versions such as v1 instead of full semver values.
Preserve the existing policy mappings and change only the version format
required by gateway-controller.
In `@gateway/gateway-controller/pkg/config/validator.go`:
- Around line 45-63: Update validateNotReservedHealthPath so the reserved-prefix
comparison is path-boundary safe: reject only canonical paths equal to
constants.GatewayHealthPathPrefix or beginning with that prefix followed by “/”.
Continue allowing similarly named paths such as “/_gateway-healthy” and
“/_gateway-health-metrics”, and add a regression test for one such sibling path.
- Around line 37-44: Update MCP validation to call validateNotReservedHealthPath
for spec.context, matching the existing REST and LLM validation paths. Ensure
contexts under constants.GatewayHealthPathPrefix are rejected before they are
joined with route matchers, while preserving existing MCP validation behavior
for non-reserved contexts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 32b939cd-6ec9-470b-af72-936d5b97552c
📒 Files selected for processing (9)
gateway/build-manifest.yamlgateway/gateway-controller/pkg/config/api_validator.gogateway/gateway-controller/pkg/config/api_validator_test.gogateway/gateway-controller/pkg/config/llm_validator.gogateway/gateway-controller/pkg/config/llm_validator_test.gogateway/gateway-controller/pkg/config/validator.gogateway/gateway-controller/pkg/constants/constants.gogateway/gateway-controller/pkg/xds/translator.gogateway/gateway-controller/pkg/xds/translator_test.go
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gateway/build-manifest.yaml`:
- Line 49: Update every affected policies[].version entry in the manifest,
including the entries near the visible version and the additional referenced
entries, to use major-only versions such as v1 instead of full semver values.
Preserve the existing policy mappings and change only the version format
required by gateway-controller.
In `@gateway/gateway-controller/pkg/config/validator.go`:
- Around line 45-63: Update validateNotReservedHealthPath so the reserved-prefix
comparison is path-boundary safe: reject only canonical paths equal to
constants.GatewayHealthPathPrefix or beginning with that prefix followed by “/”.
Continue allowing similarly named paths such as “/_gateway-healthy” and
“/_gateway-health-metrics”, and add a regression test for one such sibling path.
- Around line 37-44: Update MCP validation to call validateNotReservedHealthPath
for spec.context, matching the existing REST and LLM validation paths. Ensure
contexts under constants.GatewayHealthPathPrefix are rejected before they are
joined with route matchers, while preserving existing MCP validation behavior
for non-reserved contexts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 32b939cd-6ec9-470b-af72-936d5b97552c
📒 Files selected for processing (9)
gateway/build-manifest.yamlgateway/gateway-controller/pkg/config/api_validator.gogateway/gateway-controller/pkg/config/api_validator_test.gogateway/gateway-controller/pkg/config/llm_validator.gogateway/gateway-controller/pkg/config/llm_validator_test.gogateway/gateway-controller/pkg/config/validator.gogateway/gateway-controller/pkg/constants/constants.gogateway/gateway-controller/pkg/xds/translator.gogateway/gateway-controller/pkg/xds/translator_test.go
🛑 Comments failed to post (1)
gateway/build-manifest.yaml (1)
49-49: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Use major-only policy versions in the manifest.
These updated entries still use full semver (
v1.0.3/v1.1.0), but gateway-controller requirespolicies[].versionto be major-only (for example,v1) and rejects full semver during policy resolution.Proposed fix
- version: v1.0.3 + version: v1 ... - version: v1.1.0 + version: v1 ... - version: v1.1.0 + version: v1 ... - version: v1.1.0 + version: v1Also applies to: 55-55, 79-79, 82-82
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@gateway/build-manifest.yaml` at line 49, Update every affected policies[].version entry in the manifest, including the entries near the visible version and the additional referenced entries, to use major-only versions such as v1 instead of full semver values. Preserve the existing policy mappings and change only the version format required by gateway-controller.
43c09c9 to
4fea1ce
Compare
implement gateway health check