Skip to content

fix: pin clean-system to OS podman binary - #950

Merged
castrojo merged 3 commits into
mainfrom
copilot/fix-clean-system-selects-homebrew-podman
Aug 9, 2026
Merged

fix: pin clean-system to OS podman binary#950
castrojo merged 3 commits into
mainfrom
copilot/fix-clean-system-selects-homebrew-podman

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

bluefin-common PR

What does this change?

ujust clean-system no longer resolves podman from user PATH; it now invokes the OS-managed binary directly so Homebrew-installed Podman cannot hijack prune/list operations.

  • Recipe hardening
    • Updated clean-system in system_files/shared/usr/share/ublue-os/just/default.just to call /usr/bin/podman for image/volume list + prune.
  • Regression coverage
    • Added tests/test_clean_system_podman_path.bats to assert:
      • all clean-system Podman invocations are /usr/bin/podman
      • no unqualified podman remains in that recipe.
    • Wired the new test into just test in Justfile.
# before
podman image prune -af

# after
/usr/bin/podman image prune -af

Why?

Homebrew can place its own podman ahead of /usr/bin in PATH, causing clean-system to operate against the wrong runtime/storage context and fail for rootless users.

PR pipeline

opened ──▶ 4-review ──▶ approved ──▶ merged

A maintainer reviews and approves; merge goes through the merge queue.
Select blocked or hold to pause the work.

Checklist

  • PR title follows Conventional Commits (fix:, feat:, docs:, ci:, refactor:, etc.)
  • just check passes
  • pre-commit run --all-files passes
  • Skill doc updated if the change affects agent-facing conventions or behavior (see docs/skills/skill-improvement.md)
  • AGENTS.md / docs/SKILL.md / docs/skills/ links remain valid
  • CI is green after push: gh run list --repo projectbluefin/common --limit 5

AI attribution

If this PR includes AI-authored commits, include both trailers:

Assisted-by: <Model> via GitHub Copilot
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Original prompt

Fix #930: ujust clean-system selects Homebrew Podman from PATH

Read the issue in full, including every comment, before changing anything.
Reproduce the reported behaviour first and say how you reproduced it. If you
cannot reproduce it, say so plainly and stop rather than guessing at a fix.

Read AGENTS.md and CONTRIBUTING.md in this repository and follow them. This is
a toil-reduction change for an under-maintained project: repair what is broken
and finish what the project already decided to do. Do not add features,
dependencies, configuration surfaces, or architecture. Size the change so a
tired maintainer can review it in one sitting.

Run the repository's own existing validation before opening the pull request,
and paste the command you ran with its result in the pull request body. Do not
add a new test framework, linter, or build tool. If the only way to complete
the task is work that is out of scope, then a written finding with evidence is
the deliverable instead of a change.

Reference the issue number in the pull request body.

Co-authored-by: castrojo <1264109+castrojo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix clean-system selects Homebrew Podman from PATH fix: pin clean-system to OS podman binary Aug 7, 2026
Copilot AI requested a review from castrojo August 7, 2026 05:41
@castrojo castrojo added the 3-clanker-queue Work admitted to the agent-maintained queue. label Aug 7, 2026

@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.

LGTM. Matches the #930 acceptance criteria for the canonical common recipe:

  • All four Podman invocations in clean-system are now /usr/bin/podman (image ls, volume ls, image prune, volume prune), so Homebrew's podman earlier in PATH can no longer hijack prune operations and fail on rootless storage locks.
  • Hardcoding /usr/bin/podman is safe here — on bootc/ostree systems the OS-managed Podman is guaranteed at that path.
  • The new test_clean_system_podman_path.bats asserts both the positive (all four /usr/bin/podman calls) and the negative (no unqualified podman token, correctly anchored so /usr/bin/podman and the capitalized "Podman" in the gum prompt don't false-positive), and it's wired into just test in the Justfile.

Remaining follow-up (not this PR): #930 also calls for propagating the same fix to dakota's files/just-overrides/default.just — that needs a separate PR against projectbluefin/dakota.

CI: the validate failure is stale — it ran when the title was [WIP] ... and failed the Conventional Commits title check; the current title fix: pin clean-system to OS podman binary conforms. Test/build/E2E checks are all green.

@castrojo
castrojo marked this pull request as ready for review August 9, 2026 02:08
@castrojo
castrojo enabled auto-merge August 9, 2026 02:09
@castrojo
castrojo added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit f486748 Aug 9, 2026
9 checks passed
@castrojo
castrojo deleted the copilot/fix-clean-system-selects-homebrew-podman branch August 9, 2026 02:42

@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.

Approving. The diagnosis is sound and the fix is the minimal correct one.

Pinning to /usr/bin/podman is right for this failure mode specifically because the problem isn't "wrong binary" so much as "wrong storage context" — Homebrew's podman resolves a different containers/storage root, so image prune -af would happily report success while pruning nothing the user cares about. Absolute path is the only reliable fix; command -v wouldn't help since brew's is genuinely first in PATH.

The negative test is the valuable half:

run grep -Eq '(^|[[:space:]])podman[[:space:]]' <<< "${recipe}"
[ "${status}" -ne 0 ]

That correctly doesn't false-positive on /usr/bin/podman (the / fails the (^|[[:space:]]) anchor), so it genuinely catches a future unqualified call rather than just passing vacuously. Good.

Two non-blocking observations:

  • The Podman branch has no command -v guard, unlike the Docker branch immediately below it (if command -v docker >/dev/null 2>&1). Pre-existing, and fine in practice since podman ships in the image — but now that the path is hardcoded, a hypothetical image without it fails with a bare "No such file or directory" instead of being skipped. Worth a guard for symmetry if you're touching this again; not worth another round-trip here.
  • The awk recipe extractor runs to the next unindented line, so it also captures the Docker block. That's correct — the Docker block really is part of clean-system — just noting it's broader than the function name suggests, in case someone later assumes it's podman-only.

Docker isn't affected by the same hijack (brew doesn't ship a competing docker on these images), so leaving that branch alone is the right scope call.

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

Labels

3-clanker-queue Work admitted to the agent-maintained queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ujust clean-system selects Homebrew Podman from PATH

3 participants