← Back to Pull requests

Preserve layer annotations from parent images during commit #6972

Open
unknown opened this pull request with 277 lines diff across 3 files
View on GitHub
unknown unknown commented on Jul 20, 2026 10:54 UTC
Author

What type of PR is this?


/kind bug

What this PR does / why we need it:

When building an image using FROM with a source that contains
layer annotations, the final committed image loses those
annotations.

Propagate the per-layer annotations to addLayer() for OCI
images to be present in the final committed image.
The annotations are only preserved if the layer
content doesn't change as their lookup relies
on the layer uncompressed digest not changing.

Introduce a new flag --inherit-layer-annotations for
the buildah build command to control inheritance
of per-layer annotations (default=true).

Extend the existing buildah config --annotation flag
to support "layer:" prefix for per-layer annotations
on the top-most (read-write) layer. The flag works
the same for per-layer annotation as it does for
image ones (set/unset key/clear all).

How to verify it

1. Pick an image with layer annotations, e.g.:

skopeo inspect -n docker://quay.io/fedora/fedora-bootc | jq -c '.LayersData[].Annotations' | head

2. Build from it:
buildah from quay.io/fedora/fedora-bootc
buildah run fedora-bootc-working-container touch /var/foo
img=$(buildah commit fedora-bootc-working-container)

3. Check annotations on the new image:
skopeo inspect containers-storage:$img | jq '.LayersData[].Annotations' | head

Which issue(s) this PR fixes:


Fixes https://github.com/podman-container-tools/buildah/issues/6652

Special notes for your reviewer:


I'm adding notes inline.

Does this PR introduce a user-facing change?


``release-note
When building an image using FROM with a source that contains layer annotations, commit now preserves the per-layer annotations.
The
buildah build command now accepts an optional flag --inherit-layer-annotations (default true) that controls inheritance for per-layer annotations.
The
buildah config --annotation flag now supports "layer:" prefix for per-layer annotations on the top-most layer and works the same for per-layer annotation as it does for image ones (set/unset key/clear all).
``

Diff: 277 lines (+207 / -70) across 3 files Reviewer: simonbrauner Review duration: 191826m
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 277 lines diff across 3 files
0.47
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
44%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.337
Real PR Conversation Timeline
1 comments
"Review active on #6972"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 44.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 46.6% (MEDIUM) · Higher = larger blast radius
46.6%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 44.7% · Lower = rushed or shallow review
44.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 25.8% · Safe to merge
25.8%