Skip to content

Conversation

@loosebazooka
Copy link
Member

@loosebazooka loosebazooka commented Dec 22, 2025

Here's something that actually works for our repository instead of the default script.

An intial run on a big set (20K images) like gcr.io/distroless/base looks like it takes about 16 hours. But after that, it should only tag newly out-of-date images. There are no parallelization optimizations.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @loosebazooka, 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 specialized bash script for managing container image lifecycles by enabling bulk tagging operations within a registry. The primary goal is to facilitate the identification and marking of stale images for potential updates, and to provide a framework for deprecating images, thereby improving repository maintenance and auditing without immediately deleting images. This new tool is designed to be more effective for the repository's specific needs compared to generic solutions.

Highlights

  • New Bulk Image Tagger Script: Introduces a new tag.sh bash script designed to bulk-tag container images within a registry, providing a more robust solution than previous default scripts.
  • Update Mode for Stale Images: The script includes an update mode that identifies images lacking specific tags (or only having commit hash tags) and are older than 48 hours, subsequently tagging them with update-available-public-image-<sha256>.
  • Deprecate Mode (Currently Disabled): A deprecate mode is implemented to mark images as deprecated, tagging them with deprecated-public-image-<sha256>. This functionality is currently commented out in the script for safety.
  • Dry Run Capability: The script defaults to a dry run mode, allowing users to preview the tagging operations without making actual changes to the registry. Live execution requires explicitly setting DRY_RUN=false.
  • Comprehensive Documentation: A detailed README.md file accompanies the script, outlining its purpose, prerequisites (gcrane, jq), functionality, and usage examples.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

🌳 🔧 Config Check

This pull request has not modified the root BUILD

Copy link
Contributor

@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 introduces a new script for bulk-tagging container images, along with its documentation. The script is well-structured, but there are several areas for improvement in terms of robustness, readability, and best practices in shell scripting. My review includes suggestions to improve error handling, remove magic numbers, clarify variable validation, use professional error messages, and fix a bug in command-line argument parsing. I've also suggested a minor clarification in the README file.

@loosebazooka
Copy link
Member Author

/gemini review

Copy link
Contributor

@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 introduces a new shell script for bulk-tagging container images, along with its documentation. The script is well-structured and the addition of a README is great for usability.

My review includes a critical fix for a logic error in command chaining that would cause the script to exit prematurely on success. I've also included several medium-severity suggestions to improve code readability and maintainability, such as removing a magic number, cleaning up dead code, and clarifying the documentation.

@loosebazooka loosebazooka force-pushed the repo_tools branch 2 times, most recently from 5350dd2 to c0424dd Compare December 22, 2025 21:21
@loosebazooka
Copy link
Member Author

/gemini review

Copy link
Contributor

@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 introduces a new bash script for bulk-tagging container images, along with its documentation. The script is well-structured and uses modern bash features. My review focuses on improving maintainability by using constants, enhancing clarity in argument parsing and error messages, and fixing a potentially incorrect filter that could lead to tagging the wrong images. The accompanying README is clear and helpful.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

🌳 🔄 Image Check
This pull request doesn't make any changes to the images. 👍
You can check the details in the report here

');

echo "tagging ${#targets[@]} images of $image"
echo "disabled for now, edit out comment"
Copy link
Collaborator

Choose a reason for hiding this comment

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

are you going to leave this commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I don't have a use for it until Debian 14

Signed-off-by: Appu Goundan <[email protected]>
@loosebazooka loosebazooka merged commit faac4a1 into main Dec 23, 2025
12 checks passed
@loosebazooka loosebazooka deleted the repo_tools branch December 23, 2025 19:31
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.

2 participants