fix(generator-cli): fall back to PR description when FAI changelog entry is empty - #17763
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
…try is empty Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
AI Review Summary
Adds a fallback so empty FAI changelog entries for MAJOR/MINOR bumps reuse the PR description, bump reason, or commit body. Logic is clean and well tested; main nits are a slightly misleading warning message and a possible FERN_TRAILER replace assumption.
- 🔵 2 suggestion(s)
This review is complete for the current scope. Addressing all critical and warning findings above satisfies the review; suggestions are optional. Request another review only if subsequent changes introduce new behavior or materially expand the pull request's scope.
…er only at end of message Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… chunk has no entry Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Description
Linear ticket: N/A
AutoVersionStepwrites achangelog.mdblock for every MAJOR/MINOR bump usinganalysis.changelogEntryfrom FAI. FAI occasionally returns a bump with a populatedpr_description/version_bump_reasonbut an emptychangelog_entry, which produced a version-only changelog block with no description of the (often breaking) change.Two fixes:
1. Whole-analysis fallback. A pure
resolveChangelogEntryFallback(analysis)helper is applied at the top of both bump paths viawithChangelogFallback:commitMessageBodyis the conventional-commit body (everything after the subject line) with a trailing🌿 Generated with Ferntrailer stripped. A warning naming the fallback source is logged when it is used. PATCH bumps are left alone since they never carry a changelog entry.2. Chunked-analysis gap (flagged by Devin Review).
analyzeChunkspicks the highest bump across chunks but collects entries from every chunk, so a MAJOR chunk with an empty entry plus a MINOR chunk with text yielded a non-empty aggregate that omitted the breaking change — and fix 1 never fired. The aggregation is extracted into a pureaggregateChunkAnalyses(chunks)that tracks each entry's bump level; if no entry exists at the winning (MAJOR/MINOR) level, the winning chunk'sversionBumpReasonis prepended to the entries before consolidation.Changes Made
packages/generator-cli/src/pipeline/steps/AutoVersionStep.ts:withChangelogFallback,resolveChangelogEntryFallback(+ source-tracking variant),commitMessageBody,aggregateChunkAnalyses;analyzeChunksnow delegates to it.FAIAnalysisexported for tests.packages/generator-cli/changes/unreleased/fix-empty-changelog-entry-fallback.yml: changelog entry (fix).Testing
packages/generator-cli/src/__test__/autoversion-changelog-fallback.test.ts(10 cases covering both helpers) — all pass.pnpm turbo run compile --filter @fern-api/generator-cli,biome lint --error-on-warningsandbiome formatclean on touched files.Link to Devin session: https://app.devin.ai/sessions/403232e0a3414177b88c12a6cfbbefc2
Open in Devin Desktop: https://app.devin.ai/desktop/session/403232e0a3414177b88c12a6cfbbefc2?variant=devin