Skip to content

Conversation

@cgwalters
Copy link
Collaborator

See containers/skopeo#2724

Signed-off-by: Colin Walters <walters@verbum.org>
@gemini-code-assist
Copy link

Summary of Changes

Hello @cgwalters, 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 image proxy functionality by adding support for configuring a user agent prefix for skopeo commands. This allows for better identification of the client making requests, which can be useful for logging, analytics, or server-side content adaptation. The implementation includes a robust mechanism to detect skopeo's capability to handle this new option, ensuring compatibility across different skopeo versions.

Highlights

  • User Agent Prefix Configuration: Introduced a new user_agent_prefix field within the ImageProxyConfig struct, allowing users to specify a custom prefix for the skopeo user agent string.
  • Skopeo Feature Detection: Added a supports_user_agent_prefix() function that dynamically checks if the installed skopeo command-line tool supports the --user-agent-prefix argument by parsing its --help output. This ensures backward compatibility.
  • Command Argument Integration: Modified the logic for constructing the skopeo command to conditionally include the --user-agent-prefix argument and its value, but only if the prefix is provided in the configuration and skopeo supports it.
  • New Test Case: Included a new test case to validate the correct behavior of the user_agent_prefix functionality, verifying that the argument is passed when supported and omitted when not.
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.

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 introduces the ability to configure a user agent prefix for the skopeo command. It adds a new field user_agent_prefix to the ImageProxyConfig struct, a function supports_user_agent_prefix to check if the skopeo version supports the --user-agent-prefix option, and modifies the TryFrom<ImageProxyConfig> for Command implementation to include the user agent prefix if it is provided and supported. Additionally, it includes a test case to validate the new functionality. I have identified a potential issue where the supports_user_agent_prefix function might be inefficient due to repeated execution. I've provided a suggestion to memoize the result more effectively.

@cgwalters cgwalters enabled auto-merge (squash) October 22, 2025 19:10
@cgwalters cgwalters merged commit 5a198e7 into bootc-dev:main Oct 22, 2025
2 checks passed
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