Skip to content

Conversation

@alexeagle
Copy link
Contributor

Reverts #180

The change to submodule fetching with @actions/checkout doesn't get enough --depth

@alexeagle alexeagle requested a review from hobofan September 8, 2025 14:50
Copy link

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

Summary of Changes

Hello @alexeagle, 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 addresses a critical issue related to submodule fetching in the CI/CD pipeline by reverting a previous feature that attempted to optimize GitHub repository metadata retrieval. The change restores the application's functionality to fetch this data dynamically on the client-side, ensuring stability and correct data display while resolving the underlying build-time problem.

Highlights

  • Revert of Static Metadata Fetching: This pull request reverts the changes introduced in bazel-contrib/bcr-ui#180, which aimed to fetch repository metadata statically during build time. The previous approach caused issues with submodule fetching due to insufficient --depth in the @actions/checkout action.
  • Re-introduction of Client-Side Metadata Fetching: As a direct consequence of the revert, the application now fetches GitHub repository metadata (description, license, topics, stargazers) dynamically on the client-side using a new useGithubMetadata React hook. This restores the previous behavior of fetching this data at runtime.
  • Removal of Static Metadata Infrastructure: The revert includes the removal of the data/githubMetadata.ts file, the data/github_metadata/README.md file, and the corresponding entry in .gitignore for static metadata JSON files. This cleans up the codebase from the static fetching mechanism.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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

@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 reverts a previous feature that fetched repository metadata during static site generation, opting instead for client-side fetching. This change is a response to issues with submodule fetching depth in the CI environment. The revert has been implemented correctly by removing the static data fetching logic and introducing a new React hook, useGithubMetadata, for client-side data retrieval. My review focuses on this new hook and I've identified a bug related to how license information is handled.

Comment on lines +656 to +658
if (repoData.license) {
setLicense(repoData.license)
}

Choose a reason for hiding this comment

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

high

The license object from the GitHub API response contains a url property that points to another API endpoint, not a human-readable license page. Assigning repoData.license directly to the state will cause the UI to render a link to this API endpoint, which is not the intended behavior. You should manually construct the license object for the state, creating a URL that points to a public license repository like opensource.org. It is also good practice to verify that repoData.license.spdx_id exists before using it to construct the URL.

Suggested change
if (repoData.license) {
setLicense(repoData.license)
}
if (repoData.license && repoData.license.spdx_id) {
setLicense({
name: repoData.license.name,
spdx_id: repoData.license.spdx_id,
url: `https://opensource.org/licenses/${repoData.license.spdx_id}`,
});
}

@alexeagle alexeagle merged commit 78dcb95 into main Sep 8, 2025
1 check passed
@alexeagle alexeagle deleted the revert-180-static-ghmeta branch September 8, 2025 14:55
@github-actions
Copy link

github-actions bot commented Sep 8, 2025

PR Preview Action v1.6.2
Preview removed because the pull request was closed.
2025-09-08 15:34 UTC

alexeagle added a commit that referenced this pull request Sep 8, 2025
This reverts commit 78dcb95.

Roll-forward with fixes
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.

3 participants