Skip to content

fix(generator-cli): fall back to PR description when FAI changelog entry is empty - #17763

Open
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1789582773-autoversion-changelog-fallback
Open

devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1789582773-autoversion-changelog-fallback

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Description

Linear ticket: N/A

AutoVersionStep writes a changelog.md block for every MAJOR/MINOR bump using analysis.changelogEntry from FAI. FAI occasionally returns a bump with a populated pr_description / version_bump_reason but an empty changelog_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 via withChangelogFallback:

if changelogEntry has text || versionBump === "PATCH" -> undefined (no change)
else first non-empty of [prDescription, versionBumpReason, commitMessageBody(message)] (trimmed)

commitMessageBody is the conventional-commit body (everything after the subject line) with a trailing 🌿 Generated with Fern trailer 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). analyzeChunks picks 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 pure aggregateChunkAnalyses(chunks) that tracks each entry's bump level; if no entry exists at the winning (MAJOR/MINOR) level, the winning chunk's versionBumpReason is prepended to the entries before consolidation.

Changes Made

  • packages/generator-cli/src/pipeline/steps/AutoVersionStep.ts: withChangelogFallback, resolveChangelogEntryFallback(+ source-tracking variant), commitMessageBody, aggregateChunkAnalyses; analyzeChunks now delegates to it. FAIAnalysis exported for tests.
  • packages/generator-cli/changes/unreleased/fix-empty-changelog-entry-fallback.yml: changelog entry (fix).
  • Updated README.md generator (not applicable)

Testing

  • Unit tests added: 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-warnings and biome format clean on touched files.
  • Manual testing completed

Link to Devin session: https://app.devin.ai/sessions/403232e0a3414177b88c12a6cfbbefc2
Open in Devin Desktop: https://app.devin.ai/desktop/session/403232e0a3414177b88c12a6cfbbefc2?variant=devin


Devin Review

…try is empty

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/generator-cli/src/pipeline/steps/AutoVersionStep.ts
Comment thread packages/generator-cli/src/pipeline/steps/AutoVersionStep.ts Outdated
…er only at end of message

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread packages/generator-cli/src/pipeline/steps/AutoVersionStep.ts Outdated
… chunk has no entry

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

1 participant