test: bats coverage for read_rolling_pr_bump_label (FORGEJO_TEST_PR_LABELS hook) #122
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#122
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 e0c8 flagged at the v0.9.0 sprint approval (#121):
read_rolling_pr_bump_labelinscripts/release-decide.sh:352has no direct bats coverage. The function pre-existed the v0.9.0 sprint as untested (Forgejo API path; no test seam yet), but the namespace shiftbump:→bump/(closing #107) flipped it from "planned" to "live + load-bearing." The defense-in-depth multi-label fail-loud guard now rests on code-reading + the live exercise, not on a mutation-verified test.Proposed test seam
Add a
FORGEJO_TEST_PR_LABELSenv hook, mirroring the existingFORGEJO_TEST_PR_LOOKUP_FILEpattern fromforgejo_find_pr_by_merge_sha(Layer 2 tests). When set + the file exists,read_rolling_pr_bump_labelreads canned PR-list JSON from the file instead of calling the live Forgejo API.Test cases
bump/patchlabel on rolling PRBUMP_LEVEL=patch,BUMP_SOURCE=rolling_pr_labelbump/minorlabelBUMP_LEVEL=minorbump/majorlabelBUMP_LEVEL=majorbump/*labels (e.g., bump/patch + bump/minor on same PR)/separator (e.g.,priority/high)The multi-label fail-loud case is the most important to mutation-verify per Surveyor's framing — it's the belt-and-suspenders guard if Forgejo's exclusive-label semantics ever surprise us.
Why this came up now
The original
read_rolling_pr_bump_labelwas filed at v0.4.0 era as "planned" — never exercised in production. With #107 (v0.9.0) flipping it to live + load-bearing, the test gap becomes load-bearing too. Surveyor's substrate-state-care discipline: test-coverage should match the load-bearing weight of the code.Sequencing
bump/majorto a rolling PR). Surfaces any wiring gaps that static probes can't.Refs
scripts/release-decide.sh:352read_rolling_pr_bump_labelFORGEJO_TEST_PR_LOOKUP_FILEinscripts/lib/forgejo-api.sh:203(used by Layer-2 tests intests/release-decide.bats:359)