Skip to content

Changelog profile parity - GitHub release workflow#2848

Draft
lcawl wants to merge 26 commits intomainfrom
feat/changelog-profile-github-release
Draft

Changelog profile parity - GitHub release workflow#2848
lcawl wants to merge 26 commits intomainfrom
feat/changelog-profile-github-release

Conversation

@lcawl
Copy link
Contributor

@lcawl lcawl commented Mar 3, 2026

Summary

This PR is dependent on #2791, #2808, and #2844.
It should be merged only after all those PRs.

The goal is to add profile-based bundling and removal work with GitHub releases.
For example, the following profile-based command will be equivalent to changelog bundle --release-version 9.2.0:

docs-builder changelog bundle elasticsearch-release 9.2.0

...where elasticsearch-release is a profile with source: github_release.

Changes

Code (8 files modified, 1 created):

  • BundleConfiguration.cs — Added Source property to BundleProfile
  • ChangelogConfigurationYaml.cs — Added Source property to BundleProfileYaml
  • ChangelogConfigurationLoader.cs — Maps Source when building BundleProfile objects
  • ProfileFilterResolver.cs — Handles source: github_release in a new ResolveFromGitHubReleaseAsync method: fetches the release, parses PR references from the release body, and returns them as the filter
  • ChangelogBundlingService.cs — Added optional IGitHubReleaseService? constructor parameter (defaults to a real GitHubReleaseService) and passes it to ProfileFilterResolver.ResolveAsync

Docs:

  • changelog-bundle.md — Added source field to the profile configuration reference, added a github_release profile to the examples, and added invocation examples
  • changelog-remove.md -- Ditto
  • contribute/changelog.md — Added source to the profile fields table and a new "Bundle changelogs from a GitHub release" subsection with YAML config and invocation examples
  • changelog.example.yml — Added a commented elasticsearch-gh-release profile example showing source: github_release

Tests (BundleProfileGitHubReleaseTests.cs) — 9 tests covering:

  • Happy path: bundles changelogs whose PR URLs match those from a GitHub release
  • Version/lifecycle auto-inference from the v-prefixed tag name
  • No PR references in release notes → warning + failure
  • FetchReleaseAsync returning null → error
  • latest version tag forwarded correctly
  • Missing repo config → error
  • source: github_release + products → mutual exclusivity error
  • source: github_release + profileReport → mutual exclusivity error
  • Bundle-level repo used as fallback when profile omits it

lcawl and others added 25 commits February 25, 2026 15:55
…dd output_products, repo, owner profile fields

Phase 1:
- Bundle command: reject all filter/output options (--all, --input-products, --output-products, --prs, --issues, --output, --repo, --owner, --resolve, --no-resolve, --hide-features, --config, --directory) when a profile argument is given.
- Remove command: reject all options except --dry-run and --force when a profile argument is given.
- Profile-based commands now discover changelog.yml automatically (./changelog.yml then ./docs/changelog.yml) and return a helpful error if neither is found, rather than silently falling back to defaults. An explicit config path is still accepted when passed directly to the service layer (used by tests).
- ChangelogRemoveArguments.Directory changed from required to nullable; ApplyConfigDefaults follows the same null-coalescing pattern as the bundle service.
- Fixes a silent bug where --output was ignored in profile mode.

Phase 2:
- Add output_products, repo, and owner fields to BundleProfileYaml, BundleProfile, and the config loader mapping.
- ProcessProfile applies these fields when building the bundled output: output_products overrides the products array with version/lifecycle substitution; repo and owner are stored on each product entry for correct PR/issue link generation.
- MergeHideFeatures removed; profile mode now uses only the profile's hide_features (CLI --hide-features is rejected at the command layer).
- Update changelog.example.yml and docs to document all new profile fields and the mutual exclusivity requirement.

