Handle extract.release_notes properly on CI#3047
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR adds CI consumption of extracted release notes via a new Sequence DiagramsequenceDiagram
participant PR as GitHub PR
participant EvalPR as changelog evaluate-pr
participant CI as CI Environment
participant Add as changelog add
participant YAML as changelog.yaml
PR->>EvalPR: Provide PR metadata (title, type, body)
EvalPR->>EvalPR: Extract release notes (if enabled)
EvalPR->>CI: Export CHANGELOG_TITLE, CHANGELOG_TYPE
EvalPR->>CI: Export CHANGELOG_DESCRIPTION (when extraction produced a note)
CI->>Add: Invoke changelog add with CHANGELOG_* env vars
Add->>Add: Resolve description:
Note over Add: 1) CLI `--description` wins\n2) If extraction disabled, ignore `CHANGELOG_DESCRIPTION`\n3) Else use `CHANGELOG_DESCRIPTION` when CLI blank
Add->>YAML: Emit changelog entry with resolved fields
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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/contribute/changelog.md`:
- Line 366: The heading "CI two-step flow" is currently at h4 (####) but its
parent "Create changelog files" is h2, so change the "CI two-step flow" heading
to h3 (###) to fix the heading-level skip; locate the line containing the
heading text "CI two-step flow" in docs/contribute/changelog.md and replace the
four hashes with three so the heading sequence increments by one.
🪄 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: 085d8e6d-637f-4f7b-a478-09c2f98d894d
📒 Files selected for processing (7)
docs/cli/changelog/add.mddocs/cli/changelog/evaluate-pr.mddocs/contribute/changelog.mdsrc/services/Elastic.Changelog/Creation/ChangelogCreationService.cstests/Elastic.Changelog.Tests/Changelogs/Create/CreateChangelogTestBase.cstests/Elastic.Changelog.Tests/Changelogs/Create/ReleaseNoteExtractionTests.cstests/Elastic.Changelog.Tests/Creation/CIEnrichmentTests.cs
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
tests/Elastic.Changelog.Tests/Changelogs/Create/ReleaseNoteExtractionTests.cs
Show resolved
Hide resolved
tests/Elastic.Changelog.Tests/Changelogs/Create/ReleaseNoteExtractionTests.cs
Show resolved
Hide resolved
src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs
Outdated
Show resolved
Hide resolved
|
Added test cases:
|
* Handle extract.release_notes * Update docs/contribute/changelog.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Add explicit extraction state property * Add further testing for extraction behavior gaps --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Handles https://github.com/elastic/docs-eng-team/issues/490
Pre-requisite for #3015
This pull request improves how the changelog creation process handles release note extraction in CI environments, especially when using GitHub Actions. It ensures that a release note description extracted in CI is only used when extraction is enabled, and documents the precedence rules for the
descriptionfield. The changes also add comprehensive tests and update the documentation for clarity.The most important changes are:
Changelog Description Handling and Precedence:
CreateChangelogservice now ignores any CI-provided description (fromCHANGELOG_DESCRIPTION) if release note extraction is disabled either via CLI (--no-extract-release-notes) or config (extract.release_notes: false). Explicit CLI descriptions always take precedence over CI-injected ones. [1] [2] [3]CHANGELOG_DESCRIPTIONenvironment variable are documented in both the CLI and contributor documentation, clarifying how and when the description is used or ignored. [1] [2] [3]Testing Improvements:
These changes make the changelog process more robust and predictable in CI, preventing accidental inclusion of extracted release notes when extraction is intentionally turned off.