Repository navigation
fix(flavors): single-source flavor to image name mapping in flavors.py - #144
Conversation
|
Reviewed the diff closely and it reads correct — I'd merge it on a green run. Holding off only because CI is red. On the change itself:
The problem: all four Build Image steps failed on
Generated by Claude Code |
… repo file The review on #133 is right on both counts. `! grep -q 'COPY --from=packages' Containerfile` enforced nothing. errexit exempts any pipeline beginning with `!`, so a failing one neither stops the script nor changes its exit status: $ bash -c 'set -euo pipefail; ! grep -q RUN Containerfile; echo reached' reached $ echo $? 0 So the PR body claimed a gate the recipe did not have; only the unit test enforced it. Both `!` guards in `check` are now explicit `if ... exit 1` blocks with a message that says what to do. The workflow-literal guard on the following line had been working by accident: it was the last command in the recipe, so its status was the recipe's status. That is a property of where it sits in the file, not of what it does, and any line appended after it silently switches it off. Worth knowing for #144, which appends exactly such a line. The containerfile skill also described a design this repository does not have. It said utah-packages.repo is committed with enabled=0 and that the two mounted steps enable it explicitly. It is committed with enabled=1 -- the repo file's own comment says why -- and the flavor step flips it to 0 afterwards so later dnf calls on the finished image do not fail on a baseurl that is no longer mounted. The doc now says that. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M
|
One more finding, and this one is caused by the diff rather than pre-existing — it came out of a review on #133.
The flavor-literal guard in This PR appends a second guard after it: which makes the workflow guard no longer last. So after this merges, a workflow naming Please make both explicit while you are in here: #133 converts the two guards that exist on Everything in my earlier comment still stands: the diff itself is right, and I will merge it on a green run. Generated by Claude Code |
|
Addressed feedback from @hanthor in commit
🐝 Hive Agent: |
There was a problem hiding this comment.
correctness
- (low)
image_nameno longer respects theimageJustfile variable.image := "utah"(Justfile:2) is overridable on the CLI (just image=... ...); the oldimage_nameandbuild-ghcrcase statements built names from{{ image }}, but the new path hardcodesutahviaIMAGEin scripts/flavors.py:26-31. Meanwhilebuild-ghcrstill passesIMAGE_ID="{{ image }}"(Justfile:227) next toIMAGE_NAME="$image_name"from flavors.py (Justfile:176, 226), so animage=override now produces divergent IMAGE_ID/IMAGE_NAME where they previously agreed. No workflow or recipe in the repo overridesimagetoday, so this is latent — but either drop the override affordance or route IMAGE_ID through the same source.
Verified empirically: the new Justfile self-guard (Justfile:107) survives just's {{ }} interpolation (\{\{ is not interpolated), does not match its own pattern line, and correctly fails on both utah-nvidia and {{ image }}-nvidia literals.
No findings from: security, intent-alignment, style, docs-currency.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78
|
Acknowledged and thank you for the review, @kubestellar-hive! Regarding the latent
|
… and check Hummingbird signatures (#133) * Stop shipping the 4 GB package repository in every image, and check signatures Mapping the published image's layers to its config history showed what the "3 GB GNOME layer" was: layer 34 4064 MiB COPY --from=packages /repository /etc/utah-packages layer 41 979 MiB the actual package transaction total 5.94 GiB 45 layers, no chunkah annotations of Utah's own The Containerfile copied the package factory's entire RPM repository into the image so dnf could install from file:///etc/utah-packages, and nothing ever removed it: two thirds of every pull, 4 GB under /etc on every installed system, and the largest single contributor to the 7.9 GB ISO, whose squashfs holds the image (#130, #128). The repository is now bind mounted into the two RUN steps that install from it -- the main transaction and the flavor step that builds the OGC kernel and NVIDIA module -- and never committed to a layer. The pinned `packages` stage is still the only source the transaction can see, which is what the old COPY comment meant by reproducible. The flavor step, the last one that installs anything, flips utah-packages.repo to enabled=0 so later dnf calls on the image (the live ISO build's included) do not fail on a baseurl that is not there. just check now refuses a COPY --from=packages. Hummingbird's RPMs are signed with Red Hat's release key 2 (RSA/SHA256, key ID 199e2f91fd431d51, verified against a downloaded package), but packages/hummingbird.repo carried gpgcheck=0 copied from upstream's lockfile-tooling repo file, so the build logged Warning: skipped OpenPGP checks for 702 packages The key is committed (fingerprint 567E 347A D004 4ADE 55BA 8A5F 199E 2F91 FD43 1D51), installed under /etc/pki/rpm-gpg in both Containerfiles, and the repo file runs with gpgcheck=1. The factory repository stays at gpgcheck=0: its trust root is the pinned image's OCI provenance, as its file says. Changing hummingbird.repo rotates the kernel-cache tag, so the first gaming build after this compiles the kernel once. The live ISO's dracut run failed on every build, dracut-install: ERROR: installing '/root' to '/root' dracut[E]: FAILED: ... dracut-install -D ... -f /root /root because /root is a symlink to /var/roothome and the target does not exist at build time, and dracut still exited 0 so the build went on with a module silently dropped (#132). The target now exists for the duration of the run, the run is under pipefail, and a dracut[E] FAILED line fails the step. configure-services.sh no longer claims Utah is rechunked; it is not, because reusable-build skips chunkah on the testing stream (#131), which needs a change in projectbluefin/actions. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M * Justfile: pass the --mount pattern to grep with -e, it was parsed as an option CI's contract job failed on the previous commit with grep: unrecognized option '--mount=type=bind,...' because the pattern starts with two dashes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M * Make the check guards fail, and correct what the doc claims about the repo file The review on #133 is right on both counts. `! grep -q 'COPY --from=packages' Containerfile` enforced nothing. errexit exempts any pipeline beginning with `!`, so a failing one neither stops the script nor changes its exit status: $ bash -c 'set -euo pipefail; ! grep -q RUN Containerfile; echo reached' reached $ echo $? 0 So the PR body claimed a gate the recipe did not have; only the unit test enforced it. Both `!` guards in `check` are now explicit `if ... exit 1` blocks with a message that says what to do. The workflow-literal guard on the following line had been working by accident: it was the last command in the recipe, so its status was the recipe's status. That is a property of where it sits in the file, not of what it does, and any line appended after it silently switches it off. Worth knowing for #144, which appends exactly such a line. The containerfile skill also described a design this repository does not have. It said utah-packages.repo is committed with enabled=0 and that the two mounted steps enable it explicitly. It is committed with enabled=1 -- the repo file's own comment says why -- and the flavor step flips it to 0 afterwards so later dnf calls on the finished image do not fail on a baseurl that is no longer mounted. The doc now says that. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W6BYLUD6KBzF8rBFXKjP7M --------- Co-authored-by: Claude <noreply@anthropic.com>
9c31bf4 to
dc4b926
Compare
castrojo
left a comment
There was a problem hiding this comment.
Rebased fork branch on origin/main, resolved merge conflict in Justfile check recipe, and pushed to author fork. contract CI job passed and build_main image build is in progress. Awaiting CI completion and approval from an independent maintainer to land.
There was a problem hiding this comment.
intent-alignment
- low — The flavor→name mapping is now single-sourced, but the base name
utahnow lives in two places:scripts/flavors.pyIMAGE(scripts/flavors.py:27-32) and the Justfile variableimage := "utah"(Justfile:2). Before this change,image_namederived names from{{ image }}, so overriding or renamingimagechanged everything consistently; nowbuild-ghcrstill passes--build-arg IMAGE_ID="{{ image }}"(Justfile:243) while tags come from flavors.py (Justfile:161-162, 190) — renaming the image via the Justfile variable would silently leave published image names unchanged. Not a blocker, worth a comment or a follow-up.
Verified at head dc4b926: the new self-guard grep -nE '(utah|\{\{ image \}\})-(nvidia|gaming)' Justfile (Justfile:121) does not match its own line or any remaining recipe text (exit 1 against the head Justfile), and the delegation in build-ghcr (Justfile:190) matches the existing gen-sbom/secureboot pattern (Justfile:296, 437).
No findings from: correctness, security, style, docs-currency.
— hive: agent=reviewer backend=copilot model=claude-fable-5
Collapse duplicate flavor-to-image name mappings in Justfile into
scripts/flavors.py via a new `image FLAVOR` query. `image_name` in
Justfile now queries `flavors.py image "{{ flavor }}"`, and `build-ghcr`
delegates to `just image_name` like `gen-sbom` and `secureboot` already
do. Extend the `just check` guard to ensure neither workflows nor the
Justfile contain hardcoded flavored image names. Update tests and the
flavors skill documentation accordingly.
Closes projectbluefin#43
Assisted-by: Gemini 3.8 Flash via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
dc4b926 to
cb79dcc
Compare
There was a problem hiding this comment.
docs-currency
docs/skills/flavors.md:54-56(as updated by this PR) states "Image names are resolved centrally by delegating tojust image_name, which queriesscripts/flavors.py image <flavor>" — but the diff does the opposite:build-ghcr(Justfile:190),gen-sbom(Justfile:296), andsecureboot(Justfile:437) all callpython3 scripts/flavors.py imagedirectly, and gen-sbom/secureboot were switched away fromjust image_name. The PR body makes the same claim ("Updatesbuild-ghcr… to delegate tojust image_namelikegen-sbomandsecureboot"). The consolidation itself is fine — everything now reads one source — but the doc and body describe a delegation chain that no longer exists. Fix the doc sentence (and noteimage_namesurvives only as the entry point the reusable build workflow calls).
No findings from: correctness, security, intent-alignment, style.
— hive: agent=reviewer backend=copilot model=claude-fable-5
castrojo
left a comment
There was a problem hiding this comment.
Resolved exit-127 failure in run 35454332426 ('build-ghcr: line 176: just: command not found'): inlined 'python3 scripts/flavors.py image {{ flavor }}' in build-ghcr recipe instead of nested 'just image_name' shell call. Head commit cb79dcc rebased and tested; fresh CI run 35557206650 has passed all jobs (contract, build_main, build_kernel). Awaiting independent approval to merge.
… take The flavors skill said image names were resolved by delegating to `just image_name`, but build-ghcr, gen-sbom, and secureboot each call `python3 scripts/flavors.py image <flavor>` directly; `image_name` is now only the entry point for callers outside the Justfile. A reader tracing image-name resolution through the doc would land on a recipe nothing calls. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Danathar
left a comment
There was a problem hiding this comment.
Reviewed head 16a21fb in a local clone. The Justfile image_name, build-ghcr, gen-sbom and secureboot recipes all now take the image name from python3 scripts/flavors.py image , and the reusable build workflow still calls just image_name with the same three arguments, so the entry point is unchanged. I ran just image_name utah testing for main, nvidia, gaming and nvidia-gaming and got utah, utah-nvidia, utah-gaming and utah-nvidia-gaming; an unknown flavor exits non-zero. python3 tests/run_suite.py passes (287 tests), python3 scripts/generate_skill_index.py --check and scripts/check-skill-index.sh are clean, and the new Justfile self-guard uses an explicit if grep block so it is not subject to the ! grep errexit gap. The branch merges cleanly with current main.
Resolves #43
Summary
Previously, the flavor-to-image name mapping was duplicated across three locations:
scripts/flavors.py(the declared source of truth viaIMAGE)Justfilerecipeimage_nameJustfilerecipebuild-ghcr(reimplementing the case statement instead of callingimage_name)This PR consolidates the mapping into
scripts/flavors.py:image FLAVORquery toscripts/flavors.pythat returns the published image name (e.g.utahorutah-nvidia).image_nameinJustfileto callscripts/flavors.py image "{{ flavor }}".build-ghcr,gen-sbom, andsecurebootinJustfileto each callpython3 scripts/flavors.py imagedirectly;just image_nameremains as the entry point for callers outside the Justfile.just checkstatic guard to ensure neither.github/workflows/norJustfilecontain hardcoded flavored image names.tests/test_flavors.pyfor the newimagequery, argument handling, and consistency across queries.AGENTS.mdanddocs/skills/flavors.md(and regenerates the skill catalog).— hive: backend=copilot model=gemini-3.8-flash
🐝 Hive Agent:
contributor| SHA:17ff1e8