Open
Conversation
src/Elastic.Markdown/Myst/Directives/Changelog/ChangelogInlineRenderer.cs
Fixed
Show fixed
Hide fixed
…ect' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ariable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds issue-centric workflow support to the
changelogcommands, so changelog files can be authored, filtered, and bundled by GitHub issue numbers — not just PR numbers. It also migrates theprfield from a single string to aprsarray to support multi-PR changelogs.Schema:
pr→prs(array)prfield (single string) is replaced byprs(list of strings) in changelog YAML files.pr:key is still parsed and transparently promoted to a single-elementprslist.prs:going forward.Before:
After:
Changelog YAML files can now record GitHub issue numbers alongside (or instead of) PRs:
CLI changes
changelog add--issuesoption: accepts comma-separated issue numbers or a file path containing them.--issuesis provided without--prs, docs-builder fetches the issue from GitHub, extracts metadata (title, labels → type/area, linked PRs from body), and creates the changelog file(s) automatically.--use-issue-numberflag: names the output file by issue number instead of PR number (e.g.12345.yaml).--use-pr-numbernow aggregates multiple PR numbers in the filename (e.g.137431-137432.yaml).changelog bundle--issuesfilter: includes only changelog files whoseissuesfield contains at least one matching value (any-match semantics, same as--prs).--prsnow iterates the fullprsarray; a file is included if any listed PR matches.Any-match semantics (not all-match)
For both
--prsand--issuesfilters, a changelog file is included in the bundle as soon as any single value in its array matches any value in the filter set. The file does not need to list every filtered PR/issue.GitHub derivation for
changelog add --issuesWhen creating changelogs from issues, the tool:
typeandareasusing the repo'srules.createlabel mapping.release notes:section is present).prs.Documentation
docs/contribute/changelog.md,docs/cli/release/changelog-bundle.md,docs/cli/release/changelog-add.md:--issues,--use-issue-number, issue-centric workflow, and GitHub derivation details.--no-extract-issues/extract.issuesprose now clarifies both directions.docs/contribute/_snippets/changelog-fields.md: updated field reference (pr→prsfield).The following changes were also added in later commits:
CreateChangelogArgumentsValidator.csValidateRequiredFields: When neither--prsnor--issueswas specified and title is missing, the error now says "specify --prs or --issues to derive it". When--issueswas used and title is missing, it says "specify --issues to derive it from the issue".ChangelogCommand.cs(help text)issuesparam: Expanded from a thin one-liner to full--prs-level detail (file path, comma-separated,--owner/--repofor bare numbers, one file per issue).noExtractIssuesparam: Now describes both directions — issues from PR body and PRs from issue body.owner/repoparams: "used when--prscontains just numbers" → "used when--prsor--issuescontains just numbers".title/typeparams: "Required if--prsis not specified" → "Required if neither--prsnor--issuesis specified."config/changelog.example.ymlextract.issuescomment updated to describe both PR→issues and issue→PRs extraction.Test changes
pr: https://...toprs: ["NNN"].BundleChangelogs_WithIssuesFilter_FiltersCorrectly.BundleChangelogs_WithOldPrFormat_StillMatchesWhenFilteringByPrs(backward compatibility).ExtractIssueNumberutility tests added.Some additional iteration was required to get the tests to pass, as follows:
ChangelogCreationService: routing fix for issues-only flow with pre-populated fields (ChangelogCreationService.cs)CreateChangelog_WithIssues_CreatesValidYamlfailed because whenIssuescontained multiple values and no PRs were provided, the service always routed toCreateChangelogsForMultipleIssuesAsync. That method creates one file per issue (intended for GitHub-derived changelogs), so each file only contained a single issue URL.titleandtypefields are already provided (no GitHub derivation needed), the service now routes toCreateSingleChangelogAsync, which produces a single file with all issue URLs recorded as metadata in theissues:array.ChangelogFileWriter: raw string literal indentation fix (ChangelogFileWriter.cs)CS8999compiler error — lines in the YAML template for the# prs:comment block had incorrect indentation relative to the raw string literal's closing delimiter.# prs:and the following description) to match the closing"""delimiter.IssueInfoProcessor: duplicateusingdirective removed (IssueInfoProcessor.cs)CS0105compiler error —using Elastic.Documentation.ReleaseNotes;appeared twice in the file.usingdirective.Test fixtures: migrated from
pr:toprs:array format (multiple*Tests.csfiles)pr: <url>field to aprs:array, all inline YAML fixtures in the test files still used the old format, causing deserialization mismatches.BasicRenderTests,BlockConfigurationTests,BundleAmendTests,BundleLoaderTests,BundleValidationTests,ChecksumValidationTests,DuplicateHandlingTests,ErrorHandlingTests,HideFeaturesTests,HighlightsRenderTests,OutputFormatTests,TitleTargetTests) to use the newprs:array format. One instance inBundleChangelogsTestswas intentionally left in the oldpr:format to cover backward-compatibility deserialization.ChangelogTocFilteringTests: YAML malformation fixprs:in the YAML fixtures, making the YAML structurally invalid.ChangelogLinksHiddenInDetailedEntriesTestsfailuresAddToFileSystemto the constructor initializer (=> FileSystem.AddFile(...)) so the bundle file is added in the constructor body and is present before parsing.prsandissueslists use consistent indentation (list items aligned with the key).YAML indentation
prsandissuesuse the correct format:Use explicit
TitleandTypein changelog testsAdd
breaking-changeto the config in changelog testspivot.typesto define all three types:feature,bug-fix, andbreaking-change. The config was missingbreaking-change, so loading failed and returned null, which madeCreateChangelogfail immediately.Correct
lifecyclesplacement in changelog testslifecycleswas placed underpivot, but the loader expects it at the top level ofChangelogConfigurationYaml. It was moved to the correct level so lifecycle validation works.Generative AI disclosure
Tool(s) and model(s) used: claude-4.6-sonnet-medium, composer-1.5