Skip to content

fix: link-aware truncation in changelog parser (#11)#14

Merged
justi merged 2 commits into
mainfrom
fix/issue-11-url-truncation
May 9, 2026
Merged

fix: link-aware truncation in changelog parser (#11)#14
justi merged 2 commits into
mainfrom
fix/issue-11-url-truncation

Conversation

@justi
Copy link
Copy Markdown
Owner

@justi justi commented May 9, 2026

Summary

  • Replace hard 140-char cut with link-aware _truncate_safe helper
  • Strip any unclosed [label](url or [label left at the tail after truncation
  • Apply to both code paths: _parse_changelog_content (bash) and fetch_github_release_notes (jq)

Closes #11.

Test plan

  • New tests/test_github_truncate.sh — 9 cases covering the helper unit + integration through _parse_changelog_content
  • Full bash suite green: 13 test files, 169 cases, 0 regressions

Before / after

For avo (3.20.1) first bullet, where the link extends past the 140-char budget:

- 3.20.1: fix: keep filter value when using fetch values from @Paul-Bob ([avo-dynamic_filters #91](https://github.com/avo-hq/avo-dynamic_filters/pull/; refactor: ...
+ 3.20.1: fix: keep filter value when using fetch values from @Paul-Bob; refactor: ...

The dangling [avo-dynamic_filters #91](https://github.com/avo-hq/avo-d... is gone — the ; refactor join is clean.

Notes

  • No version bump in this PR — leaving release packaging to the maintainer.
  • The 140-char budget itself is unchanged. Only the cut location is now markdown-aware.

🤖 Generated with Claude Code

justi and others added 2 commits May 9, 2026 02:55
Hard 140-char cut on changelog bullets landed inside `[label](url)`,
producing broken markdown that confuses LLM consumers of the generated
doc. After the cut, strip any unclosed `[label](url` or `[label` at the
tail.

Applied to both code paths:
- `_parse_changelog_content` (raw CHANGELOG.md, bash)
- `fetch_github_release_notes` (GitHub Releases API, jq)

Closes #11

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codex review of #14 flagged that nested CommonMark labels like
`[outer [inner](u1)](url` aren't fully cleaned by the flat regex.
Real fix needs a markdown-aware parser; in practice release notes
use flat links. Document as a known limitation and track as
follow-up rather than ship a half-baked nesting heuristic.

Add two boundary cases (exact-140 input, empty input) for cheap
robustness coverage.
@justi justi merged commit 1b9e60e into main May 9, 2026
2 checks passed
@justi justi deleted the fix/issue-11-url-truncation branch May 9, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] URL truncation in changelog parsing produces broken markdown links

1 participant