Retire rules.publish from changelog render command#2919
Open
Conversation
6 tasks
- Remove rules.publish filtering logic from render command (ShouldHideEntry, GetComponent) - Delete EmitBlockedEntryWarnings and related blocking methods - Add deprecation warning when rules.publish is present in config - Set Rules.Publish to null so render never applies it - Delete dead code: LoadPublishBlocker() and related tests - Update all render-related tests to reflect the retirement - Update documentation to note render command does not use rules.publish - Use pragma directives to suppress unused parameter warnings This fully retires rules.publish from changelog render, making PR #2889 (multi-product rule resolution fix) unnecessary since that code path is removed. Bundle-side rules.bundle continues to work independently for filtering at bundle time.
🔍 Preview links for changed docs |
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
Relates to #2917
Retires
rules.publishfrom thechangelog rendercommand.The retirement is backward-compatible and includes clear user communication through deprecation warnings.
Scope
rules.publishusage from thechangelog renderCLI pathReleaseNotesSerialization.LoadPublishBlocker()(dead code after retirement)Implementation
1.
ChangelogRenderUtilitiesrules.publishblock entirely. Keep only feature-id check. Whencontext?.Configuration?.Rules?.Publishis present, it is no longer applied;ShouldHideis determined solely byfeatureIdsToHide.GetPublishBlockerForEntry. Always useentry.Areas?[0] ?? string.Emptyfor subsection grouping (align with directive behavior).GetPublishBlockerForEntryandGetPublishBlockerForProduct(both private).2.
ChangelogRenderingServicerules.publishlogic. Simplest: remove the call toEmitBlockedEntryWarningsand delete the method.GetPublishBlockerForProductandGetBlockReasons(only used for publish-rule warnings).GetEntryIdentifierif it has other uses; verify it's only for publish warnings before removing.3.
ChangelogConfigurationLoaderWhen
rulesYaml.Publish != null, emit a deprecation warning:"rules.publish is deprecated and no longer used by the changelog render command. Move type/area filtering to rules.bundle, which applies at bundle time instead of render time.". Parse and load normally but setRules.Publish = nullso render command never sees it.This approach:
4. Test updates — BlockConfigurationTests (tests/Elastic.Changelog.Tests/Changelogs/Render/BlockConfigurationTests.cs)
All tests in this file exercise
rules.publishbehavior. Withrules.publishretired:rules.publishis ignored:exclude_areas: [Allocation]) should now produce visible entries.5. Remove dead code
ReleaseNotesSerialization.LoadPublishBlocker()from src/Elastic.Documentation.Configuration/ReleaseNotes/ReleaseNotesSerialization.cs6. Other test updates
config.Rules.Publishis non-null now need updates. With our approach, configs that haverules.publishwill haveRules.Publish = null. Update assertions accordingly.Key Changes Summary
Code Removals:
BlockConfigurationTests.cs(all rules.publish render tests)LoadPublishBlockerTests.cs(dead code)ChangelogRenderingService.cs(render blocking logic)ReleaseNotesSerialization.cs(dead code)ChangelogRenderUtilities.cs(simplified filtering)Code Additions/Updates:
ChangelogConfigurationLoader.csChangelogConfigurationTests.csto verify Publish = null behaviorNet Result: 2,325 lines deleted, 50 lines added = cleaner, simpler codebase
Impact
rules.publishtorules.bundleThe implementation is production-ready and aligns the
changelog rendercommand with the{changelog}directive, which already doesn't userules.publish.Generative AI disclosure
Tool(s) and model(s) used: composer-1.5, claude-4.5-haiku