refactor(cook): data-driven recipe generation with in-process flatten and lint

Replace the hardcoded TEMPLATES dict and the ksflatten-relative wrapper
with a single data-driven pipeline:

- recipe_templates.yaml becomes the single source of truth with three
  sections: base (always included), choices (exactly-one per category,
  the invariant pykickstart cannot check) and features (additive flags
  or one-of values)
- generate_recipe.py is a pure YAML consumer: it resolves ingredients,
  renders dishes via pykickstart in-process (no ksflatten binary, no
  %include path munging), lints the invariants pykickstart cannot check
  (exactly-one per choice category, known keys, existing fragments,
  unique filenames) and validates every generated dish
- dish names are derived by a generic rule with canonical category order
  from the templates, independent of YAML key order; no committed
  generated files means no name burn-in
- recipes/ and dishes/ become gitignored build products; the 68 tracked
  generated files (already out of sync with the manifest) are removed
- delete dead ingredients (section-data/, validation/, initial-setup/
  desktop/, live/hypervisor.ks, rpmfusion-nonfree.ks), the stale
  all-ingredients.cfg (replaced by 'make inventory') and the
  bin/generate-recipe and bin/ksflatten-relative wrappers
- Makefile: single 'make all' step plus lint, validate, inventory, test
- add 16 pytest tests covering expansion, selection, naming, lint and
  flatten/validate round-trips
This commit is contained in:
Lukas Greve
2026-08-30 12:09:42 +02:00
parent 842f754681
commit ae6eef4045
87 changed files with 686 additions and 6127 deletions
@@ -1,9 +0,0 @@
# Desktop initial-setup configuration
firstboot --enable # Enable the Setup Agent to start at boot time
%packages --exclude-weakdeps
initial-setup
%end
-14
View File
@@ -1,14 +0,0 @@
# Live desktop hypervisor configuration
# Enable virtualization support in live environment
%packages
qemu-kvm
libvirt-client
virt-install
%end
%post --erroronfail
# Setup libvirt for live environment
mkdir -p /var/lib/libvirt
systemctl enable libvirtd
%end
@@ -1,21 +0,0 @@
# RPM Fusion non-free repositories
# RPM fusion repositories
# For the current release tree
repo --name=rpmfusion-nonfree --mirrorlist=https://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-$releasever&arch=$basearch --includepkgs=rpmfusion-nonfree-release
# Updates for the current release tree
repo --name=rpmfusion-nonfree-updates --mirrorlist=https://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-updates-released-$releasever&arch=$basearch --includepkgs=rpmfusion-nonfree-release
%post
# Import RPM Fusion PGP Key. Courtesy of https://github.com/rpmfusion/rpmfusion-nonfree-remix-kickstarts/blob/master/rpmfusion-nonfree-live-base.ks
echo "== RPM Fusion Nonfree: Base section =="
echo "Importing RPM Fusion keys"
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-*-primary
echo "List of packages from RPM Fusion Nonfree:"
rpm -qa --qf '%{NAME} %{SIGGPG:pgpsig} %{SIGPGP:pgpsig} \n' | grep -e 3DE8C682E38EE9BC0FDFEA47FCAE2EA87F858107 | awk ' { print $1 } ' | sort
echo "List of incuded RPM Fusion packages with their size:"
rpm -q --qf '%{SIZE} %{NAME}\n' $(rpm -qa --qf '%{NAME} %{SIGGPG:pgpsig} %{SIGPGP:pgpsig} \n' | grep -e 3DE8C682E38EE9BC0FDFEA47FCAE2EA87F858107 | awk ' { print $1 } ') | sort -n
echo
%end
@@ -1,9 +0,0 @@
# Core post-installation configuration
%post --log=/mnt/sysimage/root/post.log # Beginning of the post-installation section. Log all messages to a given file
localectl set-keymap ch-fr # Set keymap to `ch-fr`. Alternatively, `us` can be picked.
dnf update -y # Update the system
grub2-mkconfig -o /boot/grub2/grub.cfg # Unsure it is actually useful
%end # End of the %post section
@@ -1,5 +0,0 @@
# Post-installation no-chroot section
%post --nochroot --log=/mnt/sysimage/root/post-nochroot.log # Beginning of the post-installation section. Log all messages to a given file
%end # End of the %post section
@@ -1 +0,0 @@
# Server-specific post-install tasks
@@ -1,5 +0,0 @@
# Pre-installation kickstart section
%pre --log=/mnt/sysimage/root/pre.log Beginning of the pre section. Log all messages to a given file
%end # End of the %post section
@@ -1,5 +0,0 @@
# Pre-installation kickstart section
%pre --log=/mnt/sysimage/root/pre-install.log Beginning of the pre-installation section. Log all messages to a given file
%end # End of the %post section
@@ -1,6 +0,0 @@
# Validation fragment - success if empty
%post
# If this is being run, it's a success
echo SUCCESS > /root/RESULT
%end