Skip to content

feat(changelog): changelog note command for PR-less entries - #3923

Open
Mpdreamz wants to merge 4 commits into
mainfrom
fix/changelog-note-command
Open

feat(changelog): changelog note command for PR-less entries#3923
Mpdreamz wants to merge 4 commits into
mainfrom
fix/changelog-note-command

Conversation

@Mpdreamz

Copy link
Copy Markdown
Member

Summary

Adds changelog note as a sibling of changelog add. Notes solve the problem of PR-less items (such as known-issue entries that today go straight into bundle YAML, bypassing the pool entirely) by giving them a pool-native, scrubbable home.

  • Filename: note-<slug>.yml — slug from --name or slugified title, never a PR number
  • Required target: every product must have a concrete target (wildcard * is rejected). This is enforced at creation time and is the key difference from add.
  • PRs/issues: still allowed and emitted into the YAML, but optional and don't affect the filename
  • Upload: existing changelog upload picks up note-*.yml files verbatim (no change needed — the key derives from the filename, which is already correct)

Stacked on #3922 (groundwork for PR-anchored CDN sourcing). That PR must merge first.

New surface

changelog note --title "Known memory leak" --type known-issue \
               --products "elasticsearch 9.2.0 ga"

changelog note --name tsdb-gap --type known-issue \
               --products "elasticsearch 9.2.0 ga" \
               --prs https://github.com/elastic/elasticsearch/pull/153344

Test plan

  • 943 unit tests pass (dotnet test tests/Elastic.Changelog.Tests/)
  • note-<slug>.yml created with title-derived slug when --name absent
  • Explicit --name tsdb-gapnote-tsdb-gap.yml
  • Product with target: "*" → error pointing at concrete target
  • Product with empty target → same error
  • PRs cited on a note → emitted in YAML, filename unchanged

🤖 Generated with Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes for one correctness issue: changelog note should apply the same post-config CI-description clearing behavior as changelog add when release-note extraction resolves to disabled.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Comment thread src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes for one correctness issue: changelog note should not implicitly inherit PR linkage from CI (CHANGELOG_PR_NUMBER) when --prs is not provided.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Comment thread src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs
Base automatically changed from fix/changelog-branch-repository to main August 25, 2026 13:48
Mpdreamz and others added 2 commits August 25, 2026 15:48
Adds changelog note as a sibling of changelog add. Notes write
note-<slug>.yml files (keyed by name/title, not by PR) for items with
no PR — such as known-issue entries that today go directly into bundle
YAML. All products must have a concrete target (wildcard * is rejected).
PRs/issues may still be cited but are optional and do not affect the
filename.

New surface:
  changelog note --title "..." --type known-issue --products "product 9.2.0 ga"
  changelog note --name tsdb-gap --products "elasticsearch 9.2.0 ga" ...

Adds ValidateNoteProducts to CreateChangelogArgumentsValidator,
WriteNoteAsync + GenerateNoteFilename + Slugify to ChangelogFileWriter,
and CreateNote to ChangelogCreationService.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes for one correctness issue in changelog note citation validation.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Comment thread src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs
Numeric --prs or --issues without --owner/--repo now fail with the same
error as the `add` path instead of writing ambiguous numeric references
into YAML. Two regression tests added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread src/services/Elastic.Changelog/Creation/ChangelogCreationService.cs

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Requesting changes: multi-value --prs/--issues validation in changelog note still permits mixed numeric+URL inputs without repository context, which allows ambiguous bare numeric citations to be written.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

// Validate issue citation format
if (input.Issues is { Length: > 1 })
{
if (!_validator.ValidateMultipleIssueFormat(collector, input.Issues, input.Owner, input.Repo))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same gap for issues: in the multi-value branch, ValidateMultipleIssueFormat only rejects when all entries are numeric. A mixed input like --issues 456 --issues https://github.com/elastic/elasticsearch/issues/789 can pass without repo context and persist an ambiguous bare numeric issue.

Please apply per-entry validation (or reject when any numeric value is present without owner/repo context), matching the single-value validation rule.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 1b42111 — same Any() fix applied to ValidateMultipleIssueFormat. New test: CreateNote_MixedNumericAndUrlIssueWithoutOwnerRepo_ReturnsError.

// Validate PR citation format (same rule as `add`: numeric refs require --owner/--repo)
if (input.Prs is { Length: > 1 })
{
if (!_validator.ValidateMultiplePrFormat(collector, input.Prs, input.Owner, input.Repo))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CreateNote only runs ValidateMultiplePrFormat when more than one PR is passed, but that validator only fails when all entries are numeric. A mixed input like --prs 123 --prs https://github.com/elastic/elasticsearch/pull/999 can therefore pass without repo context, leaving 123 as an ambiguous citation.

Given the intended rule here (numeric refs require repo context), this should validate each PR entry (or fail when any entry is numeric and repo context is missing), not only the all-numeric case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 1b42111 — changed ValidateMultiplePrFormat from All() to Any() so a single bare numeric entry in a mixed numeric+URL list is rejected when --owner/--repo are absent. New test: CreateNote_MixedNumericAndUrlPrWithoutOwnerRepo_ReturnsError.

…ion validation in CreateNote

- Add pre-enrichment cliDescription capture and post-ApplyConfigDefaults extraction-disabled guard
  to CreateNote, mirroring the identical logic in CreateChangelog
- Change ValidateMultiplePrFormat/ValidateMultipleIssueFormat from All() to Any() so a single
  bare numeric entry in a mixed numeric+URL list is rejected when owner/repo are absent
- Add three new tests: mixed PR, mixed issue, and CI-description-clearing for CreateNote

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved — no blocking issues found.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

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