Add product-based filtering to changelog bundle#2873
Draft
lcawl wants to merge 8 commits intochangelog-product-labelsfrom
Draft
Add product-based filtering to changelog bundle#2873lcawl wants to merge 8 commits intochangelog-product-labelsfrom
lcawl wants to merge 8 commits intochangelog-product-labelsfrom
Conversation
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>
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 builds on #2857 and must be merged after it.
Teams need control over which changelogs appear in the output, based on the changelog's
productsfield, even when the primary bundle filter is--prs,--issues,--report, or--all(that is to say, not a product-based filter).For example: a PR appears in multiple release lists but the changelog correctly indicates that it's only applicable / notable in a subset of those products.
Mutual exclusivity rule (applies to all options): The new product filter must NOT apply when the primary bundle filter is already product-based.
bundle.profiles.productsand--input-productsare equivalent: both are already a complete product-based primary filter, and overlaying a secondary product filter would be redundant and confusing.This PR adds new
rules.bundlesubsection that is applied during thechangelog bundlecommand. Changelogs that fail the product filter are excluded from the bundle file entirely.For example:
What was implemented
Config model —
BlockConfiguration.cs&ChangelogConfigurationYaml.csBundleRulesrecord withExcludeProducts,IncludeProducts, andMatchProductsfieldsBundleRulesYamlDTO andBundleproperty toRulesConfigurationYamlBundleRulesYamlin the static YAML context (ChangelogYamlStaticContext.cs)Config loader —
ChangelogConfigurationLoader.csParseBundleRuleswith mutual-exclusivity validation (exclude_products+include_productstogether → error), product ID normalization (_→-) and validation against known product IDs, andmatch_productsparsingBundling service —
ChangelogBundlingService.csmatchResultand beforeBuildBundle--input-productsApplyBundleProductFilteremits[-bundle-exclude]/[-bundle-include]warnings for each excluded entryDocumentation
config/changelog.example.yml— commentedrules.bundleexampledocs/contribute/changelog.md— newrules.bundlesection, updated match inheritance diagram and validation tabledocs/cli/release/changelog-bundle.md— new "Bundle-time product filtering" sectiondocs/cli/release/changelog-remove.md—rules.bundlerow in the ignored fields tabledocs/syntax/changelog.md— new "Filtering entries at bundle time" sectionTests — 7 new tests across
BundleChangelogsTests.csandChangelogConfigurationTests.cs--allprimary filter still respectsrules.bundle--input-productsprimary filter bypassesrules.bundleSteps for testing
/path/to/GitHub/docs-builder/.artifacts/publish/docs-builder/release/docs-builder changelog bundle \ --config ./docs/changelog.yml \ --directory ./docs/changelog \ --output ./docs/releases/security/test.yaml \ --output-products "security 9.3.0 *" --resolve \ --prs ./docs/9.3.0-security.txt --repo kibana --owner elasticGenerative AI disclosure
Tool(s) and model(s) used: claude-4.6-sonnet-medium