Skip to content

fix(ci): gate on dracut errors and enable Trivy RPM scanning - #157

Closed
mrbobbytables wants to merge 0 commit into
projectbluefin:mainfrom
mrbobbytables:fix/ci-dracut-trivy-signatures
Closed

mrbobbytables wants to merge 0 commit into
projectbluefin:mainfrom
mrbobbytables:fix/ci-dracut-trivy-signatures

Conversation

@mrbobbytables

@mrbobbytables mrbobbytables commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Addresses image and live ISO build errors identified in #132:

  1. Dracut live initramfs errors: In bootc images, /root is a symlink to /var/roothome, which does not exist during container build time, causing dracut-install -f /root /root to fail. We create /var/roothome (0700) before running dracut. In addition, sysloglvl=0 is set to silence container /dev/log warnings, --stdlog 4 is passed, and dracut output is monitored with set -o pipefail to fail closed if any dracut[E] errors occur — dracut exits 0 even when it logs a failed install, which is how the broken initramfs shipped in the first place.
  2. Trivy vulnerability scanning: Trivy scans images as "OS family none" because it does not recognize Hummingbird's identity in os-release and lacks an etc/fedora-release fallback. We write /usr/lib/fedora-release with Fedora release ${FEDORA_MAJOR_VERSION} and symlink /etc/fedora-release, allowing Trivy to identify the OS family as Fedora and scan installed RPMs against upstream CVE data. We also add /usr/lib/fedora-release to contracts/bluefin-desktop.toml and verify it in tests.
  3. Documentation and testing: Added unit test coverage in tests/test_desktop_contract.py, tests/test_package_resolution.py, and tests/test_iso_ci.py, updated relevant skills in docs/skills/, and regenerated the skill catalog. docs/skills/package-contract.md now documents the Hummingbird repository's existing signature verification against the key it actually uses, packages/RPM-GPG-KEY-redhat-release-2 (Red Hat release key 2, key ID 199e2f91fd431d51).

Not in this PR: an earlier revision of this description claimed gpgcheck=1 was being enabled in packages/hummingbird.repo with a RPM-GPG-KEY-hummingbird-release key. That was wrong on both counts — signature verification has been enforced on main since before this branch, against the Red Hat release key — and the claim, the wrong key path in the docs, and the duplicate test that restated the existing test_hummingbird_packages_are_signature_checked assertions have all been removed.

Closes #132

— hive: backend=copilot model=gemini-3.8-flash

🐝 Hive Agent: contributor | SHA: 55a768e

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