Made-with: Cursor
- Add 7 new unit tests for bundle/remove profile features:
  - output_products overrides products array in bundle
  - repo from profile is written to bundle product entries
  - no repo/owner in profile preserves existing fallback behaviour
  - missing config in profile mode returns error with advice (bundle + remove)
  - changelog.yml discovered from CWD (./changelog.yml)
  - changelog.yml discovered from docs/ subdir (./docs/changelog.yml)
- Update docs/contribute/changelog.md:
  - Document mutual exclusivity of profile-based vs option-based bundle usage
  - Add new "Profile-based bundling" section with full field reference table
  - Document config auto-discovery behaviour for profile mode
  - Update "Removal with profiles" to document mutual exclusivity,
    allowed --dry-run/--force exceptions, and which profile fields are ignored

Made-with: Cursor
Adds repo and owner as top-level fields under bundle: in changelog.yml,
providing a default that applies to all profiles. Profile-level values
override the bundle-level default when set; otherwise the bundle-level
value is used. This avoids repeating the same repo/owner in every profile
when all profiles share the same repository.

Also adds two tests verifying the fallback and override behaviour.

Made-with: Cursor
Extends ApplyConfigDefaults in both ChangelogBundlingService and
ChangelogRemoveService to fall back to bundle.repo and bundle.owner
from config when --repo/--owner are not supplied on the CLI.

This mirrors the existing behaviour for profile-based commands and
means repo and owner rarely need to be specified on the command line
when a changelog.yml with bundle-level defaults is present.

Precedence: explicit CLI flag > bundle.repo/owner config > nothing
(renderer falls back to product ID at render time).

Adds four tests covering the config fallback and CLI-override paths
for the bundle command.

Made-with: Cursor
Updates all three places that describe --repo/--owner behaviour:

- CLI param XML docs (bundle and remove): clarify both are optional
  and fall back to bundle.repo/bundle.owner in changelog.yml
- changelog-bundle.md: expand --repo/--owner option descriptions;
  rewrite "Repository name in bundles" section to show the three-level
  precedence (CLI > profile > bundle config) with YAML examples;
  update profile fields table and the examples section to demonstrate
  bundle-level defaults with per-profile overrides
- changelog.md: add a note that --repo/--owner fall back to config
  in option-based bundling; expand profile fields table to include
  bundle-level repo/owner defaults; update the --prs and --issues
  callout text to mention the config fallback

Made-with: Cursor
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…ation

Phase 3 (profile-based enhancements):
- Accept a newline-delimited URL list file as a profile argument, resolving
  to PR or issue filters based on the URLs found in the file
- Support combined <version> <report|url-list> profile arguments so the
  version can be used for {version} substitution while the report/file
  drives filtering
- Wire Issues filter through ProfileFilterResult into bundling and remove services

Phase 4 (option-based enhancements):
- Add --report option to both `changelog bundle` and `changelog remove`,
  accepting a promotion report URL or local HTML file path
- Enforce stricter validation for file-based --prs and --issues inputs:
  every line must be a fully-qualified GitHub URL

Phase 5 (tests and documentation):
- Add 264-test coverage for all new behaviours in BundleChangelogsTests
  and ChangelogRemoveTests
- Update changelog-bundle.md, changelog-remove.md, and contribute/changelog.md
  to document new arguments, options, validation rules, and examples

Made-with: Cursor
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Correct the claim that repo/owner are always ignored during profile-based
removal. For source: github_release profiles they are actively used to
fetch the GitHub release and build the PR URL list.

- contribute/changelog.md: replace the blanket "ignored" statement with
  a per-profile-type breakdown; add a source: github_release removal
  example and GITHUB_TOKEN note.
- changelog-remove.md: same correction to the note in the profile-based
  removal section; add a dedicated "Remove using a GitHub release profile"
  subsection with examples and a cross-reference to the profile config
  fields in changelog-bundle.md.

Made-with: Cursor
Base automatically changed from profile-parity-p3 to main March 4, 2026 16:15
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.

1 participant