Retire rules.publish from changelog render command#2919
Conversation
- 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
💤 Files with no reviewable changes (3)
📝 WalkthroughWalkthroughThis pull request deprecates the ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
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