Skip to content

Commit f5fbfc9

Browse files
committed
Add changelog render --no-descriptions
1 parent b8d31e3 commit f5fbfc9

11 files changed

Lines changed: 488 additions & 13 deletions

File tree

docs/cli/changelog/render.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ The `render` command automatically discovers and merges `.amend-*.yaml` files wi
6262
: When disabled (default), entries are rendered as flattened bulleted lists with PR/issue links inline and Impact/Action sections indented.
6363
: This flag only affects markdown output; AsciiDoc output always uses its standard format.
6464

65+
`--no-descriptions`
66+
: Optional: Hide changelog record descriptions from output.
67+
: Defaults to false (descriptions are shown).
68+
: When enabled, entry titles, PR/issue links, Impact and Action sections remain visible.
69+
: Bundle-level descriptions (release intro text) are unaffected.
70+
: Works with both markdown and asciidoc output formats.
71+
6572
`--title <string?>`
6673
: Optional: The title to use for section headers, directories, and anchors in output files.
6774
: Defaults to the version in the first bundle. When omitted, ISO date targets are formatted for display the same way as the `{changelog}` directive (e.g., `2026-05-04` becomes "May 4, 2026", `2026-05` becomes "May 2026"), while directory names and heading anchors continue to use the raw target slug.

