Add render_blockers to changelog config #2426
Merged
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.
This PR augments the
docs-builder changelog renderfunctionality implemented in #2341It relates to
add_blockersfunctionality in #2350Summary
render_blockersfeature to the changelog configuration system to optionally comment out certain changelog entries from the markdown outputAn entry is blocked if:
render_blockersANDNOTE: The products in the
render_blockersdefinition are intentionally matched against the bundle'sproductsrather than against the individual changelogs'products.Examples
Check out the PR and generate the binaries per README.md:
./build.sh clean ./build.sh publishbinaries cd .artifacts/publish/docs-builder/releaseCreate some changelogs with various types and areas, for example:
Create changelog bundles:
Add a changelog configuration file with a
render_blockerssection. For example, create achangelog.ymlfile that contains:Render the serverless bundle and check whether the
render_blockersare heeded.This command returns the following warning messages:
Render the Elasticsearch bundle but add some feature filtering too:
This command generates the following warnings:
Changes made
ChangelogConfiguration.cs)RenderBlockersproperty toChangelogConfigurationasDictionary<string, RenderBlockersEntry>RenderBlockersEntrywith Areas and Types propertieschangelog.yml.example)render_blockerssection with commented examples for products and areasChangelogService.cs)LoadChangelogConfigurationto:available_types,available_subtypes, andavailable_lifecyclesif not specifiedrender_blockerstypes againstavailable_typesRenderChangelogsrender_blockersChangelogData entry, string repo, HashSet<string> bundleProductIds)ShouldBlockEntryto acceptHashSet<string> bundleProductIdsand check those instead ofentry.ProductsentryToBundleProductsto track which bundle products belong to each entryentryToBundleProductsmappingdocs/changelog.yml)ChangelogCommand.cs:Rendermethod signature--configparameterChangelogRenderInputChangelogRenderInput.cs:Configproperty to store the configuration file pathChangelogServiceTests.cs)RenderChangelogs_WithRenderBlockers_CommentsOutMatchingEntries- Tests basic blocking with single productRenderChangelogs_WithRenderBlockers_CommaSeparatedProducts_CommentsOutMatchingEntries- Tests comma-separated product keysRenderChangelogs_WithRenderBlockers_MultipleProductsInEntry_ChecksAllProducts- Tests entries with multiple productsRenderChangelogs_WithRenderBlockers_UsesBundleProductsNotEntryProductsto verify that bundle products are used, not entry productsRenderChangelogs_WithCustomConfigPath_UsesSpecifiedConfigFile- Tests a config file in a custom location (not in `docs/ subdirectory)available_types,available_subtypes, andavailable_lifecyclesrender_blockersLoadChangelogConfigurationinternal:InternalsVisibleToattribute to allow test accessdocs/contribute/changelog.mdwith the render--configoption and a new "Render blockers" section explaining the formatdocs/cli/release/changelog-render.mdwith the new option, and a short blurb and linkThe implementation follows the same pattern [for commenting out changelog entries] as
hideFeaturesbut checks products, areas, and types from the configuration instead of feature IDs from command-line arguments. When a changelog entry matches any values inrender_blockers, it is commented out in the markdown output and a warning is emitted explaining why.All tests pass and the build succeeds. The feature now supports blocking changelog entries by both areas and types, with proper validation and default handling.
Generative AI disclosure
Tool(s) and model(s) used: composer-1 agent