Skip to content

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

Draft
lcawl wants to merge 1 commit intomainfrom
changelog-titles
Draft

Change changelog --extract-release-notes impact on title#3015
lcawl wants to merge 1 commit intomainfrom
changelog-titles

Conversation

@lcawl
Copy link
Copy Markdown
Contributor

@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

📝 Walkthrough

Walkthrough

The 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 --title flag or the PR/issue title, never from extracted release note content. The public method ExtractReleaseNotes returning a tuple is removed in favor of the single-value FindReleaseNote method. Documentation and tests are updated to reflect this new routing logic.

Suggested labels

breaking

🚥 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 behavioral change: the impact of --extract-release-notes on how changelog titles are now derived.
Description check ✅ Passed The description is directly related to the changeset, providing background, implementation details, and verification of the breaking change to release-notes extraction behavior.

✏️ 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

Comment on lines 89 to 95
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);
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot Apr 1, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

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.

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.

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.

@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.

@lcawl lcawl marked this pull request as draft April 2, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant