Skip to content

Conversation

@malt3
Copy link

@malt3 malt3 commented Oct 29, 2025

With rules_oci, the output of "oci_image" and "oci_image_index" is always a tree artifact containing the full oci layout. rules_img is an upcoming Bazel ruleset for building container images that tries to avoid unnecessary work. To that end, rules_img will only materialize a full oci layout tree artifact if a downstream action needs it. This is done through the use of two special output groups:

  • oci_layout contains a tree artifact of the full oci layout
  • oci_tarball contains is a tar file containing the oci layout

With this change, container_structure_test is compatible with both rulesets. Users can continue to pass a single file or can choose to use the aforementioned output groups.

This results in a better user experience for rules_img users who otherwise need to create a special intermediate filegroup to convert from OutputGroupInfo to DefaultInfo.

@gemini-code-assist
Copy link

Summary of Changes

Hello @malt3, 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 significantly enhances the container_structure_test Bazel rule by introducing support for the oci_layout and oci_tarball output groups, which are integral to the rules_img ruleset. The primary goal is to improve compatibility and user experience by allowing the rule to directly consume these specialized output groups, thereby eliminating the need for manual intermediate steps and ensuring seamless integration with modern OCI image build workflows.

Highlights

  • Enhanced OCI Output Group Detection: The container_structure_test Bazel rule now explicitly detects and utilizes oci_layout and oci_tarball output groups, which are introduced by the upcoming rules_img ruleset for building container images.
  • Improved Compatibility: This change ensures container_structure_test is compatible with both rules_oci and rules_img, providing a unified testing experience across different OCI image generation methods.
  • Streamlined User Experience: Users of rules_img no longer need to create intermediate filegroup targets to convert OutputGroupInfo to DefaultInfo, simplifying their Bazel configurations.
  • Flexible Image Attribute Handling: The image attribute in the container_structure_test rule has been updated to allow_files = True and now intelligently extracts the relevant image file from either specific OCI output groups or the DefaultInfo provider.
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 enhances the container_structure_test Bazel rule by adding support for oci_layout and oci_tarball output groups, which is useful for compatibility with rules_img. The implementation correctly checks for these output groups and falls back to the previous behavior of using a single file from DefaultInfo. The overall change is good, but there is an opportunity to refactor the new logic to improve its clarity and reduce code duplication.

With rules_oci, the output of "oci_image" and "oci_image_index" is always a tree artifact containing the full oci layout.
rules_img is an upcoming Bazel ruleset for building container images that tries to avoid unnecessary work.
To that end, rules_img will only materialize a full oci layout tree artifact if a downstream action needs it.
This is done through the use of two special output groups:

- oci_layout contains a tree artifact of the full oci layout
- oci_tarball contains is a tar file containing the oci layout

With this change, container_structure_test is compatible with both rulesets.
Users can continue to pass a single file or can choose to use the aforementioned output groups.

This results in a better user experience for rules_img users who otherwise need to create a special intermediate filegroup to convert from OutputGroupInfo to DefaultInfo.
@malt3 malt3 force-pushed the detect_rules_img_output_groups branch from 3d033ce to 9f64f9d Compare October 29, 2025 13:34
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.

1 participant