Skip to content

Merge the rename PR to epic/issue-285-api-client-v2 - #291

Closed
kyasbal wants to merge 1 commit into
epic/issue-285-api-client-v2from
main
Closed

Merge the rename PR to epic/issue-285-api-client-v2#291
kyasbal wants to merge 1 commit into
epic/issue-285-api-client-v2from
main

Conversation

@kyasbal

@kyasbal kyasbal commented Oct 6, 2025

Copy link
Copy Markdown
Member

This is already reviewed on main branch. Review is not required.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @kyasbal, 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 primarily focuses on a refactoring effort to improve code clarity by renaming a core caching data structure. The change involves updating the type name PreviousTaskResult to CachableTaskResult and propagating this change throughout the codebase where this type is used, including task definitions and test files. This ensures consistency and better describes the intent of the cached task results.

Highlights

  • Type Renaming: The PreviousTaskResult struct in pkg/core/inspection/taskbase/cached_task.go has been renamed to CachableTaskResult to better reflect its purpose.
  • Widespread Reference Update: All instances and usages of the PreviousTaskResult type across various task implementation files have been updated to CachableTaskResult.
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.

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

Copy link
Copy Markdown
Contributor

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 primarily renames PreviousTaskResult to CachableTaskResult. I've identified a typo in the new name (Cachable should be Cacheable) and suggested a fix at the type definition. This correction should be applied to all usages of the type for consistency. Additionally, I've found and suggested fixes for two instances where errors from the GCP client factory were being ignored, which could lead to silent failures.

client, err := googlecloudapi.DefaultGCPClientFactory.NewClient()
if err != nil {
return inspectiontaskbase.PreviousTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{}, nil
return inspectiontaskbase.CachableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{}, nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The error from googlecloudapi.DefaultGCPClientFactory.NewClient() is not being propagated. It should be returned instead of nil to ensure proper error handling.

Suggested change
return inspectiontaskbase.CachableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{}, nil
return inspectiontaskbase.CachableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{}, err

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is intended.

client, err := googlecloudapi.DefaultGCPClientFactory.NewClient()
if err != nil {
return inspectiontaskbase.PreviousTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{}, nil
return inspectiontaskbase.CachableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{}, nil

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The error from googlecloudapi.DefaultGCPClientFactory.NewClient() is not being propagated. It should be returned instead of nil to ensure proper error handling.

Suggested change
return inspectiontaskbase.CachableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{}, nil
return inspectiontaskbase.CachableTaskResult[*googlecloudk8scommon_contract.AutocompleteClusterNameList]{}, err

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is also intended.

Comment on lines +28 to +29
// CachableTaskResult is the combination of the cached value and a digest of its dependency.
type CachableTaskResult[T any] struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

There's a typo in the struct name and its comment. Cachable should be Cacheable. This name is used across multiple files in this PR, so the fix should be applied to all its usages.

Suggested change
// CachableTaskResult is the combination of the cached value and a digest of its dependency.
type CachableTaskResult[T any] struct {
// CacheableTaskResult is the combination of the cached value and a digest of its dependency.
type CacheableTaskResult[T any] struct {

@kyasbal kyasbal closed this Oct 6, 2025
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