Skip to content

Change changelog --extract-release-notes impact on title#3015

Merged
lcawl merged 4 commits intomainfrom
changelog-titles
Apr 8, 2026
Merged

Change changelog --extract-release-notes impact on title#3015
lcawl merged 4 commits intomainfrom
changelog-titles

Conversation

@lcawl
Copy link
Copy Markdown
Member

@lcawl lcawl commented Apr 1, 2026

Background

The --extract-release-notes functionality was added to the "changelog add" command via #2483

It 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:

  1. No release note found: Returns the normalized PR title as the release note entry
  2. Short release note (≤120 characters, single line): Replaces the PR title with the release note content
  3. Long release note (>120 characters or multi-line): Keeps the PR title and adds the release note as additional details that tech writers can review and compress

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 --title or the GitHub PR/issue title only.

Implementation details

Behavior

  • ReleaseNotesExtractor: Removed ExtractReleaseNotes and the 120-character title/description split. Only FindReleaseNote remains for pulling text from PR/issue bodies.
  • PrInfoProcessor / IssueInfoProcessor: When extract.release_notes is on and --description is not set, FindReleaseNote fills derived.Description. Title always comes from --title or the PR/issue title (with optional prefix stripping).
  • ChangelogPrEvaluationService: title output is always the (optionally stripped) PR title; description is set from FindReleaseNote when 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, and src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs comments updated to match.

Tests

  • Replaced old ExtractReleaseNotes_* tests with FindReleaseNote length 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 Note header cases now expect PR title + description output.

Verification

  • dotnet test tests/Elastic.Changelog.Tests491 tests passed (rebuilt).
  • dotnet build src/tooling/docs-builder/docs-builder.csproj — succeeded.

@lcawl lcawl marked this pull request as ready for review April 1, 2026 22:28
@lcawl lcawl requested review from a team as code owners April 1, 2026 22:28
@lcawl lcawl requested review from cotti and reakaleek April 1, 2026 22:28
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 45024aa8-04ad-45fc-a942-8b2edc7cf908

📥 Commits

Reviewing files that changed from the base of the PR and between f797aee and c88c8f1.

📒 Files selected for processing (8)
  • docs/cli/changelog/add.md
  • docs/contribute/changelog.md
  • src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs
  • src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs
  • src/services/Elastic.Changelog/Serialization/ChangelogConfigurationYaml.cs
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs
  • tests/Elastic.Changelog.Tests/Changelogs/Create/ReleaseNoteExtractionTests.cs
  • tests/Elastic.Changelog.Tests/Evaluation/ChangelogPrEvaluationServiceTests.cs
✅ Files skipped from review due to trivial changes (3)
  • src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs
  • src/services/Elastic.Changelog/Serialization/ChangelogConfigurationYaml.cs
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs
  • tests/Elastic.Changelog.Tests/Changelogs/Create/ReleaseNoteExtractionTests.cs

📝 Walkthrough

Walkthrough

This 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 --description is explicitly provided), while the changelog title always derives from the --title flag or PR/issue title. The extraction logic in ReleaseNotesExtractor is simplified by removing the tuple-based ExtractReleaseNotes method and relying solely on FindReleaseNote. All processors, evaluators, tests, and documentation are updated consistently to reflect this change.

Suggested labels

documentation

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main breaking change: the removal of short release notes' ability to override the changelog title.
Description check ✅ Passed The description provides comprehensive context about the background, motivation, implementation details, documentation updates, and test changes related to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch changelog-titles

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 | 🟡 Minor

This 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-notes as 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

📥 Commits

Reviewing files that changed from the base of the PR and between e578fac and f797aee.

📒 Files selected for processing (12)
  • docs/cli/release/changelog-add.md
  • docs/contribute/changelog.md
  • src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs
  • src/services/Elastic.Changelog/Creation/IssueInfoProcessor.cs
  • src/services/Elastic.Changelog/Creation/PrInfoProcessor.cs
  • src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs
  • src/services/Elastic.Changelog/ReleaseNotesExtractor.cs
  • src/services/Elastic.Changelog/Serialization/ChangelogConfigurationYaml.cs
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs
  • tests/Elastic.Changelog.Tests/Changelogs/Create/ReleaseNoteExtractionTests.cs
  • tests/Elastic.Changelog.Tests/Evaluation/ChangelogPrEvaluationServiceTests.cs
  • tests/Elastic.Changelog.Tests/ReleaseNotesExtractorTests.cs
💤 Files with no reviewable changes (1)
  • src/services/Elastic.Changelog/ReleaseNotesExtractor.cs

@lcawl lcawl marked this pull request as draft April 2, 2026 00:01
@cotti cotti force-pushed the changelog-titles branch from 1ce0187 to 7a99827 Compare April 7, 2026 09:24
@lcawl lcawl marked this pull request as ready for review April 7, 2026 14:49
@coderabbitai coderabbitai bot added documentation Improvements or additions to documentation and removed breaking labels Apr 7, 2026
@lcawl lcawl merged commit be291e2 into main Apr 8, 2026
30 checks passed
@lcawl lcawl deleted the changelog-titles branch April 8, 2026 14:12
cotti added a commit that referenced this pull request Apr 8, 2026
Co-authored-by: Felipe Cotti <felipe.cotti@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants