Skip to content

feat: enhance onelens backend client with new RPC handlers and models…#82

Closed
ramanjangu1 wants to merge 0 commit into
mainfrom
python-client-update
Closed

feat: enhance onelens backend client with new RPC handlers and models…#82
ramanjangu1 wants to merge 0 commit into
mainfrom
python-client-update

Conversation

@ramanjangu1
Copy link
Copy Markdown
Contributor

… for aggregated interactions, savings dashboard, and violations

@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 Onelens backend client by integrating a suite of new RPC handlers and models. These additions provide robust support for managing aggregated interactions, visualizing savings data through a dedicated dashboard, handling violations, and offering more granular control over custom policies and tickets. The changes streamline various backend operations and expand the client's ability to interact with core platform services.

Highlights

  • New RPC Handlers Added: Introduced new RPC handlers for Aggregated Savings Dashboard, Aggregated Violations, Aggregated Interactions, Custom Tickets, Custom Policies, and Custom Ticket History, significantly expanding the client's capabilities.
  • Enhanced Existing RPC Handlers: Updated existing RPC handlers for Aggregated Policies, Aggregated Tickets, CUR Data Service, Hierarchy Node Service, Tenant Onboarding, and Tenant Ticket Service with new functionalities and models.
  • Improved Hierarchy Node DTOs: Refactored hierarchy node DTO imports and usage to use fully qualified names, enhancing clarity and preventing potential naming conflicts.
  • Comprehensive Ticket Update Functionality: Added a comprehensive update method for tenant tickets, allowing for simplified updates of status, assignment, and priority with built-in validation and automatic system field updates.

🧠 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/rpc/init.py
    • Imported and exposed new RPC handlers for aggregated savings dashboard, aggregated violations, aggregated interactions, custom tickets, custom policies, custom ticket history, and hierarchy node service V2.
  • onelens_backend_client_v2/rpc/aggregated_interactions_service_rpc_handler.py
    • Added a new RPC handler for managing policy status and updating aggregated tickets.
  • onelens_backend_client_v2/rpc/aggregated_policies_service_rpc_handler.py
    • Added new models and an RPC method to retrieve aggregated policy filters.
  • onelens_backend_client_v2/rpc/aggregated_savings_dashboard_service_rpc_handler.py
    • Added a new RPC handler for retrieving aggregated achieved savings status, timeseries data, cost timeseries, and saving dashboard statistics.
  • onelens_backend_client_v2/rpc/aggregated_tickets_service_rpc_handler.py
    • Added new models and RPC methods for getting aggregated ticket filters, exporting tickets, getting tickets for export, retrieving ticket users, and upserting aggregated ticket dimensions.
  • onelens_backend_client_v2/rpc/aggregated_violations_service_rpc_handler.py
    • Added a new RPC handler for retrieving aggregated violations and their statistics.
  • onelens_backend_client_v2/rpc/cur_data_service_rpc_handler.py
    • Added new models and an RPC method to get resource details.
  • onelens_backend_client_v2/rpc/custom_policy_service_rpc_handler.py
    • Added a new RPC handler for creating and fetching custom policies.
  • onelens_backend_client_v2/rpc/custom_ticket_history_service_rpc_handler.py
    • Added a new RPC handler for adding custom ticket history entries, update history entries, and retrieving custom ticket history.
  • onelens_backend_client_v2/rpc/custom_tickets_service_rpc_handler.py
    • Added a new RPC handler for creating, getting details, syncing data, updating, and upserting multi-cloud custom tickets.
  • onelens_backend_client_v2/rpc/hierarchy_node_service_rpc_handler.py
    • Updated imports and method signatures to use fully qualified names for hierarchy node DTOs, ensuring consistency and avoiding naming conflicts.
  • onelens_backend_client_v2/rpc/tenant_onboarding_service_rpc_handler.py
    • Added new models and an RPC method for onboarding GitHub tenants.
  • onelens_backend_client_v2/rpc/tenant_ticket_service_rpc_handler.py
    • Added new models and RPC methods for comprehensive ticket updates and syncing custom ticket data. Updated import for GetCustomTicketDetailsRequest.
Activity
  • ramanjangu1 created this pull request to enhance the backend client with new RPC handlers and models.
  • The pull request introduces new service handlers for aggregated savings, violations, and interactions, along with custom policy and ticket management.
  • Existing service handlers have been updated to support new data retrieval and manipulation functionalities, such as policy filters, ticket exports, and resource details.
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 enhances the onelens backend client by adding several new RPC handlers and models for features like aggregated interactions, savings dashboards, and violations. The changes are mostly auto-generated boilerplate. My review focuses on improving code maintainability by organizing imports and suggesting the use of aliases for excessively long, auto-generated model names to improve readability.

Note: Security Review did not run due to the size of the PR.

Comment on lines +215 to +241
from onelens_backend_client_v2.rpc.aggregated_savings_dashboard_service_rpc_handler import (
AggregatedSavingsDashboardServiceRpcHandler,
)

from onelens_backend_client_v2.rpc.aggregated_violations_service_rpc_handler import (
AggregatedViolationsServiceRpcHandler,
)

from onelens_backend_client_v2.rpc.aggregated_interactions_service_rpc_handler import (
AggregatedInteractionsServiceRpcHandler,
)

from onelens_backend_client_v2.rpc.custom_tickets_service_rpc_handler import (
CustomTicketsServiceRpcHandler,
)

from onelens_backend_client_v2.rpc.custom_policy_service_rpc_handler import (
CustomPolicyServiceRpcHandler,
)

from onelens_backend_client_v2.rpc.custom_ticket_history_service_rpc_handler import (
CustomTicketHistoryServiceRpcHandler,
)

from onelens_backend_client_v2.rpc.hierarchy_node_service_v2_rpc_handler import (
HierarchyNodeServiceV2RpcHandler,
)
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

For better maintainability and adherence to PEP 8, it's recommended to group related imports and sort them alphabetically. The new imports can be combined and ordered.

from onelens_backend_client_v2.rpc.aggregated_interactions_service_rpc_handler import (
    AggregatedInteractionsServiceRpcHandler,
)
from onelens_backend_client_v2.rpc.aggregated_savings_dashboard_service_rpc_handler import (
    AggregatedSavingsDashboardServiceRpcHandler,
)
from onelens_backend_client_v2.rpc.aggregated_violations_service_rpc_handler import (
    AggregatedViolationsServiceRpcHandler,
)
from onelens_backend_client_v2.rpc.custom_policy_service_rpc_handler import (
    CustomPolicyServiceRpcHandler,
)
from onelens_backend_client_v2.rpc.custom_ticket_history_service_rpc_handler import (
    CustomTicketHistoryServiceRpcHandler,
)
from onelens_backend_client_v2.rpc.custom_tickets_service_rpc_handler import (
    CustomTicketsServiceRpcHandler,
)
from onelens_backend_client_v2.rpc.hierarchy_node_service_v2_rpc_handler import (
    HierarchyNodeServiceV2RpcHandler,
)

Comment on lines +303 to +309
"AggregatedSavingsDashboardServiceRpcHandler",
"AggregatedViolationsServiceRpcHandler",
"AggregatedInteractionsServiceRpcHandler",
"CustomTicketsServiceRpcHandler",
"CustomPolicyServiceRpcHandler",
"CustomTicketHistoryServiceRpcHandler",
"HierarchyNodeServiceV2RpcHandler",
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

To improve code readability and maintainability, the __all__ list should be sorted alphabetically. Please sort the newly added entries.

    "AggregatedInteractionsServiceRpcHandler",
    "AggregatedSavingsDashboardServiceRpcHandler",
    "AggregatedViolationsServiceRpcHandler",
    "CustomPolicyServiceRpcHandler",
    "CustomTicketHistoryServiceRpcHandler",
    "CustomTicketsServiceRpcHandler",
    "HierarchyNodeServiceV2RpcHandler",

Comment on lines 17 to 28
from onelens_backend_client_v2.models import GetAggregatedPolicyStatsResponse


from onelens_backend_client_v2.models import GetAggregatedPolicyFiltersRequest


from onelens_backend_client_v2.models import GetAggregatedPolicyFiltersResponse


from onelens_backend_client_v2.models import UpsertAggregatedPoliciesRequest


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

To improve readability and follow Python best practices, it's better to group imports from the same module. Please group these imports into a single block and sort them alphabetically.

