Skip to content

Enhance changelog bundle and remove commands with github release workflow#2843

Merged
cotti merged 7 commits intomainfrom
feat/changelog-bundle-release-version
Mar 5, 2026
Merged

Enhance changelog bundle and remove commands with github release workflow#2843
cotti merged 7 commits intomainfrom
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 other docs-builder changelog commands to have similar support 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.

The PR finishes adding --release-version support to three commands:

  • **changelog add**: Fetch PRs from a GitHub release and create changelog files (delegates to GitHubReleaseChangelogService)
  • **changelog bundle**: Resolve a release into a PR list and bundle matching changelogs (equivalent to --prs with that list)
  • **changelog remove**: Resolve a release into a PR list and remove matching changelogs (equivalent to --prs with that list)

It also applies config fallbacks (bundle.repo, bundle.owner, bundle.directory) for changelog add in all modes and makes some general doc improvements (e.g. removal of repeated "mutual exclusivity" statements).

Some of these changes were originally accomplished in sub-PRs but I've merged them together to fix the config fallbacks consistently. The following summary comes from a trial changelog-specific SKILL.md....

Architecture and flow

The implementation follows the expected flow:

  • ChangelogCommand validates mutual exclusivity and delegates to services
  • --release-version in bundle/remove resolves to a PR list via IGitHubReleaseService and ReleaseNoteParser, then proceeds as if --prs was specified
  • No new profile fields or bundle schema changes; this is a new CLI filter only

Invocation modes

  • Profile vs option-based: Correctly enforced. --release-version is allowed only in option-based mode; profile mode continues to use config.
  • Mutual exclusivity: Correct. Only one filter can be specified: --all, --input-products, --prs, --issues, --release-version, or --report.

Owner/repo precedence

Matches SKILL guidance:

  • --repo > bundle.repo in config
  • --owner > bundle.owner in config > "elastic"
  • Applied consistently in add, bundle, and remove

Command synchronization

  • **changelog bundle** and **changelog remove** both support --release-version with the same semantics. Filter parity is preserved.
  • **changelog gh-release** is unchanged in behavior; it already does add + bundle. The new --release-version is an alternative way to drive bundle/remove, not a replacement for gh-release.

Config extension steps

Not applicable: no new config fields were added. config/changelog.example.yml was not modified, which is correct for a CLI-only option.

Product/version/lifecycle uniformity

  • ChangelogTextUtilities.ExtractBaseVersion and ChangelogTextUtilities.InferLifecycleFromVersion are used for tag inference.
  • configurationContext.ProductsConfiguration.GetProductByRepositoryName is used for repo-to-product mapping.
  • No hard-coded lifecycle strings.

Tests

The branch includes:

  • BundleReleaseVersionTests.cs — bundle --release-version (happy path, errors, config fallbacks)
  • RemoveReleaseVersionTests.cs — remove --release-version (happy path, dry-run, mutual exclusivity, config fallbacks)
  • ReleaseVersionTests.cs — add --release-version (in Create/)
  • ChangelogConfigurationTests.cs — config loading/fallbacks
  • ChangelogRemoveTests.cs — profile vs option mode

This satisfies the SKILL test requirements.

Documentation checklist

Requirement Status
changelog-bundle.md — options, examples Updated
changelog-remove.md — options, mutual exclusivity, precedence Updated
changelog-add.md — options Updated
changelog-gh-release.md Exists
docs/contribute/changelog.md Updated with sections for add, bundle, and remove --release-version
docs/syntax/changelog.md No change needed (no bundle schema change)
config/changelog.example.yml No change needed (no new config fields)

Verification conclusion

The changes align with both AGENTS.md and the changelog-tool SKILL.

Steps to test

  1. Set up a changelog configuration file and create some changelogs that align with PRs in a GitHub release. For example, use the files [DOCS] Changelog test apm-agent-dotnet#2714 (https://github.com/elastic/apm-agent-dotnet/releases)
  2. Try to create changelogs using the --release-version option. For example:
    docs-builder/release/docs-builder changelog add \
    --release-version v1.34.0 --repo apm-agent-dotnet \
    --owner elastic --output ./docs/changelog \
    --config ./docs/changelog.yml
  3. Try to create a bundle using the --release-version option. For example:
    docs-builder changelog bundle --release-version v1.34.0
  4. Try to remove changelogs using the --release-version option. For example:
    docs-builder changelog remove --release-version v1.34.0
  5. Test when the changelog configuration file has bundle.repo and bundle.owner options to verify the fallback behaviour.

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

@lcawl lcawl marked this pull request as ready for review March 3, 2026 18:34
@lcawl lcawl requested review from a team as code owners March 3, 2026 18:34
@lcawl lcawl requested a review from reakaleek March 3, 2026 18:34
@lcawl lcawl force-pushed the feat/changelog-add-release-version branch from 57fb40f to 5413cbe Compare March 4, 2026 16:26
Base automatically changed from feat/changelog-add-release-version to main March 4, 2026 21:51
@lcawl lcawl force-pushed the feat/changelog-bundle-release-version branch from 82c9cc0 to 8ff4061 Compare March 4, 2026 23:35
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

@lcawl lcawl changed the title Enhance changelog bundle command with github release workflow Enhance changelog bundle and remove commands with github release workflow Mar 5, 2026
@lcawl lcawl marked this pull request as draft March 5, 2026 04:15
@lcawl lcawl marked this pull request as ready for review March 5, 2026 05:57
@lcawl lcawl requested review from a team, Mpdreamz and reakaleek March 5, 2026 08:06
@cotti cotti merged commit 1c4e9b2 into main Mar 5, 2026
53 of 57 checks passed
@cotti cotti deleted the feat/changelog-bundle-release-version branch March 5, 2026 15:02
@cotti cotti deleted the feat/changelog-bundle-release-version branch March 5, 2026 15:02
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.

3 participants