fragments: kind-parser silently drops fragments with hyphens in id #9
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#9
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?
Symptom
A fragment named
<id-with-hyphen>.<kind>.md(e.g.,3.fixed-2.mdwhere the author intendedid=3,kind=fixedwith-2as a multi-fragment-per-id suffix) is silently dropped duringcategorize_fragments— never makes it into the CHANGELOG or release notes.Empirical reproduction (caught during v0.2.0 cut, 2026-06-24)
I named two fragments for v0.2.0:
3.fixed.mdand3.fixed-2.md. After firingrelease-prep.sh --bump minor:3.fixed.md→ correctly emitted to CHANGELOG, deleted from disk ✓3.fixed-2.md→ NOT emitted, NOT deleted, silently skipped ✗Verified the cause via
source scripts/lib/fragments.sh; fragment_kind_from_path "changelog.d/3.fixed-2.md"→ returned 1 (rejection).Root cause
scripts/lib/fragments.sh::fragment_kind_from_path:For
3.fixed-2.md, the last dot-segment isfixed-2, notfixed. Sincefixed-2isn't inFRAGMENT_KINDS, the function returns 1 and the fragment gets silently skipped bylist_fragments/categorize_fragments/delete_fragments/determine_bump_from_fragments.Impact
<id>.<kind>.mdbut accidentally adds a hyphen-then-something between kind and.mdgets a fragment that's invisible to the toolkit — never emitted, never deleted, never warned about. Pure substrate-of-record corruption.<id>was framed as "free-form, but expected to sort sensibly" — hyphens in<id>are natural, but no rule says hyphens MIDWAY through the basename break parsing.Proposed dispositions
(A) Strict parsing + loud warning on unrecognized basenames (v0.2.1 patch)
list_fragmentsshould LOG a warning to stderr for*.mdfiles that don't parse as valid fragments (instead of silently skipping). Operator sees "warning: changelog.d/3.fixed-2.md does not match<id>.<kind>.md(unknown kind 'fixed-2')" and can rename or remove before cut.Doesn't change parsing semantics; just makes the failure visible. Smallest blast-radius fix; covers the immediate "silent data loss" hazard.
(B) Smarter kind matching: scan from KNOWN kinds, not from last dot-segment (v0.3 minor)
Parse the basename by iterating over
FRAGMENT_KINDSand checking for any.<kind>.mdsuffix match (with optional.<suffix>after). Would accept:3.fixed.md→ id=3, kind=fixed3.fixed-2.md→ id=3, kind=fixed, sub-suffix=-23.fixed.also.md→ id=3, kind=fixed, sub-suffix=.alsoMore forgiving authoring + supports multi-fragment-per-id naturally.
(C) Both: ship (A) in v0.2.1 + (B) in v0.3
(A) closes the silent-data-loss hazard immediately + buys time to design (B) properly.
My lean
(C) — (A) is a small patch worth shipping fast; (B) is a substrate-care surface-expansion worth taking the time to get right.
Cross-tracker
a521998on release-prep/v0.2.0 branch— QM, 2026-06-24, surfaced during v0.2.0 cut.
forgejo-actions referenced this issue2026-06-24 18:48:03 +02:00
chore:vsfeat:for internal-infrastructure commits #14