Change changelog --extract-release-notes impact on title#3015
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR refactors how release notes are extracted and assigned to changelog fields. Previously, extracted release notes were conditionally routed to either the title or description based on text length and line-count heuristics (≤120 chars single-line → title; >120 chars or multi-line → description). The new behavior extracts release notes as a single string that populates only the description field (unless 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
src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs
Show resolved
Hide resolved
Co-authored-by: Felipe Cotti <felipe.cotti@elastic.co>
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.