src/services/Elastic.Changelog/Rendering/Asciidoc/AsciidocRendererBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ private static void RenderEntryTitleAndLinks(StringBuilder sb, ChangelogEntry en
6363
/// <summary>
6464
/// Renders an entry's description with optional comment handling and list continuation
6565
/// </summary>
66-
private static void RenderEntryDescription(StringBuilder sb, ChangelogEntry entry, bool shouldHide, bool needsContinuation = true)
66+
private static void RenderEntryDescription(StringBuilder sb, ChangelogEntry entry, ChangelogRenderContext context, bool shouldHide, bool needsContinuation = true)
6767
{
68-
if (string.IsNullOrWhiteSpace(entry.Description))
68+
if (context.HideDescriptions || string.IsNullOrWhiteSpace(entry.Description))
6969
return;
7070

7171
_ = sb.AppendLine();
@@ -113,7 +113,7 @@ protected void RenderBasicEntry(StringBuilder sb, ChangelogEntry entry, Changelo
113113
{
114114
var (entryRepo, _, hideLinks, shouldHide) = ChangelogRenderUtilities.GetEntryContext(entry, context);
115115
RenderEntryTitleAndLinks(sb, entry, entryRepo, hideLinks, shouldHide);
116-
RenderEntryDescription(sb, entry, shouldHide, needsContinuation: !string.IsNullOrWhiteSpace(entry.Description));
116+
RenderEntryDescription(sb, entry, context, shouldHide, needsContinuation: !string.IsNullOrWhiteSpace(entry.Description));
117117
_ = sb.AppendLine();
118118
}
119119

@@ -127,7 +127,7 @@ protected void RenderEntryWithImpactAction(StringBuilder sb, ChangelogEntry entr
127127

128128
// Description needs continuation when it exists
129129
var hasDescription = !string.IsNullOrWhiteSpace(entry.Description);
130-
RenderEntryDescription(sb, entry, shouldHide, needsContinuation: hasDescription);
130+
RenderEntryDescription(sb, entry, context, shouldHide, needsContinuation: hasDescription);
131131

132132
RenderImpactAndAction(sb, entry);
133133
_ = sb.AppendLine();

src/services/Elastic.Changelog/Rendering/ChangelogRenderContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public record ChangelogRenderContext
2121
public required IReadOnlyDictionary<ChangelogEntryType, IReadOnlyCollection<ChangelogEntry>> EntriesByType { get; init; }
2222
public required bool Subsections { get; init; }
2323
public required bool Dropdowns { get; init; }
24+
public required bool HideDescriptions { get; init; }
2425
public required HashSet<string> FeatureIdsToHide { get; init; }
2526
public required Dictionary<ChangelogEntry, HashSet<string>> EntryToBundleProducts { get; init; }
2627
public required Dictionary<ChangelogEntry, string> EntryToRepo { get; init; }

src/services/Elastic.Changelog/Rendering/ChangelogRenderingService.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public record RenderChangelogsArguments
3232
public string[]? HideFeatures { get; init; }
3333
public string? Config { get; init; }
3434
public ChangelogFileType FileType { get; init; } = ChangelogFileType.Markdown;
35+
public bool HideDescriptions { get; init; }
3536

3637
}
3738

@@ -341,6 +342,7 @@ private static ChangelogRenderContext BuildRenderContext(
341342
EntriesByType = entriesByType,
342343
Subsections = input.Subsections,
343344
Dropdowns = input.Dropdowns,
345+
HideDescriptions = input.HideDescriptions,
344346
FeatureIdsToHide = featureIdsToHide,
345347
EntryToBundleProducts = entryToBundleProducts,
346348
EntryToRepo = entryToRepo,

src/services/Elastic.Changelog/Rendering/Markdown/BreakingChangesMarkdownRenderer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public override async Task RenderAsync(ChangelogRenderContext context, Cancel ct
6868
{
6969
// Dropdown rendering (current logic)
7070
_ = sb.AppendLine(InvariantCulture, $"::::{{dropdown}} {ChangelogTextUtilities.Beautify(entry.Title)}");
71-
_ = sb.AppendLine(entry.Description ?? "% Describe the functionality that changed");
71+
if (!context.HideDescriptions)
72+
_ = sb.AppendLine(entry.Description ?? "% Describe the functionality that changed");
7273
_ = sb.AppendLine();
7374
RenderPrIssueLinks(sb, new PrIssueLinkOptions(entry, entryRepo, entryOwner, entryHideLinks));
7475

@@ -92,7 +93,7 @@ public override async Task RenderAsync(ChangelogRenderContext context, Cancel ct
9293
_ = sb.AppendLine();
9394

9495
// Description with proper indentation
95-
if (!string.IsNullOrWhiteSpace(entry.Description))
96+
if (!context.HideDescriptions && !string.IsNullOrWhiteSpace(entry.Description))
9697
{
9798
_ = sb.AppendLine(ChangelogTextUtilities.Indent(entry.Description));
9899
_ = sb.AppendLine();

src/services/Elastic.Changelog/Rendering/Markdown/DeprecationsMarkdownRenderer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public override async Task RenderAsync(ChangelogRenderContext context, Cancel ct
6565
{
6666
// Dropdown rendering (current logic)
6767
_ = sb.AppendLine(InvariantCulture, $"::::{{dropdown}} {ChangelogTextUtilities.Beautify(entry.Title)}");
68-
_ = sb.AppendLine(entry.Description ?? "% Describe the functionality that was deprecated");
68+
if (!context.HideDescriptions)
69+
_ = sb.AppendLine(entry.Description ?? "% Describe the functionality that was deprecated");
6970
_ = sb.AppendLine();
7071
RenderPrIssueLinks(sb, new PrIssueLinkOptions(entry, entryRepo, entryOwner, entryHideLinks));
7172

@@ -89,7 +90,7 @@ public override async Task RenderAsync(ChangelogRenderContext context, Cancel ct
8990
_ = sb.AppendLine();
9091

9192
// Description with proper indentation
92-
if (!string.IsNullOrWhiteSpace(entry.Description))
93+
if (!context.HideDescriptions && !string.IsNullOrWhiteSpace(entry.Description))
9394
{
9495
_ = sb.AppendLine(ChangelogTextUtilities.Indent(entry.Description));
9596
_ = sb.AppendLine();

src/services/Elastic.Changelog/Rendering/Markdown/HighlightsMarkdownRenderer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ public override async Task RenderAsync(ChangelogRenderContext context, Cancel ct
6868
{
6969
// Dropdown rendering (current logic)
7070
_ = sb.AppendLine(InvariantCulture, $"::::{{dropdown}} {ChangelogTextUtilities.Beautify(entry.Title)}");
71-
_ = sb.AppendLine(entry.Description ?? "% Describe the highlight");
71+
if (!context.HideDescriptions)
72+
_ = sb.AppendLine(entry.Description ?? "% Describe the highlight");
7273
_ = sb.AppendLine();
7374
RenderPrIssueLinks(sb, new PrIssueLinkOptions(entry, entryRepo, entryOwner, entryHideLinks));
7475
_ = sb.AppendLine("::::");
@@ -81,7 +82,7 @@ public override async Task RenderAsync(ChangelogRenderContext context, Cancel ct
8182
_ = sb.AppendLine();
8283

8384
// Description with proper indentation
84-
if (!string.IsNullOrWhiteSpace(entry.Description))
85+
if (!context.HideDescriptions && !string.IsNullOrWhiteSpace(entry.Description))
8586
{
8687
_ = sb.AppendLine(ChangelogTextUtilities.Indent(entry.Description));
8788
_ = sb.AppendLine();

src/services/Elastic.Changelog/Rendering/Markdown/IndexMarkdownRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private static void RenderEntriesByArea(
240240
}
241241
}
242242

243-
if (!string.IsNullOrWhiteSpace(entry.Description))
243+
if (!context.HideDescriptions && !string.IsNullOrWhiteSpace(entry.Description))
244244
{
245245
_ = sb.AppendLine(entryHideLinks && hasCommentedLinks ? " " : "");
246246
_ = sb.AppendLine();

src/services/Elastic.Changelog/Rendering/Markdown/KnownIssuesMarkdownRenderer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public override async Task RenderAsync(ChangelogRenderContext context, Cancel ct
6565
{
6666
// Dropdown rendering (current logic)
6767
_ = sb.AppendLine(InvariantCulture, $"::::{{dropdown}} {ChangelogTextUtilities.Beautify(entry.Title)}");
68-
_ = sb.AppendLine(entry.Description ?? "% Describe the known issue");
68+
if (!context.HideDescriptions)
69+
_ = sb.AppendLine(entry.Description ?? "% Describe the known issue");
6970
_ = sb.AppendLine();
7071
RenderPrIssueLinks(sb, new PrIssueLinkOptions(entry, entryRepo, entryOwner, entryHideLinks));
7172

@@ -89,7 +90,7 @@ public override async Task RenderAsync(ChangelogRenderContext context, Cancel ct
8990
_ = sb.AppendLine();
9091

9192
// Description with proper indentation
92-
if (!string.IsNullOrWhiteSpace(entry.Description))
93+
if (!context.HideDescriptions && !string.IsNullOrWhiteSpace(entry.Description))
9394
{
9495
_ = sb.AppendLine(ChangelogTextUtilities.Indent(entry.Description));
9596
_ = sb.AppendLine();

src/tooling/docs-builder/Commands/ChangelogCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,7 @@ async static (s, collector, state, ctx) => await s.RemoveChangelogs(collector, s
11531153
/// <param name="output">Optional: Output directory for rendered files. Defaults to current directory</param>
11541154
/// <param name="subsections">Optional: Group entries by area/component in subsections. For breaking changes with a subtype, groups by subtype instead of area. Defaults to false</param>
11551155
/// <param name="dropdowns">Optional: Render separated types (breaking changes, deprecations, known issues, highlights) as MyST dropdowns. When false (default), renders as flattened bulleted lists. Defaults to false</param>
1156+
/// <param name="noDescriptions">Optional: Hide changelog record descriptions from output. When enabled, entry titles, PR/issue links, Impact and Action sections remain visible. Bundle-level descriptions are unaffected. Defaults to false</param>
11561157
/// <param name="title">Optional: Title to use for section headers in output files. Defaults to version from first bundle</param>
11571158
/// <param name="ctx"></param>
11581159
[Command("render")]
@@ -1164,6 +1165,7 @@ public async Task<int> Render(
11641165
string? output = null,
11651166
bool subsections = false,
11661167
bool dropdowns = false,
1168+
bool noDescriptions = false,
11671169
string? title = null,
11681170
Cancel ctx = default
11691171
)
@@ -1196,6 +1198,7 @@ public async Task<int> Render(
11961198
Title = title,
11971199
Subsections = subsections,
11981200
Dropdowns = dropdowns,
1201+
HideDescriptions = noDescriptions,
11991202
HideFeatures = allFeatureIds.Count > 0 ? allFeatureIds.ToArray() : null,
12001203
FileType = ft.Value,
12011204
Config = config

0 commit comments

Comments
 (0)