Fix changelog render with publishing blocks #2568
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.
Fixes #2544
Overview
Fixed a regression where changelog entries weren't commented out based on
block>publishconfiguration inchangelog.yml, and added tests to prevent regressions.NOTE: There is an outstanding enhancement to remove the area sections when they're empty. However, that behaviour existed before this regression so we can fix it in a subsequent PR IMO.
Changes Made
1. Fixed Block Configuration Regression
Modified Files
src/services/Elastic.Changelog/Rendering/ChangelogRenderContext.csConfigurationproperty to passChangelogConfigurationthrough the rendering pipelinesrc/services/Elastic.Changelog/Rendering/ChangelogRenderUtilities.csShouldHideEntryto check block configuration in addition to feature IDsGetPublishBlockerForProducthelper to resolve product-specific blockers (with fallback to global blockers)src/services/Elastic.Changelog/Rendering/ChangelogRenderingService.csBuildRenderContextto accept and pass the configuration to the render contextRenderChangelogsto pass configuration toBuildRenderContextRenderer Updates (all markdown and asciidoc renderers):
src/services/Elastic.Changelog/Rendering/Markdown/IndexMarkdownRenderer.cssrc/services/Elastic.Changelog/Rendering/Markdown/BreakingChangesMarkdownRenderer.cssrc/services/Elastic.Changelog/Rendering/Markdown/DeprecationsMarkdownRenderer.cssrc/services/Elastic.Changelog/Rendering/Markdown/KnownIssuesMarkdownRenderer.cssrc/services/Elastic.Changelog/Rendering/Asciidoc/AsciidocRendererBase.csShouldHideEntryfor block configuration checking2. Added Comprehensive Tests
New File:
tests/Elastic.Changelog.Tests/Changelogs/Render/BlockConfigurationTests.csAdded 7 test cases covering:
<!-- -->)How It Works
When rendering changelog entries:
BundleProductIds)block.product['product-id'].publish)block.publish) if no product-specific blocker exists%prefix for markdown<!-- -->HTML block commentsTesting
All tests pass:
Impact
Example Use Case
For a configuration like:
Entries with the "Allocation" area for the
cloud-serverlessproduct are now correctly commented out in the rendered markdown files, preventing them from appearing in the published documentation.Generative AI disclosure
Tool(s) and model(s) used: composer-1