Skip to content

updated python client with kubernetes tickets model#84

Merged
pranjal-astuto merged 1 commit into
mainfrom
pu/update-python-client-2026-03-16
Mar 17, 2026
Merged

updated python client with kubernetes tickets model#84
pranjal-astuto merged 1 commit into
mainfrom
pu/update-python-client-2026-03-16

Conversation

@pranjal-astuto
Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Python client by introducing a dedicated module for managing Kubernetes tickets. It provides a robust set of data models and RPC endpoints to facilitate the creation, retrieval, bulk operations, and synchronization of Kubernetes-related tickets, thereby expanding the client's capabilities for interacting with Kubernetes insights and recommendations.

Highlights

  • New Kubernetes Ticket Models: Introduced various Pydantic models for Kubernetes ticket management, including detailed structures for creation, retrieval, bulk operations, and synchronization.
  • Kubernetes Ticket Status and Priority Enums: Added KubernetesTicketStatus and OnelensModelsCommonsPriority enums to standardize ticket states and priority levels within the system.
  • New RPC Handler for Kubernetes Tickets: A new RPC handler, KubernetesTicketsServiceRpcHandler, was added to expose methods for interacting with Kubernetes tickets, covering creation, retrieval, updates, and synchronization functionalities.
  • RPC Handler Integration: The newly created KubernetesTicketsServiceRpcHandler was integrated into the client's RPC initialization, making its functionalities accessible throughout the client library.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • onelens_backend_client_v2/models.py
    • Added BulkCreateKubernetesTicketsRequest and BulkCreateKubernetesTicketsResponse models.
    • Added BulkUpdateKubernetesTicketsRequest and BulkUpdateKubernetesTicketsResponse models.
    • Added CreateKubernetesTicketAPIRequest, CreateKubernetesTicketRequest, and CreateKubernetesTicketResponse models.
    • Added GetKubernetesTicketByInsightIdRequest, GetKubernetesTicketByInsightIdResponse, GetKubernetesTicketMetadataRequest, GetKubernetesTicketMetadataResponse, GetKubernetesTicketRequest, and GetKubernetesTicketResponse models.
    • Added KubernetesTicketStatus enum and KubernetesTicketsMixin model.
    • Added OnelensModelsCommonsPriority enum.
    • Added SyncKubernetesTicketDataRequest and SyncKubernetesTicketDataResponse models.
    • Added UpdateKubernetesTicketRequest and UpdateKubernetesTicketResponse models.
    • Added UpsertKubernetesTicketsRequest and UpsertKubernetesTicketsResponse models.
  • onelens_backend_client_v2/rpc/init.py
    • Imported KubernetesTicketsServiceRpcHandler.
    • Added KubernetesTicketsServiceRpcHandler to the __all__ list.
  • onelens_backend_client_v2/rpc/kubernetes_tickets_service_rpc_handler.py
    • Added a new RPC handler for Kubernetes ticket operations.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Python client by adding new Pydantic models and an RPC handler for Kubernetes tickets. The changes are mostly additive and look good. I've provided a couple of suggestions to reduce code duplication in the new models by using inheritance, which will improve long-term maintainability.

Comment on lines +821 to +848
class CreateKubernetesTicketRequest(BaseModel):
insight_id: UUID = Field(..., title="Insight Id")
insight_alias: int = Field(..., title="Insight Alias")
cluster_id: UUID = Field(..., title="Cluster Id")
cluster_name: str = Field(..., title="Cluster Name")
account_id: str = Field(..., title="Account Id")
region: str = Field(..., title="Region")
namespace: Optional[str] = Field(None, title="Namespace")
title: str = Field(..., title="Title")
description: str = Field(..., title="Description")
target_id: str = Field(..., title="Target Id")
target_type: str = Field(..., title="Target Type")
recommendation_type: str = Field(..., title="Recommendation Type")
recommendation_details: Optional[Dict[str, Any]] = Field(
None, title="Recommendation Details"
)
potential_savings: Optional[float] = Field(None, title="Potential Savings")
non_prorated_potential_savings: Optional[float] = Field(
None, title="Non Prorated Potential Savings"
)
status: str = Field(..., title="Status")
unique_target_id: Optional[str] = Field(None, title="Unique Target Id")
parent_insight_id: Optional[UUID] = Field(None, title="Parent Insight Id")
ticket_status: Optional[KubernetesTicketStatus] = "TO_DO"
priority: Optional[OnelensModelsCommonsPriority] = None
provider: Provider
tenant_id: UUID = Field(..., title="Tenant Id")
created_by: Optional[UUID] = Field(None, title="Created By")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The CreateKubernetesTicketRequest model duplicates all fields from CreateKubernetesTicketAPIRequest and adds two more. To reduce code duplication and improve maintainability, you can make CreateKubernetesTicketRequest inherit from CreateKubernetesTicketAPIRequest.

Suggested change
class CreateKubernetesTicketRequest(BaseModel):
insight_id: UUID = Field(..., title="Insight Id")
insight_alias: int = Field(..., title="Insight Alias")
cluster_id: UUID = Field(..., title="Cluster Id")
cluster_name: str = Field(..., title="Cluster Name")
account_id: str = Field(..., title="Account Id")
region: str = Field(..., title="Region")
namespace: Optional[str] = Field(None, title="Namespace")
title: str = Field(..., title="Title")
description: str = Field(..., title="Description")
target_id: str = Field(..., title="Target Id")
target_type: str = Field(..., title="Target Type")
recommendation_type: str = Field(..., title="Recommendation Type")
recommendation_details: Optional[Dict[str, Any]] = Field(
None, title="Recommendation Details"
)
potential_savings: Optional[float] = Field(None, title="Potential Savings")
non_prorated_potential_savings: Optional[float] = Field(
None, title="Non Prorated Potential Savings"
)
status: str = Field(..., title="Status")
unique_target_id: Optional[str] = Field(None, title="Unique Target Id")
parent_insight_id: Optional[UUID] = Field(None, title="Parent Insight Id")
ticket_status: Optional[KubernetesTicketStatus] = "TO_DO"
priority: Optional[OnelensModelsCommonsPriority] = None
provider: Provider
tenant_id: UUID = Field(..., title="Tenant Id")
created_by: Optional[UUID] = Field(None, title="Created By")
class CreateKubernetesTicketRequest(CreateKubernetesTicketAPIRequest):
tenant_id: UUID = Field(..., title="Tenant Id")
created_by: Optional[UUID] = Field(None, title="Created By")

Comment on lines +2360 to +2362
class GetKubernetesTicketRequest(BaseModel):
tenant_id: UUID = Field(..., title="Tenant Id")
ticket_id: UUID = Field(..., title="Ticket Id")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The GetKubernetesTicketRequest model is identical to GetKubernetesTicketMetadataRequest. To avoid this code duplication, you can have one model inherit from the other.

Suggested change
class GetKubernetesTicketRequest(BaseModel):
tenant_id: UUID = Field(..., title="Tenant Id")
ticket_id: UUID = Field(..., title="Ticket Id")
class GetKubernetesTicketRequest(GetKubernetesTicketMetadataRequest):
pass

@pranjal-astuto pranjal-astuto merged commit 06a8971 into main Mar 17, 2026
0 of 10 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.

1 participant