hanthor added a commit that referenced this pull request Sep 19, 2026
…have (#184)

kernel_cache built the kernel and then unconditionally pushed the cache to
ghcr.io, which a pull request from a fork can never be allowed to do:

  Error: writing blob: initiating layer upload to
  /v2/projectbluefin/utah-kernel-cache/blobs/uploads/ in ghcr.io:
  denied: installation not allowed to Write organization package

The build itself succeeded; the job failed at the final push, roughly 45
minutes in, discarding a correct result. Two fork PRs from different
contributors hit this: #158 and #157.

kernel_cache now exposes an `available` output and gates only the push behind
CAN_PUBLISH, leaving the build unconditional so a fork PR still builds and
validates the kernel. build_kernel requires kernel_cache.outputs.available so
nothing downstream consumes a cache that was never published.

@castrojo castrojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed diff: gates on dracut errors, Trivy RPM scanning, and Hummingbird GPG signatures. Currently has merge conflicts and fork kernel_cache write failures. Needs rebase by author.

@castrojo castrojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged latest main into branch: resolved conflicts in iso/live/Containerfile, packages/hummingbird.repo, and tests/test_iso_ci.py, regenerated skill catalog, and pushed update. Awaiting independent review.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at head 972ab60 (the dispatched SHA 3e14a7e was superseded by one reconciliation commit that fixed a then-failing test assertion).

intent-alignment

  • The PR body claims item 3 "enables gpgcheck=1" in packages/hummingbird.repo with gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-hummingbird-release. The diff does not touch that file, and main already ships gpgcheck=1 with gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release-2 (packages/hummingbird.repo:16-17). This PR only adds a test asserting pre-existing state — no signature-verification behavior changed.
  • The body also claims the skill catalog was regenerated; docs/skills/index.json/index.md are unchanged in the diff (harmless, since the index is built from frontmatter only, but the claim is inaccurate).

docs-currency

  • docs/skills/package-contract.md:102-103 (added by this PR) says signatures are verified "using Hummingbird's published release key (file:///etc/pki/rpm-gpg/RPM-GPG-KEY-hummingbird-release)". That path does not exist; the actual key is file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release-2 (Red Hat release key 2 — see packages/hummingbird.repo:10-17). The reconciliation commit fixed the same wrong path in tests/test_package_resolution.py but left the doc stale.

style

  • iso/live/Containerfile:69-71 now runs mkdir -p /var/roothome and then mkdir -m 0700 -p /var/roothome. The second call is redundant and -m 0700 has no effect on an already-existing directory, so the PR body's "0700" claim doesn't actually hold (benign — the dir is rmdir'd after the build).
  • New RepositoryPolicyTests.test_hummingbird_repository_enforces_gpg_signatures (tests/test_package_resolution.py:292-296) duplicates the stronger pre-existing test_hummingbird_packages_are_signature_checked (same file, L276-284), which also verifies the key file and its COPY into the image.

No findings from: correctness, security.

Confidence: 3/5 (needs attention) — 2 medium findings

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@Danathar

Copy link
Copy Markdown
Contributor

Two things here look like real defects rather than style. The Hive reviewer flagged both as well, but I reproduced them myself rather than taking that on faith.

1. The 0700 on /var/roothome never applies.

In iso/live/Containerfile the existing mkdir -p /var/roothome still runs immediately before the new mkdir -m 0700 -p /var/roothome. -m only applies when the directory is created, so once the first call has made it the second is a no-op and the mode stays at the default. I confirmed that locally:

$ mkdir -p /tmp/x/rh && mkdir -m 0700 -p /tmp/x/rh && stat -c '%a' /tmp/x/rh
755

Dropping the earlier line should be enough.

2. The GPG key path in the docs does not exist.

docs/skills/package-contract.md and the PR body both give gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-hummingbird-release. There is no such file in the tree. The key that is actually there, added in #133, is RPM-GPG-KEY-redhat-release-2.

Related: the PR says it enables gpgcheck for the Hummingbird repo, but packages/hummingbird.repo is not touched in this diff at all. So either the repo file change was meant to be here and got dropped, or the description is describing something that landed elsewhere.

Everything else in the dracut error gating and the Trivy RPM scanning reads fine to me. There is also a live merge conflict against current main, so this will want a rebase regardless.

@hivecommons-hive hivecommons-hive Bot added agent/ci-maintainer Filed or owned by the ci-maintainer agent. hive/hosted-projectbluefin-knuckle-gjvq labels Sep 22, 2026
@hivecommons-hive hivecommons-hive Bot changed the title fix(ci): gate on dracut errors, enable Trivy RPM scanning, and verify Hummingbird GPG signatures fix(ci): gate on dracut errors and enable Trivy RPM scanning Sep 22, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs-currency

  • The PR body claims the skill catalog was regenerated, but docs/skills/index.json is not in the diff. It carries per-skill last_updated stamps (e.g. desktop-contract at 2026-09-18), now stale for the three skills this PR edits (desktop-contract.md, local-testing.md, package-contract.md). Regenerate/update the catalog to match.

style

  • tests/test_iso_ci.py:187 (test_live_initramfs_gates_on_dracut_errors_and_prepares_roothome) restates the same Containerfile string assertions as the updated tests/test_package_resolution.py:286 (test_live_initramfs_build_fails_on_a_dracut_error): both check mkdir -m 0700 -p /var/roothome and the dracut\[E\] grep. The body notes a duplicate test was removed; this adds another overlapping pair — consider keeping the checks in one place.

Verified against head 3d9bdfe: the packages/hummingbird.repo gpgcheck/key claims in docs/skills/package-contract.md match the repo file (gpgcheck=1, RPM-GPG-KEY-redhat-release-2), the /etc/fedora-release relative symlink target in scripts/configure-branding.sh:74 is correct, and the dracut gate broadening plus sysloglvl=0 matches the intent of #132.

No findings from: correctness, security, intent-alignment.

Confidence: 3/5 (needs attention) — 1 medium finding; 1 perspective requested changes

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from correctness, security, intent-alignment, style, docs-currency.

Confidence: 5/5 (safe)

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.78

@Danathar

Copy link
Copy Markdown
Contributor

Re-checked after 3d9bdfe and 491ca0d (diffed against 972ab60, the head I reviewed). Both things I raised are fixed:

  1. iso/live/Containerfile now has one mkdir -m 0700 -p /var/roothome and no earlier plain mkdir, so the mode applies. mkdir -m 0700 -p /tmp/x/rh && stat -c '%a' /tmp/x/rh prints 700.
  2. docs/skills/package-contract.md now names packages/RPM-GPG-KEY-redhat-release-2, which is the file in the tree and the one packages/hummingbird.repo points at. The PR body now says gpgcheck was already on in main and is not part of this change.

Local run at 491ca0d: tests/test_iso_ci.py, tests/test_package_resolution.py, and tests/test_desktop_contract.py pass (94 tests).

I can't approve yet, for two reasons. The branch conflicts with main in docs/skills/index.json, docs/skills/local-testing.md, tests/test_desktop_contract.py, and tests/test_iso_ci.py. And because of that conflict, no CI has run on 3d9bdfe or 491ca0d. @mrbobbytables, please rebase onto main. I'll re-check once the build is green.

@hanthor hanthor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: PR is conflicting with no CI reported. Please rebase first, then address review findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent/ci-maintainer Filed or owned by the ci-maintainer agent.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: the image build logs errors nobody reads — dracut fails in the live initramfs, trivy cannot scan Hummingbird, signatures are never checked

4 participants