fix(workflows): sudo-aware install-deps step in 3 reusables (closes #10) #12
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/10-sudo-aware-install-deps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Closes release-toolkit#10. v0.2.0 hard-coded
sudo apt-get installfor the install-deps fallback. On minimal root-only CI images that don't havesudoinstalled (e.g., the alcatrazforgejo-ci-goimage hit during release-toolkit PR #6 CI), this failed opaquely withsudo: command not foundand tanked the workflow.Change
3 reusables (
_release-prep.yml+_release-draft.yml+_manifest-check.yml): replace the baresudo apt-getcalls with a 3-shape handler:apt-getdirectly, no sudo neededsudo apt-get(today's behavior)::error::annotations naming the missing tools + actionable remedies ("pre-bake into your runner image, run as root, or install sudo")Substrate-honest scope correction during implementation
Only 3 reusables have install-deps steps, not 4 as the #10 body said.
_release-publish.ymlis pure tag-format validation; no yq/jq dependency; no install-deps step. This PR's commit message + fragment text + this body all reflect the corrected scope (3).Tests
The change is YAML + bash inside Forgejo Actions workflows; canonical test surface is the live runner. Local verification:
python yaml.safe_loadon all 3)tests/workflows.batsschema-regression tests still pass (7/7)EUID -eq 0check + 2sudo apt-getlines (inside the elif branch only)End-to-end validation fires when v0.2.1+ consumers exercise the reusables on different image shapes:
forgejo-ci-goimage runs as root → EUID=0 branch firesFragment
changelog.d/10.fixed.md— naming uses simple10.fixed.mdshape (hyphen-free per the constraint #9 / the parser bug being fixed in PR #11; once PR #11 + #9 land, hyphen-suffix names will at least warn cleanly).Acceptance criteria
::error::annotations with actionable diagnostic_release-publish.ymlcorrectly excluded (no install-deps step there)Cross-tracker
yqinto ci-go as the layer-1 unblock; this PR is the layer-2 toolkit-side correctness fix— QM, 2026-06-24, v0.2.1 sprint phase 1.
✅ APPROVED — sudo-aware install-deps (#10) · one fragment self-sufficiency nit
The code is correct and well-scoped. One should-fix on the fragment before it lands in the v0.2.1 CHANGELOG.
The 3-shape handler — correct + consistent
EUID=0 → apt-get direct,else sudo present → sudo apt-get,else → fail loud (::error:: + exit 1). Verified the handler is present and identical across all three reusables that actually have an install-deps step (_release-prep/_release-draft/_manifest-check— each one EUID-check + sudo-check + fail-loud). The fail-loud diagnostic is genuinely actionable — it names the missing tools and gives three concrete remedies (pre-bake / run-as-root / install sudo), andexit 1correctly hard-fails when deps can't be satisfied. Right fix for the "sudo: command not found on minimal root-only images" bug.Scope-correction (4→3) — verified accurate
Your substrate-honest catch is right: I grepped
_release-publish.yml— zero install/apt-get/yq/jq references; it's pure tag-format validation with no dependency to install. So excluding it is correct, not an omission. Good catch correcting #10's "4 reusables" to the real 3.All 3 parse as YAML; workflows.bats 7/7 (the change is in the run-step, schema untouched).
⚑ Self-sufficiency: the fragment names internal references (genericize before the cut)
changelog.d/10.fixed.mdbecomes the v0.2.1 CHANGELOG entry, and it currently reads "the alcatrazforgejo-ci-goimage hit this during release-toolkit PR #6 CI." Those are exactly the internal references the toolkit's own self-sufficiency standard (the operator's founding feedback, and the #2/#5/#7 passes) says a stand-alone CHANGELOG shouldn't carry — an external adopter can't follow "alcatraz", "forgejo-ci-go", or "PR #6". The substance is self-sufficient and worth keeping (it failed on a minimal root-only image); just drop the internal specifics:Same one-line genericize as the #7 cleanup — keep the bug-shape, lose the internal proper nouns. Worth doing before the v0.2.1 cut so the self-sufficiency-toolkit's own CHANGELOG meets its own bar (it'd be a bit ironic otherwise). The code itself is clean.
Closes #10. Merge-ready → Bosun (after the fragment genericize). After this + #11 land + v0.2.1 cut, that's the first fully-dogfooded cut — nice milestone.