Add description-visibility option to changelog directive#3224
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR adds a new Sequence DiagramsequenceDiagram
participant Block as ChangelogBlock
participant Parser as Parser/Validator
participant Renderer as ChangelogInlineRenderer
participant PrivacyCheck as Privacy Logic
participant Output as Rendered Output
Block->>Parser: Parse :description-visibility: option
Parser->>Block: Set DescriptionVisibility enum (auto/keep/hide)
Block->>Renderer: RenderChangelogMarkdown(block with DescriptionVisibility)
Renderer->>Renderer: RenderSingleBundle(descriptionVisibility)
Renderer->>PrivacyCheck: ShouldHideEntryDescriptionsForRepo(bundle, visibility)
alt visibility == auto
PrivacyCheck->>PrivacyCheck: HasAnyPrivateRepoConstituent(bundleRepo)
PrivacyCheck-->>Renderer: hideDescriptions = has_private_repo
else visibility == keep-descriptions
PrivacyCheck-->>Renderer: hideDescriptions = false
else visibility == hide-descriptions
PrivacyCheck-->>Renderer: hideDescriptions = true
end
Renderer->>Renderer: RenderSingleEntry / RenderDetailedEntry
alt hideDescriptions == true
Renderer->>Output: Render title/links only
else hideDescriptions == false
Renderer->>Output: Render title + description
end
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Summary
This PR adds a new option to the changelog directive so that teams can have full control over whether changelog
descriptionfields are shown in the output.Screenshots
Before:
After:
AI implementation details
Behaviour
:description-visibility:on{changelog}with valuesauto(default),keep-descriptions,hide-descriptions.auto: hides per-entrydescriptionwhen the bundle’s repo has no private constituent (+-split repo names vsassembler.ymlprivates — same constituent resolution as links).HasAnyPrivateRepoConstituentmirrors link logic;ShouldHideLinksForReponow delegates to it so split/trim behaviour stays aligned.description(intro prose) is unchanged — only entry bodies / dropdown intros are gated.auto(same spirit as:link-visibility:).Code
ChangelogDescriptionVisibility.csChangelogBlock.csDescriptionVisibility,ParseDescriptionVisibilityChangelogInlineRenderer.csShouldHideEntryDescriptionsForRepo,HasAnyPrivateRepoConstituent, plumbedhideEntryDescriptionsthrough all bullet + dropdown paths (including:type: highlight)Tests
ChangelogDescriptionVisibilityTests.cs— helper unit tests + directive coverage (default/auto, keep, hide, invalid, private-repo case viaRenderChangelogMarkdownafter mutatingPrivateRepositories, matching the hide-links tests).ChangelogBasicTests.cs—ChangelogTitleDescriptionSpacingTestsnow uses:description-visibility: keep-descriptionsso it still verifies body text spacing.Docs
docs/syntax/changelog.md— options table,:description-visibility:section (contrast vs:link-visibility:), rendered-output note distinguishing bundle vs record descriptions.Generative AI disclosure
Tool(s) and model(s) used: composer-2, claude-4-sonnet-thinking