Re-add changelog render warning messages #2570
Merged
+170
−3
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 builds on top of the changes in #2569
Per Block creation or publishing "When you run the docs-builder changelog render command, changelog entries that match the specified products and areas or types are commented out of the documentation output files. The command will emit warnings indicating which changelog entries were commented out and why."
Those messages seem to have disappeared in recent refactorings, however.
I suspect this was not intentional, so this PR re-adds and improves them (to mention the PR number if possible).
If it was intentional and they're being logged somewhere else, that's fine as long as they are actionable.
Summary of Changes
Enhanced Warning Messages for Blocked Changelog Entries
Changes to
ChangelogRenderingService.csAdded
GetEntryIdentifier:ChangelogTextUtilities.ExtractPrNumbercontext.EntryToRepo, falling back tocontext.Repo"for PR {number}"if a PR number is found, otherwise"'{title}'"Updated warning message format:
"Changelog entry '{entry.Title}' will be commented out...""Changelog entry {entryIdentifier} will be commented out...""Changelog entry for PR 100 will be commented out because it matches block configuration: area 'Allocation'""Changelog entry 'Blocked Allocation feature' will be commented out because it matches block configuration: area 'Allocation'"(fallback when no PR)Changes to
BlockConfigurationTests.csElastic.Documentation.Diagnostics.Severity.WarningDocumentation.Diagnostics.Severity.WarningBenefits
Testing
RenderChangelogs_WithBlockedEntries_EmitsWarningstest verifies warnings are emitted correctlyExamples
When testing a Cloud Serverless variation of the files in elastic/elasticsearch#140795, the
changelog rendercommand now outputs messages like this:Generative AI disclosure
Tool(s) and model(s) used: composer-1