fix(list_fragments): FAIL-LOUD on unknown-kind fragments (silent content-loss class — Surveyor d586) #170
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#170
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?
The phenomenon
Surveyor d586 §6 verify-at-source on rolling PR #165 surfaced two mis-named fragments:
changelog.d/153.feat.md(kind:feat)changelog.d/164-fix-self-pin.fix.md(kind:fix)These use conventional-commit TYPES (
feat/fix) as the kind, but the fragment convention wants changelog KINDS (added/fixed). Whenlist_fragmentsencountered them:The fragments were silently dropped from the CHANGELOG build +
delete_fragmentsleft them on disk (because the deletion glob also goes through the same kind-validation).Why it didn't break v0.12.0
Pure luck: the
feat:+fix:COMMITS independently contributed the CHANGELOG entries (### Addedfrom the conventional-commit type,### Fixedfrom same). So the rolling PR's body looked correct. The fragments contributed NOTHING.The CHANGELOG was right by backstop, not by fragment-fold. Empirically demonstrated by inspecting the rolling PR's body (
### Added: auto-prune...matches the feat: commit;### Fixed: prune-rc-tags...matches the fix: commit).The deeper risk (the real reason to file)
warn-and-skipon unknown-kind is a silent content-loss class:changelog.d/alone) would be SILENTLY dropped if its kind has a typoThe v0.12.0 case is the benign version (commit-backed); the future cases where someone writes
.feature.mdinstead of.added.md(typo) or.feat.mdinstead of.added.md(cross-convention confusion) lose content silently.The fix
Replace
warn-and-skipwithfail-loudon unknown-kind:list_fragments(scripts/lib/fragments.sh) emits an error to stderr + exits non-zero when it encounters an<id>.<kind>.mdfilename where<kind>isn't in the known set (added,changed,deprecated,removed,fixed,security)release-prep.shpropagates the non-zero exit → the rolling PR build fails red → the operator sees the failure surface before mergeBats coverage:
feat(or any other not-in-set) → fragments.bats reds at the lint test<id>.<kind>.mdshape (e.g.,99.added.md) still get picked up + folded normallyComposition
What this PR will NOT do
added/changed/deprecated/removed/fixed/securityper Keep-a-Changelog convention)Refs
scripts/lib/fragments.shlist_fragmentsfunction (the change site)