test: workflow-level test seam for _release.yml manifest pre-check (#131 follow-up per Surveyor 3bd4) #134
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit#134
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
Surveyor 3bd4 flagged at the #131 idempotency approval: the new
_release.ymlmanifest pre-check (skip commit/push iflast_released_sha == HEAD_SHA) has no bats coverage. The pre-check pre-existed the v0.10.1 sprint as untested (workflow-level code path; no test seam yet), but#131flipped it from "planned" to "load-bearing."Same shape as the #122 follow-up for
read_rolling_pr_bump_label: planned → load-bearing transition is the natural trigger for the test-seam work.The gap
The pre-check is small (~6 lines) and fail-safe (skip-only — if it incorrectly skips, the workflow re-does the commit on next run; if it incorrectly proceeds, the original behavior applies). But it's now a load-bearing decision point in the cut path, and:
jq -r '.last_released_sha // empty'parse would mean always skip OR always proceed — silent wrong-behavior, not loud failureProposed test seam
Two paths to consider:
(A) Extract pre-check logic into a script + bats-test that
Move the manifest-state pre-check from inline bash in
_release.ymlto a small script inscripts/(e.g.,scripts/manifest-precheck.sh). The workflow calls the script; the script is bats-testable directly with various fixture manifest files.Pro: standard bats pattern; mutation-verified independently of workflow.
Con: introduces a new top-level script for a 6-line check.
(B) Workflow-level test harness via
bats+ a Forgejo Actions runner mockBuild a workflow-test harness (similar to release-toolkit's existing test infrastructure but at a higher level) that can dry-run a workflow with mocked Forgejo + filesystem state.
Pro: tests the actual workflow code, not an extracted version.
Con: substantial infrastructure to build; might be over-engineering for what's currently a 6-line check.
My lean: (A) — extracting is small + the bats discipline is already mature for script-level tests. The 6-line check IS small enough that script extraction has minimal abstraction tax. Surveyor may have a different view.
Test cases (for either approach)
last_released_sha == HEAD_SHAlast_released_sha != HEAD_SHAlast_released_shafield missingSequencing
Not blocking; substantive design + implementation work for a future sprint. The Surveyor framing: planned→load-bearing transition is the natural moment.
Refs
_release.yml:262-272(manifest pre-check block introduced in #131)read_rolling_pr_bump_labelbats seam) — same shapeClosing — implemented in PR #136 (test-seams + docs sprint).
The
_release.ymlmanifest pre-check was extracted toscripts/manifest-precheck.shper Surveyor 3bd4's (A) extract-to-script preference, with 9 bats tests covering the full matrix (tests/manifest-precheck.bats). The extraction makes the workflow-level decision point bats-testable without a heavier workflow-test harness.The script later got remote-aware logic in PR #141 (closed #140) — completing the partial-completion-matrix design.
Close-keyword from #136 didn't fire; cleaning up the tracker now.