Stop Generating Changelogs from Git Commits: How I Fixed the 'WHY' Problem in ChangelogBot
说明与用途
基于提交信息的自动化变更日志生成器产生噪声且缺乏原因说明。文章阐述了如何使用 ChangelogBot(利用 LLM 提取 "WHY")和受限并发的 GitHub API 调用,生成适用于大型仓库的清晰变更日志。
问题
Automated changelog generators that use raw git commit messages produce noisy, intent‑missing release notes, forcing consumers to hunt through PR history for context.
结果
By re‑engineering the metadata pipeline with bounded concurrency and explicit error handling, ChangelogBot now reliably generates clear, intent‑rich changelogs for large repositories without hitting GitHub rate limits or silently degrading CI output.
工作流
- Audit existing changelog for noise and lack of context
- Identify shortcomings of commit‑based changelog generators
- Introduce ChangelogBot to map commits to PRs and extract PR bodies
- Implement bounded concurrency (mapConcurrent) to avoid GitHub secondary rate limits
- Replace broad try/catch with explicit error handling to surface failures
- Run ChangelogBot against large production releases to validate robustness
- Publish improved changelog format to release page
证据
Generating release notes directly from raw git commits or PR titles is one of the most widespread anti‑patterns in modern DevOps.
The original commit resolver fetched pull request metadata for every commit in parallel… If a release contained 60 commits, this line fired 60 HTTPS requests to api.github.com in the exact same millisecond.
To prevent crashes, previous code wrapped API lookups in broad try/catch blocks and returned empty arrays on failure… CI exits 0, but changelog loses all PR context!
I avoided pulling heavy external dependencies like p-limit and instead implemented a native, lightweight bounded concurrency worker directly in TypeScript…
- 记录日期: 2026-11-03T17:14:03.993Z