fix(internal): wrap angle bracket type references in changelog entries with backticks#13584
Merged
iamnamananand996 merged 7 commits intomainfrom Mar 17, 2026
Merged
Conversation
…kticks Sanitize changelog entries to wrap type references containing angle brackets (e.g. Optional<String>, Map<String, Object>) in inline code fences. This prevents MDX compilers from parsing these as unclosed HTML/JSX tags when changelogs are rendered in documentation sites. Changes: - Add sanitizeChangelogEntry utility for LocalTaskHandler path - Add sanitizeMarkdownEntry to writeChangelogEntries for seed path - Update BAML prompt to instruct AI to wrap angle brackets in backticks - Regenerate BAML client with updated prompt
|
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage. Once credits are available, reopen this pull request to trigger a review. |
Contributor
🤖 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:
|
…itize upgradeNotes
patrickthornton
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refs: Reported by customer —
Optional<String>and similar Java type references in auto-generated changelogs cause MDX compilation failures when changelogs are pulled into documentation sites, as MDX parsers interpret<String>as an unclosed HTML/JSX tag.This PR adds post-processing sanitization to wrap type references containing angle brackets (e.g.
Optional<String>,Map<String, Object>) in inline code fences (backticks) across both changelog generation paths.Changes Made
sanitizeChangelogEntryin@fern-api/core-utils— balanced-bracket parser that findsIdentifier<...>patterns and wraps them in backticks. Supports arbitrary nesting depth (e.g.Map<String, Map<String, List<Integer>>>). Splits on existing backtick spans to avoid double-wrapping.writeChangelogEntries.ts(seed path) — imports shared utility and applies it tosummary,added,changed,deprecated,removed,fixed, andupgradeNotesfields.LocalTaskHandler.ts(auto-versioning path) — sanitizes thechangelogEntryvia re-exported utility before it flows into the analysis object.prDescriptionis intentionally not sanitized — it flows to GitHub PR bodies (standard Markdown), not MDX.diff_analyzer.baml) — adds an instruction to the AI to wrap angle-bracket type references in backticks at generation time (defense in depth).sanitizeChangelogEntry.test.tscovering simple generics, nested generics (2- and 3-level), double-wrap prevention, multiple types per line, bare angle brackets, comparison operators, empty strings, and multiline entries.versions.yml— adds CLI version 4.31.2 entry.Human Review Checklist
Foo<Barwithout closing>), empty angle brackets (Foo<>), identifiers immediately adjacent to punctuation.<with a balanced>will match (e.g.a<b>in prose). Unlikely in real changelog text but worth noting./(`[^`]+`)/ghandles single-backtick code spans. Triple-backtick fenced blocks in changelog entries (unlikely but possible) would not be handled correctly.Testing
sanitizeChangelogEntry.test.ts(all passing viavitest)pnpm run check/biome check)Link to Devin session: https://app.devin.ai/sessions/423b9cc168b44b199e679cdd9c74adfc
Requested by: @iamnamananand996