Skip to content

feat/schema-summary#4210

Open
praagyajain wants to merge 3 commits into
mainfrom
feat/schema-summary
Open

feat/schema-summary#4210
praagyajain wants to merge 3 commits into
mainfrom
feat/schema-summary

Conversation

@praagyajain
Copy link
Copy Markdown

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

  • Added a new schema-summary command to the CLI, including registration and flag handling for required parameters such as namespace, deployment, cluster, and authentication options. (cli/schema_summary.go, cli/provider/cmd.go) [1] [2]

Schema Summary Service Implementation

  • Implemented the schemaSummarySvc service 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

  • Defined Go types mirroring the API response, including Report, EndpointSummary, ComponentSchemaSummary, and supporting types for status and error handling. (pkg/service/schemasummary/types.go)

Terminal Table Rendering

  • Added a pure function to render the schema coverage report as a box-drawn ASCII table for easy reading in the CLI, including endpoint and schema breakdowns with clear status icons. (pkg/service/schemasummary/render.go)## Describe the changes that are made

Links & References

Closes: #[issue number that will be closed through this PR]

  • NA (if very small change like typo, linting, etc.)

🔗 Related PRs

  • NA

🐞 Related Issues

  • NA

📄 Related Documents

  • NA

What type of PR is this? (check all applicable)

  • 📦 Chore
  • 🍕 Feature
  • 🐞 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🔁 CI
  • ⏩ Revert

Added e2e test pipeline?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added comments for hard-to-understand areas?

  • 👍 yes
  • 🙅 no, because the code is self-explanatory

Added to documentation?

  • 📜 README.md
  • 📓 Wiki
  • 🙅 no documentation needed

Are there any sample code or steps to test the changes?

  • 👍 yes, mentioned below
  • 🙅 no, because it is not needed

Self Review done?

  • ✅ yes
  • ❌ no, because I need help

Any relevant screenshots, recordings or logs?

  • NA

🧠 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:

  • PR Title: fix: patch MongoDB document update bug
  • Branch Name: feat/#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:

Signed-off-by: praagyajain <praagyajain2002@gmail.com>
@praagyajain praagyajain requested a review from gouravkrosx as a code owner May 21, 2026 09:07
Copilot AI review requested due to automatic review settings May 21, 2026 09:07
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


2 out of 3 committers have signed the CLA.
@officialasishkumar
@pathakharshit
@praagyajain
You can retrigger this bot by commenting recheck in this Pull Request

@github-actions
Copy link
Copy Markdown

The CLA check failed. Please ensure you have:

  • Signed the CLA by commenting 'I have read the CLA Document and I hereby sign the CLA.'
  • Used the correct email address in your commits (matches the one you used to sign the CLA).

After fixing these issues, comment 'recheck' to trigger the workflow again.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-summary command and wires up flags/env-var inputs (namespace, deployment, cluster, release, api-server URL, token).
  • Introduces a schemasummary service 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.

Comment on lines +110 to +113
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("read response body: %w", err)
}
Comment on lines +49 to +51
for _, e := range r.Endpoints {
fmt.Fprintf(&b, "%s %-6s %s\n", icon[e.Status], strings.ToUpper(e.Method), e.Path)
}
Comment on lines +9 to +12
// 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 = "────────────────────────────────"
@github-actions
Copy link
Copy Markdown

🚀 Keploy Performance Test Results

Multi-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.

Run P50 P90 P99 RPS Error Rate Status
1 3.18ms 4.07ms 6.26ms 100.02 0.00% ✅ PASS
2 2.68ms 3.55ms 5.19ms 100.00 0.00% ✅ PASS
3 2.8ms 3.79ms 5.68ms 100.02 0.00% ✅ PASS

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

@github-actions
Copy link
Copy Markdown

The CLA check failed. Please ensure you have:

  • Signed the CLA by commenting 'I have read the CLA Document and I hereby sign the CLA.'
  • Used the correct email address in your commits (matches the one you used to sign the CLA).

After fixing these issues, comment 'recheck' to trigger the workflow again.

@github-actions
Copy link
Copy Markdown

🚀 Keploy Performance Test Results

Multi-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.

Run P50 P90 P99 RPS Error Rate Status
1 2.98ms 3.98ms 5.65ms 100.02 0.00% ✅ PASS
2 2.78ms 3.72ms 5.33ms 100.02 0.00% ✅ PASS
3 2.7ms 3.67ms 5.34ms 100.00 0.00% ✅ PASS

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

@github-actions
Copy link
Copy Markdown

The CLA check failed. Please ensure you have:

  • Signed the CLA by commenting 'I have read the CLA Document and I hereby sign the CLA.'
  • Used the correct email address in your commits (matches the one you used to sign the CLA).

After fixing these issues, comment 'recheck' to trigger the workflow again.

@github-actions
Copy link
Copy Markdown

🚀 Keploy Performance Test Results

Multi-Run Validation: Tests run 3 times, pipeline fails only if 2+ runs show regression.

Run P50 P90 P99 RPS Error Rate Status
1 2.63ms 3.29ms 5.16ms 100.02 0.00% ✅ PASS
2 2.55ms 3.16ms 4.26ms 100.02 0.00% ✅ PASS
3 2.6ms 3.35ms 4.78ms 100.00 0.00% ✅ PASS

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants