Skip to content

[Telemetry] Set up a Github workflow to cache release metadata #5553

Merged
kadupoornima merged 7 commits into
GoogleCloudPlatform:developfrom
kadupoornima:telemetry-16
Apr 27, 2026
Merged

[Telemetry] Set up a Github workflow to cache release metadata #5553
kadupoornima merged 7 commits into
GoogleCloudPlatform:developfrom
kadupoornima:telemetry-16

Conversation

@kadupoornima

@kadupoornima kadupoornima commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Added a new cache_metadata workflow that is triggered upon every new release to extract metadata for that particular version (standard modules, standard example files, and standard blueprint names) and store it in a Firestore database. The implementation includes concurrent processing to ensure efficient data retrieval.

Changes:

  • New Metadata Caching Tool: Added a Go-based utility to fetch and cache release metadata from the GitHub repository using the Git Trees API.
  • Firestore Integration: Implemented functionality to store discovered modules, example files, and blueprint names into Google Cloud Firestore.
  • Performance Optimization: Introduced a bounded worker pool to concurrently fetch and process YAML files, significantly improving efficiency over sequential requests.

@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 introduces a new automation tool designed to improve telemetry and metadata management. By querying the GitHub Git Trees API, the tool identifies relevant modules and example files for specific versions and persists this information in Firestore, facilitating easier access to release metadata.

Highlights

  • New Metadata Caching Tool: Added a Go-based utility to fetch and cache release metadata from the GitHub repository.
  • Firestore Integration: Implemented functionality to store discovered modules and example files into Google Cloud Firestore.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/cache-metadata.yml
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.

@kadupoornima kadupoornima added the release-improvements Added to release notes under the "Improvements" heading. label Apr 24, 2026

@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 a tool to cache toolkit metadata, specifically modules and examples, from GitHub into Firestore for a given version. The review feedback highlights several areas for improvement: the caching logic in fetchGitTree is flawed as it ignores the version parameter after the first call, the GCP project ID should be configurable rather than hardcoded, and the use of path/filepath should be replaced with the path package to correctly and idiomatically handle forward-slash paths from the GitHub API.

Comment thread tools/cache_metadata/main.go Outdated
Comment thread tools/cache_metadata/main.go
Comment thread tools/cache_metadata/main.go Outdated
Comment thread tools/cache_metadata/main.go Outdated
Comment thread tools/cache_metadata/main.go Outdated
@kadupoornima kadupoornima marked this pull request as ready for review April 24, 2026 10:00
@kadupoornima kadupoornima requested a review from a team as a code owner April 24, 2026 10:00
@kadupoornima kadupoornima enabled auto-merge (squash) April 24, 2026 10:00
@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 a new utility in tools/cache_metadata/main.go to fetch toolkit metadata—including modules, example files, and blueprint names—from GitHub and cache it in Firestore for a given version. The review feedback highlights several opportunities for optimization and better maintainability: reducing redundant network calls by sharing the Git tree result, parallelizing the fetching of individual example files to avoid performance bottlenecks and rate limiting, reusing existing data structures and logic from the pkg/config package, and avoiding hardcoded project identifiers.

Comment thread tools/cache_metadata/main.go Outdated
Comment thread tools/cache_metadata/main.go
Comment thread tools/cache_metadata/main.go
Comment thread tools/cache_metadata/main.go Outdated
Comment thread tools/cache_metadata/main.go Outdated
@kadupoornima kadupoornima disabled auto-merge April 24, 2026 10:58
@kadupoornima

Copy link
Copy Markdown
Contributor Author

/gemini summary

@kadupoornima kadupoornima enabled auto-merge (squash) April 24, 2026 11:04
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request introduces a new automation tool designed to improve telemetry and metadata management for the project. By querying the GitHub Git Trees API, the tool identifies relevant modules and example files for specific versions and persists this information in Firestore, facilitating easier access to release metadata. The implementation includes concurrent processing to ensure efficient data retrieval.

Highlights

  • New Metadata Caching Tool: Added a Go-based utility to fetch and cache release metadata from the GitHub repository using the Git Trees API.
  • Firestore Integration: Implemented functionality to store discovered modules, example files, and blueprint names into Google Cloud Firestore.
  • Performance Optimization: Introduced a bounded worker pool to concurrently fetch and process YAML files, significantly improving efficiency over sequential requests.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/cache-metadata.yml
Activity
  • The pull request was created by kadupoornima.
  • Gemini Code Assist provided multiple rounds of feedback regarding code idiomaticity, efficiency, and maintainability.
  • The author addressed feedback by refactoring the code to use the 'path' package, removing redundant caching, and implementing a worker pool for concurrent API requests.
  • The author acknowledged suggestions regarding code duplication and hardcoded project IDs, noting plans to address them in future refactoring PRs.

@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 ecd1b6c into GoogleCloudPlatform:develop Apr 27, 2026
15 of 74 checks passed
@kadupoornima kadupoornima deleted the telemetry-16 branch April 28, 2026 04:25
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.

2 participants