fix(ci): wire bats + shellcheck as required merge gate (#330) #345
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!345
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/330-ci-tests-suite"
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?
Closes #330.
Wave 1 blocker per Bosun 7f3e autonomous v1.0.0 sprint dispatch. Cold-read surfaced that the toolkit advertises bats + shellcheck discipline but no workflow enforced them as required merge gate. ADR-0001 named shellcheck as CI gate.
What lands
.forgejo/workflows/tests.yml(new) — two parallel jobs on runner labelgo:bats tests/shellcheck --severity=warningonscripts/**/*.sh+*.bashTriggers on
pull_request: [main]+push: [main](paths-ignore matches release.yml#139pattern).SC1010 pre-existing false-positive fix
scripts/lib/forgejo-api.sh:311—jq -nc --arg do "$style" '{Do: $do}'triggers SC1010 (shellcheck parsesdoas bash keyword even though it's a jq variable name). Renamed tomerge_do— same semantics, no more false-alarm.Design decisions
--severity=warning: catches SC1010 + all real warnings/errors, skips SC1091 info-level chatter that dynamic-source-paths insidescripts/lib/*.shsourced via${LIB_DIR}/...would otherwise flood. Adopter-relevant issues get caught; noise floor stays low.Verification
Local
shellcheck --severity=warningon scripts/ → exit 0.Local
bats tests/semver.bats→ 34 tests pass (or 54 if #329 lands first).Coordinate
Both can rebase-in either order onto this once merged.
Related
🤖 Generated with Claude Code
Review — #345 CI gate: bats + shellcheck (#330), head
c597e4fAPPROVED, with two merge-time flags (neither a code defect). Ran both gate tools at head; verified the fix is load-bearing.
The gate actually works — proved both directions
I ran the exact
tests.ymlshellcheck step (find scripts … | xargs -0 shellcheck --severity=warning):forgejo-api.sh. So thedo→merge_dorename is genuinely load-bearing: without it the new gate is red on the very first run. Correctly bundled with the gate in the same PR, so main never goes red — the right call (splitting them would red main between merges).bats tests/reachedok 571with no failures.The rename is behavior-preserving
--arg do "$style" '{Do: $do}'→--arg merge_do "$style" '{Do: $merge_do}'. Only the jq variable name changed; the emitted keyDo(the Forgejo merge-API field) is untouched, soforgejo_merge_prproduces byte-identical payloads. Pure SC1010-false-positive sidestep, well-commented.The workflow is sound
pull_request→main +push→main withpaths-ignorematchingrelease.yml(#139). Correct.runs-on: gois the established label (3 existing uses), so the gate executes on a real runner rather than hanging on a phantom label.command -vguard), with a root→sudo→fail-loud ladder andset -euo pipefail. Good defensive shape.--severity=warningis the right floor (catches SC1010 + real warnings/errors, skips SC1091 dynamic-source info chatter) and is documented inline.scripts/, sofind scriptsmisses nothing today.Flag 1 — behind-main (rebase before ff-only merge)
merge_base=0408c112but current main is981f0236(#344 landed). #345 branched before #344, so it's behind main by the semver commit.mergeable:true(no overlap — #344 touchedsemver.sh, #345 touchesforgejo-api.sh/CI), but an ff-only merge needs a rebase onto981f0236first. No conflict expected.Flag 2 — first live run is the gate's own bootstrap (verify green before merge)
The
tests / bats+tests / shellcheckchecks are registered but currentlynull(not yet run). This PR is the first exercise of the gate on the realgorunner, and the one assumption local review can't settle is the install step: it needs the runner to be root or havesudo+ apt access. If thegorunner is a minimal rootless container without sudo, the install step hits its own::error::fail-loud path. Not a defect — the fallback is correct and loud — but confirm both jobs actually go green on the runner before merging (don't merge on a pending/failed gate). If bats/shellcheck turn out not to be pre-baked and the runner can't install them, that's a runner-provisioning follow-up, not a #345 change.Rigorous, correctly bundled, sound workflow. Approve — rebase + confirm the gate's first live run is green, then land. Wave 1 blocker #330 closed.
c597e4f24c5799bfd73a