fix(sbom): a component the build installed is badged "Im Image (gebaut)" (#881)
CI / Check (push) Skipped
CI / Agent integration (push) Skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy MCP (push) Skipped
CI / Deploy Docs (push) Successful in 1m11s
CI / Deploy Dashboard (push) Successful in 5m14s
CI / Deploy Agent (push) Successful in 8m28s

This commit was merged in pull request #881.
This commit is contained in:
sharang committed 2026-11-05 08:30:19 +00:00
1 parent 01a24f4556
commit 13d09dc830
3 files changed
+32 -14

No files matched your search

+17 -2
View File
@@ -2296,12 +2296,27 @@ pub mod sbom {
de: "Yocto-Rezeptinventar (nicht die SBOM des Images): aus den Rezepten im Layer-Baum gelesen, ohne Build. Layer-Overrides und PACKAGECONFIG sind nicht aufgelöst; es listet daher mehr, als das Image enthält. Was ein Image-Rezept installiert, ist mit „Im Image (deklariert)“ markiert.",
en: "Yocto recipe inventory (not the image SBOM): read from the recipes in the layer tree, without a build. Layer overrides and PACKAGECONFIG are not resolved, so it lists more than the image contains. What an image recipe installs is marked \"In the image (declared)\".",
};
/// A component an image recipe installs (its badge and filter).
/// The badge of a component an image recipe installs.
pub const IN_IMAGE: Text = Text {
de: "Im Image (deklariert)",
en: "In the image (declared)",
};
/// The badge's and the filter's tooltip; the badge adds the images.
/// The badge of a component the build installed (its image SPDX).
pub const IN_IMAGE_BUILT: Text = Text {
de: "Im Image (gebaut)",
en: "In the image (built)",
};
/// The in-image filter's choice: declared or built alike.
pub const IN_IMAGE_ANY: Text = Text {
de: "Im Image",
en: "In the image",
};
/// The in-image filter's tooltip.
pub const IN_IMAGE_FILTER_HINT: Text = Text {
de: "Vom Build installiert (Image-SPDX) oder von den Image-Rezepten deklariert.",
en: "Installed by the build (image SPDX) or declared by the image recipes.",
};
/// The declared badge's tooltip; the badge adds the images.
pub const IN_IMAGE_HINT: Text = Text {
de: "Aus den Rezepten gelesen (IMAGE_INSTALL, Paketgruppen eine Ebene tief, IMAGE_FEATURES), nicht von BitBake aufgelöst: Overrides, PACKAGECONFIG und von DISTRO_FEATURES abhängige Pakete sind nicht berücksichtigt.",
en: "Read from the recipes (IMAGE_INSTALL, package groups one level deep, IMAGE_FEATURES), not resolved by bitbake: overrides, PACKAGECONFIG and packages that depend on DISTRO_FEATURES are not taken into account.",
+11 -10
View File
@@ -206,13 +206,13 @@ pub fn SbomPage(target: String) -> Element {
}
select {
class: "sbom-filter-select",
title: tx::IN_IMAGE_HINT.get(lang),
title: tx::IN_IMAGE_FILTER_HINT.get(lang),
onchange: move |e| {
in_image_filter.set((e.value() == "true").then_some(true));
page.set(1);
},
option { value: "", {tx::ALL_COMPONENTS.get(lang)} }
option { value: "true", {tx::IN_IMAGE.get(lang)} }
option { value: "true", {tx::IN_IMAGE_ANY.get(lang)} }
}
select {
class: "sbom-filter-select",
@@ -354,13 +354,14 @@ pub fn SbomPage(target: String) -> Element {
let edit_target = target.clone();
let edit_existing = entry.concluded.clone();
let row_key_click = row_key.clone();
// Which images hold it, and how that is known, on the badge's tooltip.
let in_image_title = entry.in_image.as_ref().map(|i| {
let hint = match i.basis {
compliance_core::models::InImageBasis::Declared => tx::IN_IMAGE_HINT,
compliance_core::models::InImageBasis::Built => tx::IN_IMAGE_BUILT_HINT,
// How it is known to be in the image names the badge; the
// tooltip adds which images hold it.
let in_image_badge = entry.in_image.as_ref().map(|i| {
let (label, hint) = match i.basis {
compliance_core::models::InImageBasis::Declared => (tx::IN_IMAGE, tx::IN_IMAGE_HINT),
compliance_core::models::InImageBasis::Built => (tx::IN_IMAGE_BUILT, tx::IN_IMAGE_BUILT_HINT),
};
format!("{} (Images: {})", hint.get(lang), i.images.join(", "))
(label.get(lang), format!("{} (Images: {})", hint.get(lang), i.images.join(", ")))
});
rsx! {
tr {
@@ -385,12 +386,12 @@ pub fn SbomPage(target: String) -> Element {
td {
style: "font-weight: 500;",
"{entry.name}"
if let Some(title) = in_image_title {
if let Some((label, title)) = in_image_badge {
" "
span {
class: "badge badge-success",
title: "{title}",
{tx::IN_IMAGE.get(lang)}
{label}
}
}
}
+4 -2
View File
@@ -278,7 +278,8 @@ the tree (with none, the component names the configuration file instead).
**Where it shows.** A badge **Im Image (deklariert)** next to the component in
the SBOM view, whose tooltip names the images and says it is read from the
recipes, not resolved by bitbake; a filter of the same name; and the SBOM list
recipes, not resolved by bitbake; the filter **Im Image** (*In the image*),
which also takes the components the build installed; and the SBOM list
puts these components first. The component's evidence line names the images,
the CycloneDX export carries the property `pruefwerk:component:in_image`
(`declared: pump-image`), and the SPDX export adds it to the package `comment`.
@@ -322,7 +323,8 @@ wizard or under **Datei hinzufügen** on the target:
**What the SPDX gives.** One component per recipe that has packages in the image
(BusyBox's `busybox`, `busybox-syslog` and `busybox-udhcpc` are one component),
with the version the build used, the declared licence and the CPE. These carry
the badge **Im Image** with the tooltip *installed by the build*. They are joined
the badge **Im Image (gebaut)** (*In the image (built)*), whose tooltip says the
build installed them. They are joined
with the recipe inventory by recipe name: the version the build used wins over the
`PV` in the tree (`busybox_1.35.0.bb` in the layer, 1.36.1 built), and both
evidence lines stay. For an image the SPDX covers, a recipe the image recipes