-
Notifications
You must be signed in to change notification settings - Fork 33
Update changelog to pull from PR #2338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/services/Elastic.Documentation.Services/Changelog/GitHubPrService.cs
Fixed
Show fixed
Hide fixed
src/services/Elastic.Documentation.Services/Changelog/GitHubPrService.cs
Fixed
Show fixed
Hide fixed
src/services/Elastic.Documentation.Services/Changelog/GitHubPrService.cs
Fixed
Show fixed
Hide fixed
src/services/Elastic.Documentation.Services/Changelog/GitHubPrService.cs
Fixed
Show fixed
Hide fixed
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
🔍 Preview links for changed docs |
… combined' 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>
… combined' 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>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ect' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
reakaleek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we should use https://github.com/octokit/dotnet-sdk
Nevertheless, LGTM.
reakaleek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add tests for this?
I've added this via 2aadd2b (and added summary to the PR description). If that's not sufficient, lmk! |
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>
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>
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>
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>
Summary
docs-builder changelog addcommand to support the--proption with GitHub integration.--repoand--owneroptions to resolve GitHub URLs when only a PR number is provided (based on the use of those options in theelastic-agent-changelog-tool buildcommand per https://github.com/elastic/elastic-agent-changelog-tool/blob/main/docs/usage.md)docs-builder changelog addcommand to make--titleand--typeoptional when--pris specified.Features:
--title,--type,--areas)--pris specified:--titleand--typeare optionallabel_to_typemapping) if not providedlabel_to_areasmapping) if not provided--ownerand--repoare required if only a PR number is provided--pris not specified:--titleand--typeare required (validation error if missing)dotnet test tests/Elastic.Documentation.Services.TestscommandUsage examples
If I provide a
changelog.ymlthat contains type and area mappings, for example:I can then use these mappings to grab details from the pull request:
./docs-builder changelog add --pr https://github.com/elastic/elasticsearch/pull/139272 --products "elasticsearch 9.3.0" --config blah/changelog.ymlThe generated
1765415340-[es|ql]-take-top_snippets-out-of-snapshot.yamlfile has successfully derived the title, type, and area:You can also provide just a PR number with owner and repo (with and without overriding title and type):
Here's an example of an error message for the new behaviour in a situation where I haven't created type mappings:
AI summaries of changes made
Since I made these updates in four iterations, here are the individual summaries...
Related to --pr github integration changes
ChangelogConfiguration(src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs):GitHubPrService(src/services/Elastic.Documentation.Services/Changelog/GitHubPrService.cs):ChangelogService(src/services/Elastic.Documentation.Services/ChangelogService.cs):--pris provided--titleis explicitly provided)ChangelogCommand(src/tooling/docs-builder/Commands/ChangelogCommand.cs):GitHubPrServicetoChangelogServicechangelog.yml.example(config/changelog.yml.example):The implementation is complete and builds successfully. The command will now automatically populate changelog fields from GitHub PRs when the
--proption is used, while still allowing manual overrides.Related to addition of --owner and --repo
ChangelogCommand(src/tooling/docs-builder/Commands/ChangelogCommand.cs):--ownerand--repooptional parameters--pris just a numberChangelogInputChangelogInput(src/services/Elastic.Documentation.Services/Changelog/ChangelogInput.cs):OwnerandRepopropertiesGitHubPrService(src/services/Elastic.Documentation.Services/Changelog/GitHubPrService.cs):FetchPrInfoAsyncto accept optionalownerandrepoparametersParsePrUrlto use provided owner/repo when prUrl is just a numberhttps://github.com/owner/repo/pull/123owner/repo#123-Just a number:
123(requires--ownerand--repo)ChangelogService(src/services/Elastic.Documentation.Services/ChangelogService.cs):--pris just a number, both--ownerand--repomust be providedThe implementation is complete and builds successfully. The command now supports resolving GitHub PRs using just a number when
--ownerand--repoare provided.Related to required command options
ChangelogCommand(src/tooling/docs-builder/Commands/ChangelogCommand.cs):--pris specifiedChangelogInput(src/services/Elastic.Documentation.Services/Changelog/ChangelogInput.cs):ChangelogService(src/services/Elastic.Documentation.Services/ChangelogService.cs):--pris specified, fetch PR info firstThe implementation is complete and builds successfully. The command now supports deriving title and type from PRs when
--pris specified, and fails with clear error messages if they cannot be derived.Related to added tests
IGitHubPrServiceinterface (src/services/Elastic.Documentation.Services/Changelog/IGitHubPrService.cs)GitHubPrServiceto implementIGitHubPrServiceChangelogServiceto useIGitHubPrServiceinstead of the concrete classChangelogCommandto use the interfacetests/Elastic.Documentation.Services.Tests/)TestHelpers.cs) withTestDiagnosticsCollectorandTestLoggerFactoryChangelogServiceTests.cs) covering:All 15 tests pass, validating the changelog add command's input handling and YAML output generation with mocked GitHub PR responses.
Outstanding questions
ownerandrepovalues?Generative AI disclosure
Tool(s) and model(s) used: composer-1 agent