Suggested change
from onelens_backend_client_v2.models import GetAggregatedPolicyStatsResponse
from onelens_backend_client_v2.models import GetAggregatedPolicyFiltersRequest
from onelens_backend_client_v2.models import GetAggregatedPolicyFiltersResponse
from onelens_backend_client_v2.models import UpsertAggregatedPoliciesRequest
from onelens_backend_client_v2.models import (
GetAggregatedPolicyFiltersRequest,
GetAggregatedPolicyFiltersResponse,
GetAggregatedPolicyStatsResponse,
UpsertAggregatedPoliciesRequest,
)

Comment on lines 11 to 22
from onelens_backend_client_v2.models import DeleteAggregatedTicketsResponse


from onelens_backend_client_v2.models import GetAggregatedTicketFiltersRequest


from onelens_backend_client_v2.models import GetAggregatedTicketFiltersResponse


from onelens_backend_client_v2.models import GetAggregatedTicketsStatsRequest


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

For better readability and adherence to PEP 8, please group imports from the same module and sort them alphabetically.

Suggested change
from onelens_backend_client_v2.models import DeleteAggregatedTicketsResponse
from onelens_backend_client_v2.models import GetAggregatedTicketFiltersRequest
from onelens_backend_client_v2.models import GetAggregatedTicketFiltersResponse
from onelens_backend_client_v2.models import GetAggregatedTicketsStatsRequest
from onelens_backend_client_v2.models import (
DeleteAggregatedTicketsRequest,
DeleteAggregatedTicketsResponse,
GetAggregatedTicketFiltersRequest,
GetAggregatedTicketFiltersResponse,
GetAggregatedTicketsStatsRequest,
GetAggregatedTicketsStatsResponse,
)

Comment on lines 29 to 58
from onelens_backend_client_v2.models import GetAggregatedTicketsAPIResponse


from onelens_backend_client_v2.models import GetAggregatedTicketsExportRequest


from onelens_backend_client_v2.models import GetAggregatedTicketsExportResponse


from onelens_backend_client_v2.models import GetAggregatedTicketsForExportRequest


from onelens_backend_client_v2.models import GetAggregatedTicketsForExportResponse


from onelens_backend_client_v2.models import GetTicketUsersRequest


from onelens_backend_client_v2.models import GetTicketUsersResponse


from onelens_backend_client_v2.models import UpsertAggregatedTicketDimensionsRequest


from onelens_backend_client_v2.models import UpsertAggregatedTicketDimensionsResponse


from onelens_backend_client_v2.models import UpsertAggregatedTicketsRequest


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

These imports can be grouped into a single block and sorted alphabetically to improve code clarity and maintainability.

Suggested change
from onelens_backend_client_v2.models import GetAggregatedTicketsAPIResponse
from onelens_backend_client_v2.models import GetAggregatedTicketsExportRequest
from onelens_backend_client_v2.models import GetAggregatedTicketsExportResponse
from onelens_backend_client_v2.models import GetAggregatedTicketsForExportRequest
from onelens_backend_client_v2.models import GetAggregatedTicketsForExportResponse
from onelens_backend_client_v2.models import GetTicketUsersRequest
from onelens_backend_client_v2.models import GetTicketUsersResponse
from onelens_backend_client_v2.models import UpsertAggregatedTicketDimensionsRequest
from onelens_backend_client_v2.models import UpsertAggregatedTicketDimensionsResponse
from onelens_backend_client_v2.models import UpsertAggregatedTicketsRequest
from onelens_backend_client_v2.models import (
GetAggregatedTicketsAPIResponse,
GetAggregatedTicketsExportRequest,
GetAggregatedTicketsExportResponse,
GetAggregatedTicketsForExportRequest,
GetAggregatedTicketsForExportResponse,
GetTicketUsersRequest,
GetTicketUsersResponse,
UpsertAggregatedTicketDimensionsRequest,
UpsertAggregatedTicketDimensionsResponse,
UpsertAggregatedTicketsRequest,
UpsertAggregatedTicketsResponse,
)

Comment on lines 29 to 40
from onelens_backend_client_v2.models import GetCURDataQueryResponse


from onelens_backend_client_v2.models import GetResourceDetailsRequest


from onelens_backend_client_v2.models import GetResourceDetailsResponse


from onelens_backend_client_v2.models import GetResourceDetailsFromARNForCURRequest


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

To improve readability and maintainability, please group these imports from the same module into a single block and sort them alphabetically.

