Skip to content

[Telemetry] Add support to collect the Deployment File name#5539

Merged
kadupoornima merged 19 commits into
GoogleCloudPlatform:developfrom
kadupoornima:telemetry-13
May 6, 2026
Merged

[Telemetry] Add support to collect the Deployment File name#5539
kadupoornima merged 19 commits into
GoogleCloudPlatform:developfrom
kadupoornima:telemetry-13

Conversation

@kadupoornima

@kadupoornima kadupoornima commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

This pull request enhances the telemetry collection capabilities of the cluster toolkit by collecting the deployment file used during operations. It introduces a mechanism to validate and record the deployment file name against a list of predefined examples fetched from the official repository at the time of the user's version, ensuring that only recognized deployment files are reported.

Changes:

  • Telemetry Enhancement: Added support to collect and report the deployment file name as part of the telemetry metadata.
  • GitHub API Integration: Introduced a helper function to fetch and parse the repository file tree, enabling the identification of standard deployment files.
  • Code Refactoring: Refactored the GitHub API interaction logic into a reusable function to improve maintainability and error handling.

KINDLY NOTE THAT TELEMETRY DATA IS NOT BEING COLLECTED YET.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

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 enhances the telemetry collection capabilities of the cluster toolkit by tracking the deployment file used during operations. It introduces a mechanism to validate and record the deployment file name against a list of predefined examples fetched from the official repository, ensuring that only recognized deployment files are reported.

Highlights

  • Telemetry Enhancement: Added support to collect and report the deployment file name as part of the telemetry metadata.
  • GitHub API Integration: Introduced a helper function to fetch and parse the repository file tree, enabling the identification of standard deployment files.
  • Code Refactoring: Refactored the GitHub API interaction logic into a reusable function to improve maintainability and error handling.
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.

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 refactors the GitHub API tree retrieval into a shared helper and introduces telemetry to track the usage of standard deployment files. A logic error was identified in the file path extraction for predefined examples, which would prevent accurate telemetry matching. Additionally, the telemetry collection logic contains dead code and references an undefined variable that need to be addressed.

Comment thread pkg/config/config.go Outdated
Comment thread pkg/telemetry/collector.go Outdated
@kadupoornima kadupoornima added the release-improvements Added to release notes under the "Improvements" heading. label Apr 22, 2026
@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini summary

@kadupoornima kadupoornima marked this pull request as ready for review April 22, 2026 05:56
@kadupoornima kadupoornima requested a review from a team as a code owner April 22, 2026 05:56
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request enhances the telemetry collection capabilities of the cluster toolkit by tracking the deployment file used during operations. It introduces a mechanism to validate and record the deployment file name against a list of predefined examples fetched from the official repository, ensuring that only recognized deployment files are reported.

Highlights

  • Telemetry Enhancement: Added support to collect and report the deployment file name as part of the telemetry metadata.
  • GitHub API Integration: Introduced a helper function to fetch and parse the repository file tree, enabling the identification of standard deployment files.
  • Code Refactoring: Refactored the GitHub API interaction logic into a reusable function to improve maintainability and error handling.
Activity
  • Gemini Code Assist provided an initial summary and code review feedback.
  • The author requested a summary of the pull request.
  • Gemini Code Assist identified a potential issue with path extraction in the file tree parsing logic.
  • Gemini Code Assist suggested removing unused code and fixing scope issues in a separate review comment.

@kadupoornima kadupoornima enabled auto-merge (squash) April 22, 2026 05:56
@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 introduces the ability to track standard deployment files in telemetry by fetching them from the GitHub repository. It refactors the module-fetching logic into a shared fetchGitFiles helper and adds a new DEPLOYMENT_FILE metric to the telemetry collector. The review feedback highlights critical performance concerns regarding synchronous network calls during package initialization, which could cause hangs in offline environments. Additionally, suggestions were made to implement caching for API responses and to normalize file paths for more reliable validation.

Comment thread pkg/telemetry/collector.go Outdated
Comment thread pkg/config/config.go Outdated
Comment thread pkg/telemetry/collector.go
@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 introduces caching for GitHub API responses when fetching predefined modules and examples, improving performance and reducing redundant network calls. It also adds telemetry to track whether a standard or custom deployment file is being used. A review comment suggests improving the error handling in getDeploymentFile to return "UNVERIFIED" and log a warning if the standard file list cannot be fetched, ensuring consistency with the getModules function.

Comment thread pkg/telemetry/collector.go Outdated
Comment thread pkg/config/config.go Outdated
Comment thread pkg/config/config.go Outdated
@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini summary

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request enhances the telemetry collection capabilities of the cluster toolkit by tracking the deployment file used during operations. It introduces a mechanism to validate and record the deployment file name against a list of predefined examples fetched from the official repository, ensuring that only recognized deployment files are reported.

Highlights

  • Telemetry Enhancement: Added support to collect and report the deployment file name as part of the telemetry metadata.
  • GitHub API Integration: Introduced a helper function to fetch and parse the repository file tree, enabling the identification of standard deployment files.
  • Code Refactoring: Refactored the GitHub API interaction logic into a reusable function to improve maintainability and error handling.
Activity
  • Gemini Code Assist provided an initial summary and code review feedback.
  • The author requested a summary of the pull request.
  • Gemini Code Assist identified a potential issue with path extraction in the file tree parsing logic.
  • Gemini Code Assist suggested removing unused code and fixing scope issues in a separate review comment.
  • The author addressed feedback regarding synchronous network calls and caching.
  • The author implemented path normalization for deployment files.
  • The author added 'UNVERIFIED' status handling for failed fetches.
  • The author refactored tree traversal logic and addressed concurrency concerns.

@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 introduces telemetry for tracking the deployment file used in Cluster Toolkit commands, including path normalization and classification of standard versus custom files. It also refactors module metadata retrieval into a generic utility. Key feedback points out that the deployment file should be identified via positional arguments to match CLI behavior and recommends moving network-based initialization to a pre-run hook to avoid redundant operations.

Comment thread pkg/telemetry/collector.go
Comment thread pkg/telemetry/collector_util.go Outdated
kadupoornima and others added 8 commits May 1, 2026 05:17
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini review

@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini summary

@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 replaces the Firestore-based metadata caching with a GitHub-API-driven system featuring local file-based caching. It introduces utilities to fetch standard modules, examples, and blueprint names, and enhances telemetry to track deployment files. Review feedback highlights the need for getDeploymentFile to support positional arguments and cross-platform path normalization for Windows. Additionally, it is recommended to remove unused blueprint fetching logic or relocate its initialization to a persistent pre-run hook to optimize performance.

Comment thread pkg/telemetry/collector.go
Comment thread pkg/telemetry/collector.go
Comment thread pkg/config/config.go
Comment thread pkg/telemetry/collector_test.go
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request enhances the telemetry collection capabilities of the cluster toolkit by tracking the deployment file used during operations. It introduces a mechanism to validate and record the deployment file name against a list of predefined examples fetched from the official repository, ensuring that only recognized deployment files are reported.

Highlights

  • Telemetry Enhancement: Added support to collect and report the deployment file name as part of the telemetry metadata.
  • GitHub API Integration: Introduced a helper function to fetch and parse the repository file tree, enabling the identification of standard deployment files.
  • Code Refactoring: Refactored the GitHub API interaction logic into a reusable function to improve maintainability and error handling.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/cache-metadata.yml
Activity
  • Gemini Code Assist provided an initial summary and code review feedback.
  • The author requested a summary of the pull request.
  • Gemini Code Assist identified a potential issue with path extraction in the file tree parsing logic.
  • Gemini Code Assist suggested removing unused code and fixing scope issues in a separate review comment.
  • The author addressed feedback regarding synchronous network calls and caching.
  • The author implemented path normalization for deployment files.
  • The author added 'UNVERIFIED' status handling for failed fetches.
  • The author refactored tree traversal logic and addressed concurrency concerns.

@kadupoornima kadupoornima disabled auto-merge May 4, 2026 08:52
@kadupoornima kadupoornima enabled auto-merge (squash) May 5, 2026 10:56
agrawalkhushi18
agrawalkhushi18 previously approved these changes May 5, 2026
@agrawalkhushi18 agrawalkhushi18 self-requested a review May 5, 2026 11:29
Comment thread pkg/telemetry/collector_test.go

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

LGTM!

@kadupoornima kadupoornima merged commit c971d29 into GoogleCloudPlatform:develop May 6, 2026
14 of 80 checks passed
@kadupoornima kadupoornima deleted the telemetry-13 branch May 6, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-improvements Added to release notes under the "Improvements" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants