-
Notifications
You must be signed in to change notification settings - Fork 21
Revert "feat: fetch repo metadata in staticProps" #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit 03ec085.
There was a problem hiding this 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--depthin the@actions/checkoutaction. - 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
useGithubMetadataReact 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.tsfile, thedata/github_metadata/README.mdfile, and the corresponding entry in.gitignorefor 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
-
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. ↩
There was a problem hiding this 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.
| if (repoData.license) { | ||
| setLicense(repoData.license) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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}`, | |
| }); | |
| } |
|
This reverts commit 78dcb95. Roll-forward with fixes
Reverts #180
The change to submodule fetching with
@actions/checkoutdoesn't get enough--depth