feat/schema-summary#4210
Conversation
Signed-off-by: praagyajain <praagyajain2002@gmail.com>
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA 2 out of 3 committers have signed the CLA. |
|
The CLA check failed. Please ensure you have:
After fixing these issues, comment 'recheck' to trigger the workflow again. |
There was a problem hiding this comment.
Pull request overview
Adds a new keploy schema-summary CLI command that calls the Keploy api-server to fetch OpenAPI schema coverage for a Kubernetes deployment and renders the results in a terminal-friendly table.
Changes:
- Registers a new
schema-summarycommand and wires up flags/env-var inputs (namespace, deployment, cluster, release, api-server URL, token). - Introduces a
schemasummaryservice to call/k8s-proxy/get/schema-summary, decode the response envelope, and print results. - Implements report types and a renderer that formats coverage + per-endpoint/per-schema status output.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/service/schemasummary/types.go | Adds Go types for the schema-summary API response (report, status, envelope). |
| pkg/service/schemasummary/service.go | Implements the client/service logic to fetch and decode schema-summary data and print it. |
| pkg/service/schemasummary/render.go | Adds a pure renderer that formats the report into a table-like CLI output. |
| cli/schema_summary.go | Adds the Cobra command, reads flags/env, and invokes the schemasummary service. |
| cli/provider/cmd.go | Registers schema-summary-specific flags in the shared flag configurator. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| body, err := io.ReadAll(resp.Body) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("read response body: %w", err) | ||
| } |
| for _, e := range r.Endpoints { | ||
| fmt.Fprintf(&b, "%s %-6s %s\n", icon[e.Status], strings.ToUpper(e.Method), e.Path) | ||
| } |
| // Render formats a Report as the box-drawn ASCII table the CLI prints. | ||
| // Pure function — no I/O, no globals — so it's trivially unit-testable. | ||
| func Render(r Report) string { | ||
| const sep = "────────────────────────────────" |
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
|
The CLA check failed. Please ensure you have:
After fixing these issues, comment 'recheck' to trigger the workflow again. |
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
|
The CLA check failed. Please ensure you have:
After fixing these issues, comment 'recheck' to trigger the workflow again. |
🚀 Keploy Performance Test ResultsMulti-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.
Thresholds: P50 < 5ms, P90 < 15ms, P99 < 70ms, RPS >= 100 (±1% tolerance), Error Rate < 1% ✅ Result: PASSED - Only 0 out of 3 runs failed (threshold: 2) P50, P90, and P99 percentiles naturally filter out outliers |
This pull request introduces a new CLI command,
schema-summary, which allows users to fetch and display OpenAPI schema coverage for a Kubernetes deployment directly from the CLI. The implementation includes the command registration, flag handling, service logic for contacting the API server, and rendering the results as a formatted table in the terminal.The most important changes are:
New CLI Command and Flag Integration
schema-summarycommand to the CLI, including registration and flag handling for required parameters such asnamespace,deployment,cluster, and authentication options. (cli/schema_summary.go,cli/provider/cmd.go) [1] [2]Schema Summary Service Implementation
schemaSummarySvcservice that handles API calls to/k8s-proxy/get/schema-summary, processes the response, and outputs the formatted schema coverage report. (pkg/service/schemasummary/service.go)Data Structures for API Response
Report,EndpointSummary,ComponentSchemaSummary, and supporting types for status and error handling. (pkg/service/schemasummary/types.go)Terminal Table Rendering
pkg/service/schemasummary/render.go)## Describe the changes that are madeLinks & References
Closes: #[issue number that will be closed through this PR]
🔗 Related PRs
🐞 Related Issues
📄 Related Documents
What type of PR is this? (check all applicable)
Added e2e test pipeline?
Added comments for hard-to-understand areas?
Added to documentation?
Are there any sample code or steps to test the changes?
Self Review done?
Any relevant screenshots, recordings or logs?
🧠 Semantics for PR Title & Branch Name
Please ensure your PR title and branch name follow the Keploy semantics:
📌 PR Semantics Guide
📌 Branch Semantics Guide
Examples:
fix: patch MongoDB document update bugfeat/#1-login-flow(You may skip mentioning the issue number in the branch name if the change is small and the PR description clearly explains it.)Additional checklist: