Skip to content

Commit 4301061

Browse files
authored
Edit comments in changelog file (#2337)
1 parent ee9dc32 commit 4301061

File tree

2 files changed

+84
-46
lines changed

2 files changed

+84
-46
lines changed

src/services/Elastic.Documentation.Services/Changelog/ChangelogConfiguration.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,35 @@ public class ChangelogConfiguration
1111
{
1212
public List<string> AvailableTypes { get; set; } =
1313
[
14-
"feature",
15-
"enhancement",
16-
"bug-fix",
17-
"known-issue",
18-
"breaking-change",
19-
"deprecation",
20-
"docs",
21-
"regression",
22-
"security",
23-
"other"
14+
"feature", // A new feature or enhancement.
15+
"enhancement", // An improvement to an existing feature.
16+
"bug-fix", // A bug fix.
17+
"known-issue", // A problem that is known to exist in the product.
18+
"breaking-change", // A breaking change to the documented behavior of the product.
19+
"deprecation", // Functionality that is deprecated and will be removed in a future release.
20+
"docs", // Major documentation changes or reorganizations.
21+
"regression", // Functionality that no longer works or behaves incorrectly.
22+
"security", // An advisory about a potentialsecurity vulnerability.
23+
"other" // Changes that do not fit into any of the other categories.
2424
];
2525

2626
public List<string> AvailableSubtypes { get; set; } =
2727
[
28-
"api",
29-
"behavioral",
30-
"configuration",
31-
"dependency",
32-
"subscription",
33-
"plugin",
34-
"security",
35-
"other"
28+
"api", // A change that breaks an API.
29+
"behavioral", // A change that breaks the way something works.
30+
"configuration", // A change that breaks the configuration.
31+
"dependency", // A change that breaks a dependency, such as a third-party product.
32+
"subscription", // A change that breaks licensing behavior.
33+
"plugin", // A change that breaks a plugin.
34+
"security", // A change that breaks authentication, authorization, or permissions.
35+
"other" // A breaking change that do not fit into any of the other categories.
3636
];
3737

3838
public List<string> AvailableLifecycles { get; set; } =
3939
[
40-
"preview",
41-
"beta",
42-
"ga"
40+
"preview", // A technical preview of a feature or enhancement.
41+
"beta", // A beta release of a feature or enhancement.
42+
"ga", // A generally available release of a feature or enhancement.
4343
];
4444

4545
public List<string>? AvailableAreas { get; set; }

src/services/Elastic.Documentation.Services/ChangelogService.cs

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -234,39 +234,77 @@ private string GenerateYaml(ChangelogData data, ChangelogConfiguration config)
234234
var typesList = string.Join("\n", config.AvailableTypes.Select(t => $"# - {t}"));
235235

236236
// Build subtypes list
237-
var subtypesList = config.AvailableSubtypes.Count > 0
238-
? "\n# It can be one of:\n" + string.Join("\n", config.AvailableSubtypes.Select(s => $"# - {s}"))
239-
: string.Empty;
237+
var subtypesList = string.Join("\n", config.AvailableSubtypes.Select(s => $"# - {s}"));
238+
239+
// Build lifecycles list
240+
var lifecyclesList = string.Join("\n", config.AvailableLifecycles.Select(l => $"# - {l}"));
240241

241242
// Add schema comments using raw string literal
242243
var result = $"""
243-
##### Automated fields #####
244+
##### Required fields #####
244245
245-
# These fields are likely generated when the changelog is created and unlikely to require edits
246+
# title:
247+
# A required string that is a short, user-facing headline.
248+
# (Max 80 characters)
246249
247-
# pr: An optional string that contains the pull request number
248-
# issues: An optional array of strings that contain URLs for issues that are relevant to the PR
249-
# type: A required string that contains the type of change
250+
# type:
251+
# A required string that contains the type of change
250252
# It can be one of:
251253
{typesList}
252-
# subtype: An optional string that applies only to breaking changes{subtypesList}
253-
# products: A required array of objects that denote the affected products
254-
# Each product object contains:
255-
# - product: A required string with a predefined product ID
256-
# - target: An optional string with the target version or date
257-
# - lifecycle: An optional string (preview, beta, ga)
258-
# areas: An optional array of strings that denotes the parts/components/services affected
259-
260-
##### Non-automated fields #####
261254
262-
# These fields might be generated when the changelog is created but are likely to require edits
263-
264-
# title: A required string that is a short, user-facing headline (Max 80 characters)
265-
# description: An optional string that provides additional information (Max 600 characters)
266-
# impact: An optional string that describes how the user's environment is affected
267-
# action: An optional string that describes what users must do to mitigate
268-
# feature-id: An optional string to associate with a unique feature flag
269-
# highlight: An optional boolean for items that should be included in release highlights
255+
# products:
256+
# A required array of objects that denote the affected products
257+
# Each product object contains:
258+
#
259+
# - product:
260+
# A required string with a valid product ID.
261+
# Valid values are defined in https://github.com/elastic/docs-builder/blob/main/config/products.yml
262+
#
263+
# target:
264+
# An optional string with the target version or date.
265+
#
266+
# lifecycle:
267+
# An optional string for new features or enhancements that have a specific availability.
268+
# It can be one of:
269+
{lifecyclesList}
270+
271+
##### Optional fields #####
272+
273+
# action:
274+
# An optional string that describes what users must do to mitigate
275+
# the impact of a breaking change or known issue.
276+
277+
# areas:
278+
# An optional array of strings that denotes the parts/components/services
279+
# of the product that are affected.
280+
281+
# description:
282+
# An optional string that provides additional information.
283+
# (Max 600 characters).
284+
285+
# feature-id:
286+
# An optional string to associate a feature or enhanceent with a
287+
# unique feature flag.
288+
289+
# highlight:
290+
# An optional boolean for items that should be included in release
291+
# highlights or the UI to draw user attention.
292+
293+
# impact:
294+
# An optional string that describes how the user's environment is
295+
# affected by a breaking change or known issue.
296+
297+
# issues:
298+
# An optional array of strings that contain the issues that are
299+
# relevant to the PR.
300+
301+
# pr:
302+
# An optional string that contains the pull request number.
303+
304+
# subtype:
305+
# An optional string that applies only to breaking changes.
306+
# It can be one of:
307+
{subtypesList}
270308
271309
{yaml}
272310
""";

0 commit comments

Comments
 (0)