Skip to content

LCORE-1561: fix InvalidClusterVersionError message in OpenAPI documentation#1390

Merged
tisnik merged 1 commit intolightspeed-core:mainfrom
anik120:auth-error-bug-fix
Mar 24, 2026
Merged

LCORE-1561: fix InvalidClusterVersionError message in OpenAPI documentation#1390
tisnik merged 1 commit intolightspeed-core:mainfrom
anik120:auth-error-bug-fix

Conversation

@anik120
Copy link
Copy Markdown
Contributor

@anik120 anik120 commented Mar 24, 2026

Description

  • Updated OpenAPI example to match actual InvalidClusterVersionError message raised at runtime
  • Fixed inconsistency between documented and actual error messages for invalid ClusterVersion validation

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

Identify any AI code assistants used in this PR (for transparency and review context)

  • Assisted-by: None

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • Bug Fixes

    • Clarified error message for invalid cluster version scenarios, improving clarity on missing or invalid cluster identifiers.
  • Documentation

    • Updated API specification examples and error documentation to reflect improved messaging.

…tation

- Updated OpenAPI example to match actual `InvalidClusterVersionError` message raised at runtime
- Fixed inconsistency between documented and actual error messages for invalid ClusterVersion validation
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 24, 2026

Walkthrough

Updated OpenAPI documentation operationIds for A2A endpoints and harmonized error message examples for invalid cluster version errors across API documentation, response models, and test assertions.

Changes

Cohort / File(s) Summary
OpenAPI Documentation
docs/openapi.json
Corrected operationIds from handle_a2a_jsonrpc_a2a_post to handle_a2a_jsonrpc_a2a_get for both GET and POST /a2a endpoints; updated error message example for invalid cluster version from "ClusterVersion missing required field: 'clusterID'" to "Missing or invalid 'clusterID' in ClusterVersion".
Error Message Synchronization
src/models/responses.py, tests/unit/authentication/test_k8s.py
Updated OpenAPI example error message and test assertion to match new invalid cluster version error text for consistency across codebase.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly identifies the main change: fixing the InvalidClusterVersionError message in OpenAPI documentation. It is concise, specific, and directly summarizes the primary changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

"summary": "Handle A2A Jsonrpc",
"description": "Handle A2A JSON-RPC requests following the A2A protocol specification.\n\nThis endpoint uses the DefaultRequestHandler from the A2A SDK to handle\nall JSON-RPC requests including message/send, message/stream, etc.\n\nThe A2A SDK application is created per-request to include authentication\ncontext while still leveraging FastAPI's authorization middleware.\n\nAutomatically detects streaming requests (message/stream JSON-RPC method)\nand returns a StreamingResponse to enable real-time chunk delivery.\n\nArgs:\n request: FastAPI request object\n auth: Authentication tuple\n mcp_headers: MCP headers for context propagation\n\nReturns:\n JSON-RPC response or streaming response",
"operationId": "handle_a2a_jsonrpc_a2a_post",
"operationId": "handle_a2a_jsonrpc_a2a_get",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ps: I haven't changed anything related to this in this PR, but the schema generation re-generated this doc and this part got bubbled up too. I guess it was pending.

Copy link
Copy Markdown
Contributor

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/openapi.json (1)

5366-5384: ⚠️ Potential issue | 🟠 Major

Use distinct operationIds for GET and POST /a2a.

Both the GET and POST methods on /a2a have the same operationId (handle_a2a_jsonrpc_a2a_get), which violates OpenAPI uniqueness requirements and will break client generation and operation-based routing.

♻️ Proposed fix
-                "operationId": "handle_a2a_jsonrpc_a2a_get",
+                "operationId": "handle_a2a_jsonrpc_a2a_post",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/openapi.json` around lines 5366 - 5384, The OpenAPI spec defines the
same operationId "handle_a2a_jsonrpc_a2a_get" for both GET and POST on /a2a
which must be unique; update the POST operationId to a distinct identifier (for
example "handle_a2a_jsonrpc_a2a_post") wherever it's declared in the document so
the POST operation uses that new name, ensuring the GET keeps
"handle_a2a_jsonrpc_a2a_get" and that any references/callers that rely on the
POST operationId are updated to the new identifier.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@docs/openapi.json`:
- Around line 5366-5384: The OpenAPI spec defines the same operationId
"handle_a2a_jsonrpc_a2a_get" for both GET and POST on /a2a which must be unique;
update the POST operationId to a distinct identifier (for example
"handle_a2a_jsonrpc_a2a_post") wherever it's declared in the document so the
POST operation uses that new name, ensuring the GET keeps
"handle_a2a_jsonrpc_a2a_get" and that any references/callers that rely on the
POST operationId are updated to the new identifier.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dd220f27-46f4-4ad9-8c2e-338b16fade51

📥 Commits

Reviewing files that changed from the base of the PR and between b250fca and 3902b95.

📒 Files selected for processing (3)
  • docs/openapi.json
  • src/models/responses.py
  • tests/unit/authentication/test_k8s.py

Copy link
Copy Markdown
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

LGTM

@tisnik tisnik merged commit ce4fc2b into lightspeed-core:main Mar 24, 2026
21 of 22 checks passed
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.

2 participants