Skip to content

feat: validate actions for merged-usr violations#1912

Merged
loosebazooka merged 11 commits intomainfrom
validate_merged_usr
Apr 17, 2026
Merged

feat: validate actions for merged-usr violations#1912
loosebazooka merged 11 commits intomainfrom
validate_merged_usr

Conversation

@thesayyn
Copy link
Copy Markdown
Collaborator

Creates bazel validation actions for the debian13 targets to ensure that no layer violates the merged-usr conventions. This ensures both upstream debian packages and intermediate layers created by both distroless and rules_distroless is mergedusr compliant.

@thesayyn thesayyn requested a review from loosebazooka October 29, 2025 21:13
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @thesayyn, 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 implements a crucial validation step for OCI images built using Bazel, specifically targeting Debian 13. By integrating a new Bazel aspect, it automatically checks for violations of the merged-usr filesystem hierarchy standard within image layers. This proactive measure helps maintain consistency and prevents potential issues arising from non-compliant file structures in both base images and custom layers.

Highlights

  • Merged-usr Validation: Introduced Bazel validation actions for debian13 targets to enforce merged-usr conventions, ensuring compliance for both upstream Debian packages and intermediate layers.
  • New Bazel Aspect: Added a new Bazel aspect, validate_usr_symlinks, which uses bsdtar and gawk to inspect OCI image layers for merged-usr violations.
  • Dependency Updates: Included gawk as a new Bazel dependency and updated bazel_skylib and rules_cc versions.
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
Copy Markdown
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 Bazel aspect to validate merged-usr compliance for debian13 targets, which is a valuable addition for ensuring the correctness of the built container images. The implementation is generally sound, but I've identified a critical issue in the validation logic that would lead to incorrect failures on valid images. Additionally, I've provided several suggestions to enhance the maintainability and extensibility of the new validation aspect.

Comment thread private/util/validate_usr_symlinks.bzl Outdated
Comment thread private/util/validate_usr_symlinks.bzl Outdated
Comment thread private/util/validate_usr_symlinks.bzl Outdated
Comment thread private/util/validate_usr_symlinks.bzl Outdated
Comment thread private/util/validate_usr_symlinks.bzl
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 29, 2025

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

@thesayyn thesayyn force-pushed the validate_merged_usr branch from d9c6e07 to a3bf482 Compare October 29, 2025 21:57
@thesayyn thesayyn force-pushed the validate_merged_usr branch from a3bf482 to 9a6cc56 Compare April 15, 2026 17:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

🌳 🔧 Config Check

This pull request has not modified the root BUILD

Co-authored-by: gemini-code-assist[bot]
<176961590+gemini-code-assist[bot]@users.noreply.github.com>
@thesayyn thesayyn force-pushed the validate_merged_usr branch from 9a6cc56 to b620b53 Compare April 15, 2026 18:07
Comment thread private/util/validate_usr_symlinks.bzl Outdated
Comment thread private/util/validate_usr_symlinks.bzl Outdated
Comment thread .bazelrc
@thesayyn thesayyn force-pushed the validate_merged_usr branch from 5869d39 to 022f61b Compare April 15, 2026 20:15
Comment thread private/util/validate_usr_symlinks.bzl Outdated
Comment thread private/util/validate_usr_symlinks.bzl Outdated
Comment thread private/util/validate_usr_symlinks.bzl Outdated
@thesayyn thesayyn requested a review from loosebazooka April 16, 2026 19:55
Copy link
Copy Markdown
Member

@loosebazooka loosebazooka left a comment

Choose a reason for hiding this comment

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

so something I didn't realize is this was only checking ./, instead of all the root specification mechanisms

Comment thread private/util/validate_usr_symlinks.awk
Comment thread private/util/validate_usr_symlinks_test.sh
Comment thread private/util/validate_usr_symlinks_test.sh
Comment thread private/util/validate_usr_symlinks_test.sh
@loosebazooka loosebazooka merged commit 8a165b8 into main Apr 17, 2026
14 checks passed
@loosebazooka loosebazooka deleted the validate_merged_usr branch April 17, 2026 01:52
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