You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After PR #285, build/clean-stage.sh and build/copr-helpers.sh have BATS coverage. The other two build scripts do not, and cannot be unit tested as written:
build/00-image-info.sh (93 lines) — writes to hardcoded absolute paths:
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
OS_RELEASE="/usr/lib/os-release"
Untested logic worth covering: the IMAGE_FLAVOR derivation (nvidia vs main from a regex on IMAGE_NAME), the IMAGE_REF string used by bootc as the upgrade source, JSON field correctness, the VERSION vs UBLUE_IMAGE_TAG fallback for IMAGE_VERSION, and the VARIANT_ID guard that makes the os-release append idempotent. A malformed image-ref here silently breaks bootc upgrade for every user of the image.
build/10-build.sh (67 lines) — sources /ctx/build/copr-helpers.sh by absolute path and calls rsync, dnf5, systemctl, cp, find against /ctx and /usr. Untested behaviour: nullglob is enabled specifically so the custom/brew/*.Brewfile and custom/flatpaks/*.preinstall copies do not fail on empty matches — but cp with an unmatched glob under nullglob receives no source argument and fails anyway, which no test would currently catch.
Recommendation
Adopt the same prefix hook clean-stage.sh already uses (CLEAN_ROOT):
In 00-image-info.sh, introduce a defaulted prefix, e.g. IMAGE_ROOT="${IMAGE_ROOT:-/}", and build IMAGE_INFO/OS_RELEASE from it. Production behaviour is unchanged (prefix defaults to /); tests can point it at a temp dir.
In 10-build.sh, take the context dir from ${CTX_DIR:-/ctx} and the install prefix from ${BUILD_ROOT:-} so the copy/consolidate section can run in a sandbox with stubbed dnf5/systemctl/rsync.
Step 1 and 2 are production edits, so the quality agent is not opening a PR for them — a maintainer should make the hook change, after which the tests can be contributed.
Priority
Impact: high (image-ref and os-release correctness gate bootc upgrades)
Finding
After PR #285,
build/clean-stage.shandbuild/copr-helpers.shhave BATS coverage. The other two build scripts do not, and cannot be unit tested as written:build/00-image-info.sh(93 lines) — writes to hardcoded absolute paths:IMAGE_INFO="/usr/share/ublue-os/image-info.json"OS_RELEASE="/usr/lib/os-release"Untested logic worth covering: the
IMAGE_FLAVORderivation (nvidiavsmainfrom a regex onIMAGE_NAME), theIMAGE_REFstring used by bootc as the upgrade source, JSON field correctness, theVERSIONvsUBLUE_IMAGE_TAGfallback forIMAGE_VERSION, and theVARIANT_IDguard that makes theos-releaseappend idempotent. A malformedimage-refhere silently breaksbootc upgradefor every user of the image.build/10-build.sh(67 lines) — sources/ctx/build/copr-helpers.shby absolute path and callsrsync,dnf5,systemctl,cp,findagainst/ctxand/usr. Untested behaviour:nullglobis enabled specifically so thecustom/brew/*.Brewfileandcustom/flatpaks/*.preinstallcopies do not fail on empty matches — butcpwith an unmatched glob undernullglobreceives no source argument and fails anyway, which no test would currently catch.Recommendation
Adopt the same prefix hook
clean-stage.shalready uses (CLEAN_ROOT):00-image-info.sh, introduce a defaulted prefix, e.g.IMAGE_ROOT="${IMAGE_ROOT:-/}", and buildIMAGE_INFO/OS_RELEASEfrom it. Production behaviour is unchanged (prefix defaults to/); tests can point it at a temp dir.10-build.sh, take the context dir from${CTX_DIR:-/ctx}and the install prefix from${BUILD_ROOT:-}so the copy/consolidate section can run in a sandbox with stubbeddnf5/systemctl/rsync.tests/unit/00-image-info_test.batsandtests/unit/10-build_test.batsfollowing the stub-PATH pattern established in [quality] test: add BATS unit tests for build/clean-stage.sh and build/copr-helpers.sh #285.Step 1 and 2 are production edits, so the quality agent is not opening a PR for them — a maintainer should make the hook change, after which the tests can be contributed.
Priority
image-refandos-releasecorrectness gate bootc upgrades)Related
Filed by quality agent (hold-gated mode)
🐝 Hive Agent:
quality| Instance:hosted-projectbluefin-knuckle-gjvq| SHA:unknown— hive: agent=quality backend=copilot model=claude-opus-5