Suggested change
from onelens_backend_client_v2.models import GetCURDataQueryResponse
from onelens_backend_client_v2.models import GetResourceDetailsRequest
from onelens_backend_client_v2.models import GetResourceDetailsResponse
from onelens_backend_client_v2.models import GetResourceDetailsFromARNForCURRequest
from onelens_backend_client_v2.models import (
GetCURDataQueryResponse,
GetResourceDetailsFromARNForCURRequest,
GetResourceDetailsFromARNForCURResponse,
GetResourceDetailsRequest,
GetResourceDetailsResponse,
)

Comment on lines +14 to +21
from onelens_backend_client_v2.models import (
onelens__models__service_interfaces__tenant_metadata__hierarchy_node_dto__CreateHierarchyNodeRequest,
)


from onelens_backend_client_v2.models import CreateHierarchyNodeResponse
from onelens_backend_client_v2.models import (
onelens__models__service_interfaces__tenant_metadata__hierarchy_node_dto__CreateHierarchyNodeResponse,
)
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 new model names are very long and harm readability. Consider using aliases for these long model names to improve code clarity. For example:

from onelens_backend_client_v2.models import (
    onelens__models__service_interfaces__tenant_metadata__hierarchy_node_dto__CreateHierarchyNodeRequest as CreateHierarchyNodeRequest,
)

This would allow you to use the shorter CreateHierarchyNodeRequest in method signatures, making the code much easier to read and maintain. This pattern should be applied consistently for all long model names in this file.

Comment on lines 17 to 28
from onelens_backend_client_v2.models import OnboardGCPTenantResponse


from onelens_backend_client_v2.models import OnboardGitHubTenantRequest


from onelens_backend_client_v2.models import OnboardGitHubTenantResponse


from onelens_backend_client_v2.models import OnboardOCITenantRequest


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

To improve readability and follow Python best practices, it's better to group imports from the same module. Please group these imports into a single block and sort them alphabetically.

Suggested change
from onelens_backend_client_v2.models import OnboardGCPTenantResponse
from onelens_backend_client_v2.models import OnboardGitHubTenantRequest
from onelens_backend_client_v2.models import OnboardGitHubTenantResponse
from onelens_backend_client_v2.models import OnboardOCITenantRequest
from onelens_backend_client_v2.models import (
OnboardGCPTenantResponse,
OnboardGitHubTenantRequest,
OnboardGitHubTenantResponse,
OnboardOCITenantRequest,
)

Comment on lines 11 to 22
from onelens_backend_client_v2.models import BulkUpdateTenantTicketsResponse


from onelens_backend_client_v2.models import ComprehensiveUpdateTenantTicketRequest


from onelens_backend_client_v2.models import ComprehensiveUpdateTenantTicketResponse


from onelens_backend_client_v2.models import CreateCustomTenantTicketsRequest


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

For better readability and adherence to PEP 8, please group imports from the same module and sort them alphabetically.

Suggested change
from onelens_backend_client_v2.models import BulkUpdateTenantTicketsResponse
from onelens_backend_client_v2.models import ComprehensiveUpdateTenantTicketRequest
from onelens_backend_client_v2.models import ComprehensiveUpdateTenantTicketResponse
from onelens_backend_client_v2.models import CreateCustomTenantTicketsRequest
from onelens_backend_client_v2.models import (
BulkUpdateTenantTicketsRequest,
BulkUpdateTenantTicketsResponse,
ComprehensiveUpdateTenantTicketRequest,
ComprehensiveUpdateTenantTicketResponse,
CreateCustomTenantTicketsRequest,
)

Comment on lines +44 to +46
from onelens_backend_client_v2.models import (
onelens__models__service_interfaces__tickets__tenant_ticket_service_dto__GetCustomTicketDetailsRequest,
)
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

This model name is excessively long and harms readability. Please use an alias to shorten it. This will make the code in this file much easier to read and maintain. After aliasing, you can use the shorter name in method signatures.

For example:

from onelens_backend_client_v2.models import (
    onelens__models__service_interfaces__tickets__tenant_ticket_service_dto__GetCustomTicketDetailsRequest as GetCustomTicketDetailsRequest,
)

@ramanjangu1 ramanjangu1 force-pushed the python-client-update branch from 1a6ac73 to 68e8b3e Compare March 3, 2026 17:55
@ramanjangu1 ramanjangu1 closed this Mar 3, 2026
@ramanjangu1 ramanjangu1 force-pushed the python-client-update branch from 68e8b3e to 384d638 Compare March 3, 2026 17:56
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