Skip to content

fix(ci): get dev green — a host-dependent test, unchecked errors, and gofmt - #14

Merged
hanthor merged 3 commits into
devfrom
fix/upstream-ci-green
Jul 31, 2026
Merged

fix(ci): get dev green — a host-dependent test, unchecked errors, and gofmt#14
hanthor merged 3 commits into
devfrom
fix/upstream-ci-green

Conversation

@hanthor

@hanthor hanthor commented Jul 30, 2026

Copy link
Copy Markdown
Member

dev is currently red on lint and unit-tests, which makes CI unreadable on every PR against it — a new PR looks broken whether or not it is. Three unrelated causes, none of them new.

1. A test that asserts a property of the host, not the code

TestSelectStorageDriver_NonComposefs asserted driver == "vfs" on the premise stated in its own comment — "/tmp is usually tmpfs". That is true on a developer box and false on your CI runners, where /tmp lives on the ext4 root and overlay is the correct answer:

storage_driver_test.go:14: non-composefs driver = "overlay", want vfs

TestOverlayCandidate_UnsafeFilesystems, directly below it, already guards for exactly this with a t.Skipf; this test never got the same treatment.

I did not fix it by skipping. Skipping when /tmp is not tmpfs would leave CI — precisely the environment where /tmp is not tmpfs — asserting nothing at all, which is where the regression risk actually lives. Instead it detects the filesystem and asserts the branch that applies:

  • on tmpfs/overlayfs, vfs is mandatory (those cannot back overlay)
  • on anything else, the driver must be one of overlay/vfs and carry a non-empty reason, because whether podman can set up overlay there is genuinely environment-dependent and both answers are correct

2. errcheck — five unchecked error returns

Four filepath.Walk calls in internal/slurp and one exec.Cmd.Run in bootc.go. Every one is genuinely best-effort:

  • the Walk callbacks already swallow per-entry errors, and a partial size/count is the intended result
  • the Run is an unmount inside a defer, where a failure has no remedy and must not change the install's outcome

So the fix is _ = rather than error propagation — the behaviour was already correct, it just was not stated. Each has a comment saying why discarding is right, so the next reader doesn't have to re-derive it.

3. gofmt -s

Mechanical across internal/. No behaviour change.

Verification

go build ./..., go vet ./internal/..., and the affected package tests all pass. No production logic changed.

Why this is separate from #13

#13 (the ext4 verity fix) is a real behaviour change and deserves to be read on its own. This PR only makes dev green so that #13 — and anything else — can be judged on its own CI rather than inheriting a red baseline. Merging this first makes #13's run meaningful.

Two failures I did not touch, because they do not reproduce in your CI: TestBuildSelinuxBypassShim_InterceptsSecuritySelinux and TestBootcInstall_NonComposefsContainerExportsOCI both fail on my local machine against unmodified dev but pass on your runners. They look environment-dependent in the opposite direction, and are worth a separate look rather than a speculative fix from me.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VvyH2muGbDWLmmmtrPNkwG

hanthor added 3 commits July 30, 2026 23:25
… gofmt

dev is currently red on lint and unit-tests, which blocks reading CI on any PR
against it. Three unrelated causes, none of them new:

1. TestSelectStorageDriver_NonComposefs asserted `driver == "vfs"` on the
   premise, stated in its own comment, that "/tmp is usually tmpfs". That is a
   property of the HOST, not of the code. It holds on a developer box where
   /tmp is tmpfs and fails on CI runners, where /tmp is on the ext4 root and
   overlay is the correct answer:

       storage_driver_test.go:14: non-composefs driver = "overlay", want vfs

   TestOverlayCandidate_UnsafeFilesystems right below it already guards for
   exactly this; this test never got the same treatment. Rather than skip when
   /tmp is not tmpfs — which would leave CI, the environment where /tmp is NOT
   tmpfs, asserting nothing at all — it now detects the filesystem and asserts
   the branch that applies: vfs is mandatory on tmpfs/overlayfs, and elsewhere
   the driver must be one of overlay/vfs with a non-empty reason.

2. errcheck: five unchecked error returns. Four filepath.Walk calls in
   internal/slurp and one exec.Cmd.Run in bootc.go. All are best-effort — the
   Walk callbacks already swallow per-entry errors and a partial size/count is
   the intended result, and the Run is an unmount inside a defer where a
   failure has no remedy and must not change the install's outcome. Discarded
   explicitly with `_ =` so the intent is visible rather than accidental.

3. gofmt -s across internal/. Mechanical, no behaviour change.

No production logic changes. go build, go vet, and the affected package tests
all pass.
… gofmt

Second pass. The first commit fixed errcheck and internal/ gofmt; unit-tests
went green and lint surfaced the rest, which my earlier reading of the log had
truncated rather than the run having changed. For the record the baseline was
already 15 nilerr, 5 errcheck, 5 gofmt, 1 unused before any of this — none of
it introduced here.

nilerr (15 sites): every one is intentional, and every one already carried an
inline comment saying so.

  - internal/post: "no icons dir, skip", "no bluetooth data — nothing to do",
    "no NM connections — nothing to do", and similar. These copy OPTIONAL
    material into the target; the absence of a source is not an install
    failure, and propagating the error would abort an install over a missing
    Bluetooth directory.
  - internal/slurp: returns inside filepath.Walk callbacks, where `return nil`
    means "skip this entry and keep walking". A partial scan/migration is the
    designed outcome, not a swallowed bug.

Annotated with //nolint:nilerr and the reason rather than restructured: the
behaviour is correct, it simply was not stated in a form the linter can read.
Each directive carries the why, so the next reader does not have to re-derive
it from the surrounding code.

writeStorageConfWithTmpDir is unreferenced. It arrived in e6ea536 and was
orphaned by 74993bb, which replaced that approach with a two-stage export.
Suppressed rather than deleted — removing code from a path that exists to work
around a live-ISO ENOSPC failure is a maintainer call, not a lint fix. If it is
genuinely dead, deleting it beats the directive, and that is a one-line follow-up.

Also gofmt -s on cmd/, which the first pass missed by only covering internal/.

go build, go vet, gofmt -s and the affected package tests all pass.
…t build`

With lint and unit-tests green, the VM matrix finally ran — and every job in
it, required and advisory alike, failed identically:

    /tmp/justHS63lX/build: line 67: go: command not found
    error: Recipe `build` failed with exit code 127

The cause is step ordering. actions/setup-go installs the toolchain into
/opt/hostedtoolcache, and the very next step runs jlumbroso/free-disk-space
with tool-cache: true, which deletes that directory. Go was being installed and
then thrown away before anything could use it.

This was never observed because lint and unit-tests were failing first, so the
whole matrix was skipped on every run. Fixing those two exposed a second,
entirely separate pre-existing breakage underneath.

Moving the cleanup ahead of setup-go fixes it and is strictly better than
setting tool-cache: false: the jobs still reclaim the full ~30 GiB they need
for multi-GB OCI pulls and a target loop disk, and Go survives because it is
installed after the sweep rather than before it.

Applied to both vm-boot-required and vm-boot-advisory, which had the same
ordering.
@hanthor

hanthor commented Jul 30, 2026

Copy link
Copy Markdown
Member Author

Status: lint and unit-tests are green. The VM matrix is a separate, deeper problem — and I think #11 is its fix.

Fixed here (all pre-existing on dev, none introduced by this branch):

before now
lint fail — 15 nilerr, 5 errcheck, 5 gofmt, 1 unused pass
unit-tests fail — TestSelectStorageDriver_NonComposefs pass
VM matrix skipped (gated behind the two above) runs, fails — see below

Making those green exposed a second breakage that had never been observed, because the matrix was skipped on every run while lint/unit-tests were red. Every VM job — required and advisory — died identically:

/tmp/justHS63lX/build: line 67: go: command not found
error: Recipe `build` failed with exit code 127

actions/setup-go installs into /opt/hostedtoolcache; the very next step ran jlumbroso/free-disk-space with tool-cache: true, which deletes that directory. Go was installed and immediately thrown away. Fixed by moving the cleanup before setup-go in both matrix jobs — better than tool-cache: false, since the jobs still reclaim the full ~30 GiB they need for multi-GB OCI pulls.

What remains, and why I stopped

With the build fixed, the jobs now get 4–9 minutes in (vs ~3 failing at build) and fail in the actual test:

level=fatal msg="initializing source containers-storage:[overlay@/var/lib/containers/storage+/run/containers/storage]
  ghcr.io/tuna-os/fisherman/centos-bootc:ssh-enabled: reference ... does not resolve to an image ID"
fisherman: fatal: bootc install: exporting image to OCI layout: skopeo copy: exit status 1

The image itself exists and is pullable from ghcr — I checked. The failure is that the qualified containers-storage:[driver@graphroot+runroot] reference does not resolve in the store the image actually landed in.

That is precisely what #11 describes: "the image pull succeeds into redirected, disk-backed Podman storage, but OCI export must address that exact store" — and it touches bootc.go and storage_driver.go, the exact code in this traceback. It has been open since 2026-07-17, and its own description notes the full installer suite was environment-blocked locally, with E2E as the intended validation.

So I have deliberately not attempted to fix this. Reimplementing an open PR of someone else's to chase a green tick would be the wrong move, and #11 landing first is very likely the real answer — at which point this branch's matrix becomes the validation #11 has been waiting for.

Also worth noting: TestBootcInstall_NonComposefsContainerExportsOCI fails on my machine against unmodified dev and passes on your runners. #11 adds bootc_internal_test.go covering this same export path, which fits the pattern.

Suggested order: merge this (it is self-contained, changes no production logic, and makes CI readable), then #11, then #13 — whose own run is currently meaningless against a red baseline.

@hanthor
hanthor merged commit 471b4f6 into dev Jul 31, 2026
3 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant