feat: add MCPServer resource - #2796
Conversation
Signed-off-by: Jon Burdo <jon@jonburdo.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughAdds the ChangesMCPServer resource
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized resource addition has no actionable merge-blocking risk identified at the current head and is merge-ready after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 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 |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
PR Summary by QodoAdd MCPServer custom resource wrapper to ocp_resources
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Missing generated start marker
|
| api_group: str = NamespacedResource.ApiGroup.MCP_X_K8S_IO | ||
|
|
||
| def __init__( |
There was a problem hiding this comment.
2. Missing generated start marker 📘 Rule violation ⚙ Maintainability
The generated MCPServer class includes # End of generated code but lacks a corresponding start boundary marker to clearly delimit the generated region. Without explicit boundaries, manual edits can be mixed into generated code unintentionally.
Agent Prompt
## Issue description
The generated region is not protected by explicit boundary markers; only `# End of generated code` is present.
## Issue Context
Compliance requires both a start marker and an end marker to clearly wrap generated code regions.
## Fix Focus Areas
- ocp_resources/mcp_server.py[39-41]
- ocp_resources/mcp_server.py[117-117]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if not self.kind_dict and not self.yaml_file: | ||
| if self.config is None: | ||
| raise MissingRequiredArgumentError(argument="self.config") | ||
|
|
||
| if self.source is None: | ||
| raise MissingRequiredArgumentError(argument="self.source") |
There was a problem hiding this comment.
3. to_dict() performs validation 📘 Rule violation ≡ Correctness
MCPServer.to_dict() raises MissingRequiredArgumentError when config or source is unset, which is validation logic inside a serializer. This violates the requirement that to_dict() only serialize fields without enforcing resource validity.
Agent Prompt
## Issue description
`MCPServer.to_dict()` raises exceptions to enforce required fields (`config`, `source`), which is resource validation inside the serialization method.
## Issue Context
Compliance requires `to_dict()` to only serialize/normalize fields and not reject or validate resource shapes.
## Fix Focus Areas
- ocp_resources/mcp_server.py[88-97]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Short description:
Add MCPServer resource to
ocp_resourcesfor shared use and integration tests in opendatahub-tests.More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
opendatahub-io/opendatahub-tests#2240
Special notes for reviewer:
Bug:
Summary by CodeRabbit