Skip to content

Enhance changelog bundle command with github release workflow#2843

Open
lcawl wants to merge 1 commit intofeat/changelog-add-release-versionfrom
feat/changelog-bundle-release-version
Open

Enhance changelog bundle command with github release workflow#2843
lcawl wants to merge 1 commit intofeat/changelog-add-release-versionfrom
feat/changelog-bundle-release-version

Conversation

@lcawl
Copy link
Contributor

@lcawl lcawl commented Mar 3, 2026

Summary

Per #2841, the docs-builder changelog gh-release command creates both changelog files and a bundle from a GitHub release. This PR enhances the docs-builder changelog bundle command to also be able to do just the second half of that functionality, in case teams want to separate the tasks. For example, maybe there's a case where they already have all the changelogs (created on a PR-by-PR basis) and just want to bundle up the appropriate changelogs for a release.

Files changed

  • Config model:

    • BundleConfiguration.cs — added Repo and Owner properties (derived from outstanding Changelog profile parity - phase 1 & 2 #2791)
    • ChangelogConfigurationYaml.cs (BundleConfigurationYaml) — added Repo and Owner for YAML deserialization
    • ChangelogConfigurationLoader.cs — maps the new fields in ParseBundleConfiguration
  • src/tooling/docs-builder/Commands/ChangelogCommand.cs

    • added --release-version and using Elastic.Documentation.ReleaseNotes; to the Bundle method; when set: validates mutual exclusivity with --all/--input-products/--prs/--issues and requirement of --repo, fetches the release, parses PR references from the release notes, builds full PR URLs, auto-infers --output-products from the tag+repo when not explicitly provided, then passes the PR list to the existing ChangelogBundlingService flow
    • Bundle's --release-version block now:
      • Loads ChangelogConfiguration first (before the repo check)
      • Resolves resolvedRepo as --repo CLI → bundle.repo config
      • Resolves resolvedOwner as --owner CLI → bundle.owner config → "elastic"
      • Only errors if neither CLI nor config provides a repo (with an updated message)
      • Uses resolvedRepo throughout (fetch, PR URL construction, product auto-inference)
  • tests/Elastic.Changelog.Tests/Changelogs/BundleReleaseVersionTests.cs (new) — 6 tests covering: PR list bundling from release, auto-inferred output products, explicit output products override, no PR refs warning, fetch failure, and latest tag pass-through

  • Docs:

    • changelog-bundle.md — documented --release-version option with all its constraints; updated the four existing filter option descriptions to mention it in the mutual exclusivity note; added a "Bundle by GitHub release" subsection with examples; updated --repo description
    • contribute/changelog.md — added --release-version to the filter options list; added "Bundle by GitHub release" subsection with example and auto-inference note; updated to drop the hard "requires --repo" wording and show both the repo and owner precedence chains

All 250 tests pass.

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes
  • No
  1. If you answered "Yes" to the previous question, please specify the tool(s) and model(s) used (e.g., Google Gemini, OpenAI ChatGPT-4, etc.).

Tool(s) and model(s) used: composer-1.5, clause-4.6-sonnet-medium

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