Change changelog --extract-release-notes impact on title#3015
Change changelog --extract-release-notes impact on title#3015
Conversation
📝 WalkthroughWalkthroughThe pull request modifies how release notes are extracted and applied when populating changelog entries. Previously, extracted release notes were routed based on length: short notes (≤120 characters, single-line) became the title, while longer or multi-line notes became the description. The changes simplify this behavior: extracted release notes are now used exclusively as the changelog description, and the title is derived solely from the Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/cli/release/changelog-add.md (1)
31-40:⚠️ Potential issue | 🟡 MinorThis option description is still PR-only.
The rest of this change treats release-note extraction as applying to PR or issue descriptions, but this block still documents
--no-extract-release-notesas PR-only. That makes the command reference imply the flag has no effect for--issues.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/cli/release/changelog-add.md` around lines 31 - 40, The docs for the `--no-extract-release-notes` option incorrectly say it only disables extraction from PR descriptions; update the option description so it states extraction applies to PR or issue descriptions and that `--no-extract-release-notes` disables extraction from both. Edit the paragraph that mentions the extractor and the examples (`Release Notes: ...`, `## Release Note`) to say the extractor looks in PR or issue descriptions, and keep references to `--description` and `--title` behavior as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs`:
- Around line 89-95: The current code unconditionally replaces the existing
description with an extracted release note, which breaks
ChangelogCreationService.EnrichFromCI() and makes --no-extract-release-notes
ineffective; change the logic in ChangelogPrEvaluationService (the block using
config.Extract.ReleaseNotes and ReleaseNotesExtractor.FindReleaseNote) to only
set description and log the replacement when the current description is null or
whitespace (i.e., do not overwrite a prepopulated description such as
CHANGELOG_DESCRIPTION rehydrated by EnrichFromCI()), preserving the
extracted-note behavior only when no CI-provided description exists.
---
Outside diff comments:
In `@docs/cli/release/changelog-add.md`:
- Around line 31-40: The docs for the `--no-extract-release-notes` option
incorrectly say it only disables extraction from PR descriptions; update the
option description so it states extraction applies to PR or issue descriptions
and that `--no-extract-release-notes` disables extraction from both. Edit the
paragraph that mentions the extractor and the examples (`Release Notes: ...`,
`## Release Note`) to say the extractor looks in PR or issue descriptions, and
keep references to `--description` and `--title` behavior as-is.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 08e1fae7-435d-4d0a-a6ab-e93b985ebc24
📒 Files selected for processing (12)
docs/cli/release/changelog-add.mddocs/contribute/changelog.mdsrc/services/Elastic.Changelog/Creation/ChangelogCreationService.cssrc/services/Elastic.Changelog/Creation/IssueInfoProcessor.cssrc/services/Elastic.Changelog/Creation/PrInfoProcessor.cssrc/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cssrc/services/Elastic.Changelog/ReleaseNotesExtractor.cssrc/services/Elastic.Changelog/Serialization/ChangelogConfigurationYaml.cssrc/tooling/docs-builder/Commands/ChangelogCommand.cstests/Elastic.Changelog.Tests/Changelogs/Create/ReleaseNoteExtractionTests.cstests/Elastic.Changelog.Tests/Evaluation/ChangelogPrEvaluationServiceTests.cstests/Elastic.Changelog.Tests/ReleaseNotesExtractorTests.cs
💤 Files with no reviewable changes (1)
- src/services/Elastic.Changelog/ReleaseNotesExtractor.cs
| if (config.Extract.ReleaseNotes && !string.IsNullOrWhiteSpace(input.PrBody)) | ||
| { | ||
| var (releaseNoteTitle, releaseNoteDescription) = ReleaseNotesExtractor.ExtractReleaseNotes(input.PrBody); | ||
|
|
||
| if (releaseNoteTitle != null) | ||
| { | ||
| title = releaseNoteTitle; | ||
| _logger.LogInformation("Using extracted release note as title: {Title}", title); | ||
| } | ||
|
|
||
| if (releaseNoteDescription != null) | ||
| var releaseNote = ReleaseNotesExtractor.FindReleaseNote(input.PrBody); | ||
| if (releaseNote != null) | ||
| { | ||
| description = releaseNoteDescription; | ||
| description = releaseNote; | ||
| _logger.LogInformation("Using extracted release note as description (length: {Length} characters)", description.Length); |
There was a problem hiding this comment.
evaluate-pr now makes --no-extract-release-notes ineffective in CI.
ChangelogCreationService.EnrichFromCI() rehydrates CHANGELOG_DESCRIPTION before ExtractReleaseNotes is applied, so once this code exports an extracted note here, changelog add --no-extract-release-notes can no longer suppress it. With this change, that regression expands from long/multiline notes to every extracted note.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs`
around lines 89 - 95, The current code unconditionally replaces the existing
description with an extracted release note, which breaks
ChangelogCreationService.EnrichFromCI() and makes --no-extract-release-notes
ineffective; change the logic in ChangelogPrEvaluationService (the block using
config.Extract.ReleaseNotes and ReleaseNotesExtractor.FindReleaseNote) to only
set description and log the replacement when the current description is null or
whitespace (i.e., do not overwrite a prepopulated description such as
CHANGELOG_DESCRIPTION rehydrated by EnrichFromCI()), preserving the
extracted-note behavior only when no CI-provided description exists.
There was a problem hiding this comment.
IMO this seems like a bug with the way extract.release_notes is handled by the changelog evaluate-pr command (and/or the https://github.com/elastic/docs-actions/tree/main/changelog) so I will move this PR into draft state until that problem is fixed.
There was a problem hiding this comment.
@lcawl, moving to draft is the right call. The core tension is that evaluate-pr writes the extracted note into CHANGELOG_DESCRIPTION (a CI output), and EnrichFromCI() rehydrates that value unconditionally before --no-extract-release-notes is ever consulted by changelog add. The cleanest fix is likely in ChangelogCreationService.EnrichFromCI(): skip (or clear) the CHANGELOG_DESCRIPTION rehydration when ExtractReleaseNotes == false. That way the flag regains its ability to suppress the extracted note end-to-end.
If you'd like, I can look at the current EnrichFromCI() implementation and draft a concrete fix for you.
Background
The
--extract-release-notesfunctionality was added to the "changelog add" command via #2483It was derived from the existing behavior of https://github.com/elastic/kibana-release-notes generator where based on the content extracted from the "release notes" section of the PR body, the system handles that info in three different ways:
Based on feedback for our early adopters, this second behaviour (usage as the title if it's under a certain length) is no longer desired.
Summary
Breaking change: Short
Release Notes:lines no longer override the changelog title; they go to description when extraction is enabled. Titles come from--titleor the GitHub PR/issue title only.Implementation details
Behavior
ReleaseNotesExtractor: RemovedExtractReleaseNotesand the 120-character title/description split. OnlyFindReleaseNoteremains for pulling text from PR/issue bodies.PrInfoProcessor/IssueInfoProcessor: Whenextract.release_notesis on and--descriptionis not set,FindReleaseNotefillsderived.Description. Title always comes from--titleor the PR/issue title (with optional prefix stripping).ChangelogPrEvaluationService:titleoutput is always the (optionally stripped) PR title;descriptionis set fromFindReleaseNotewhen extraction is enabled.Docs
docs/cli/release/changelog-add.md,docs/contribute/changelog.md,src/tooling/docs-builder/Commands/ChangelogCommand.cs,src/services/Elastic.Changelog/Serialization/ChangelogConfigurationYaml.cs, andsrc/services/Elastic.Changelog/Creation/ChangelogCreationService.cscomments updated to match.Tests
ExtractReleaseNotes_*tests withFindReleaseNotelength checks (120 / 121 chars).ReleaseNoteExtractionTests: Short release note → PR title + description; explicit title test now expects the release note in description as well.ChangelogPrEvaluationServiceTests: Short note and## Release Noteheader cases now expect PR title + description output.Verification
dotnet test tests/Elastic.Changelog.Tests— 491 tests passed (rebuilt).dotnet build src/tooling/docs-builder/docs-builder.csproj— succeeded.