Skip to content

Fix changelog title inference#2977

Merged
cotti merged 1 commit intomainfrom
fix/changelog_titles
Mar 27, 2026
Merged

Fix changelog title inference#2977
cotti merged 1 commit intomainfrom
fix/changelog_titles

Conversation

@cotti
Copy link
Copy Markdown
Contributor

@cotti cotti commented Mar 27, 2026

This pull request enhances the changelog and PR evaluation logic to better handle PR body content, especially extracting release notes, and improves the accuracy of PR edit detection. It also updates the related test suite to cover these new behaviors.

Changelog and PR Evaluation Improvements:

  • The PR evaluation now distinguishes between title and body changes, skipping processing only if neither changed, improving efficiency and accuracy for edited events. (src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.csL35-R38)
  • Release notes are now extracted from the PR body (when enabled in config): if a short release note is found, it overrides the PR title; longer notes are used as the description. Fallbacks to the PR title if no release note is found. (src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs [1] [2] [3]
  • The PR evaluation outputs now include the extracted description, and the output logic is updated to set the new "description" field. (src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs [1] [2]
  • The changelog creation process is updated to use the extracted description from CI environment variables if available. (src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs [1] [2]

API and Argument Structure Updates:

  • The EvaluatePrArguments record now includes PrBody and BodyChanged fields to support the new evaluation logic. (src/services/Elastic.Changelog/Evaluation/EvaluatePrArguments.cs src/services/Elastic.Changelog/Evaluation/EvaluatePrArguments.csR15-R21)
  • The changelog command and its evaluation method are updated to accept and pass through the new arguments, including reading the PR body from environment variables. (src/tooling/docs-builder/Commands/ChangelogCommand.cs [1] [2] [3] [4]

Test Suite Enhancements:

  • The test helper and test cases are updated to support and verify the new logic for body changes and release note extraction, including new tests for various release note scenarios and the updated skip logic for edits. (tests/Elastic.Changelog.Tests/Evaluation/ChangelogPrEvaluationServiceTests.cs [1] [2] [3] [4] [5]

@cotti cotti self-assigned this Mar 27, 2026
@cotti cotti requested a review from a team as a code owner March 27, 2026 16:51
@cotti cotti added the fix label Mar 27, 2026
@cotti cotti requested a review from Mpdreamz March 27, 2026 16:51
@coderabbitai coderabbitai bot added enhancement and removed fix labels Mar 27, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 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: a3795a36-4dbc-4370-bf00-aa400c09fc28

📥 Commits

Reviewing files that changed from the base of the PR and between 0485881 and 83298fb.

📒 Files selected for processing (5)
  • src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs
  • src/services/Elastic.Changelog/Evaluation/ChangelogPrEvaluationService.cs
  • src/services/Elastic.Changelog/Evaluation/EvaluatePrArguments.cs
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs
  • tests/Elastic.Changelog.Tests/Evaluation/ChangelogPrEvaluationServiceTests.cs

📝 Walkthrough

Walkthrough

This change extends the changelog evaluation system to support extracting and processing release notes from PR body content. The EvaluatePrArguments class now carries PR body data and a body change flag. The evaluation service processes PR bodies to extract release note content when extraction is enabled, resolving title and description with fallback logic based on extracted content length. Additionally, the changelog creation service now reads description fallback values from the CHANGELOG_DESCRIPTION environment variable. The command layer is updated to read PR body from environment variables and thread this data through the evaluation pipeline.

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% 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 'Fix changelog title inference' is directly related to the main purpose of the PR, which improves how PR titles and release notes are extracted and processed in the changelog evaluation logic.
Description check ✅ Passed The description is comprehensive and clearly related to the changeset. It details enhancements to changelog/PR evaluation, release note extraction, edit detection, API updates, and test improvements—all reflected in the code changes.

✏️ 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 fix/changelog_titles

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

@cotti cotti merged commit 168bf4a into main Mar 27, 2026
31 checks passed
@cotti cotti deleted the fix/changelog_titles branch March 27, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants