-
Notifications
You must be signed in to change notification settings - Fork 3
do not generate spec for /livez or /readyz #18
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
Signed-off-by: Jordan Evans <[email protected]>
WalkthroughAdded Meta("swagger:generate", "false") to the readyz and livez methods in api/project/v1/design/project.go to prevent Swagger/OpenAPI generation for these health-check endpoints in the project-service design. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration 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.
Pull Request Overview
This PR excludes the /livez
and /readyz
health check endpoints from the generated OpenAPI specifications. These health monitoring endpoints are typically not part of the public API documentation and don't need to be exposed in the OpenAPI specs.
- Adds metadata to exclude health check endpoints from OpenAPI generation
- Removes existing
/livez
and/readyz
endpoint documentation from all OpenAPI spec files
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
api/project/v1/design/project.go | Adds Meta("swagger:generate", "false") to readyz and livez method definitions |
api/project/v1/gen/http/openapi3.yaml | Removes /livez and /readyz endpoint definitions from OpenAPI 3.0 spec |
api/project/v1/gen/http/openapi.yaml | Removes /livez and /readyz endpoint definitions from Swagger 2.0 spec |
api/project/v1/gen/http/openapi.json | Removes /livez and /readyz endpoint definitions from JSON spec |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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
🧹 Nitpick comments (1)
api/project/v1/design/project.go (1)
336-339
: Apply the same verification for livez (and optionally document intent)Same concern as readyz: ensure the Meta key is recognized so /livez is omitted from the spec. A small comment above the Meta call can clarify intent for maintainers.
Optionally add a comment:
Method("livez", func() { Description("Check if the service is alive.") + // Hide health-check endpoint from generated OpenAPI/Swagger Meta("swagger:generate", "false") Result(Bytes, func() { Example("OK") })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (4)
api/project/v1/gen/http/openapi.json
is excluded by!**/gen/**
api/project/v1/gen/http/openapi.yaml
is excluded by!**/gen/**
api/project/v1/gen/http/openapi3.json
is excluded by!**/gen/**
api/project/v1/gen/http/openapi3.yaml
is excluded by!**/gen/**
📒 Files selected for processing (1)
api/project/v1/design/project.go
(2 hunks)
🔇 Additional comments (1)
api/project/v1/design/project.go (1)
320-323
: Confirm Goa v3.21.1 OpenAPI plugin honors Meta("swagger:generate", "false")We’re using
• goa.design/goa/v3 v3.21.1 (from go.mod)
• Meta("swagger:generate", "false") on both/readyz
(lines 320–323) and/livez
(lines 336–338) inapi/project/v1/design/project.go
No generated OpenAPI artifacts are committed, so please:
- Generate the OpenAPI spec locally (e.g.
goa gen openapi …
)- Verify that neither
/readyz
nor/livez
appear in the output- If they do appear, switch to a supported exclude key (e.g.
swagger:exclude
oropenapi:exclude
) per your plugin versionAlso, add a brief code comment above each health endpoint explaining why it’s excluded to prevent accidental removals in future edits.
No description provided.