From 725c020b6ed1c85117ec56fa8f53755afe3b2760 Mon Sep 17 00:00:00 2001 From: Nan Liu Date: Wed, 15 Jul 2026 19:04:04 +0000 Subject: [PATCH] feat(sources): add opt-in %fedora_upstream_* provenance macros Add a build.emit-upstream-provenance flag that, for Fedora upstream components, injects %fedora_upstream_version and %fedora_upstream_release macros into the component's generated macros file. Values are read from the pristine upstream Fedora spec on disk (before overlays) and the Release tag's %{?dist} is expanded to the resolved Fedora dist tag. Nothing is stored in the lock file; the macros are derived fresh at render/build time from the pinned upstream commit. Opt-in so only components that reference the macros (e.g. grub2 SBAT) get a macros file. User-defined macros of the same name win. --- docs/user/reference/config/components.md | 35 ++++ internal/app/azldev/cmds/component/build.go | 3 + .../app/azldev/cmds/component/diffsources.go | 3 +- .../cmds/component/history_customizations.go | 7 + .../cmds/component/history_internal_test.go | 23 ++- .../azldev/cmds/component/preparesources.go | 3 + internal/app/azldev/cmds/component/render.go | 1 + .../app/azldev/core/sources/sourceprep.go | 44 ++++- .../core/sources/upstream_provenance.go | 165 ++++++++++++++++ .../upstream_provenance_internal_test.go | 183 ++++++++++++++++++ internal/projectconfig/build.go | 22 +++ internal/projectconfig/build_test.go | 41 ++++ ...ainer_config_generate-schema_stdout_1.snap | 5 + ...shots_config_generate-schema_stdout_1.snap | 5 + schemas/azldev.schema.json | 5 + 15 files changed, 531 insertions(+), 14 deletions(-) create mode 100644 internal/app/azldev/core/sources/upstream_provenance.go create mode 100644 internal/app/azldev/core/sources/upstream_provenance_internal_test.go diff --git a/docs/user/reference/config/components.md b/docs/user/reference/config/components.md index 678669512..04f81f212 100644 --- a/docs/user/reference/config/components.md +++ b/docs/user/reference/config/components.md @@ -159,6 +159,7 @@ The `[components..build]` section controls build-time options for a compon | Without options | `without` | string array | No | Build conditionals to disable (`--without