-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathBundleConfiguration.cs
More file actions
134 lines (115 loc) · 4.7 KB
/
BundleConfiguration.cs
File metadata and controls
134 lines (115 loc) · 4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
namespace Elastic.Documentation.Configuration.Changelog;
/// <summary>
/// Configuration for bundle operations
/// </summary>
public record BundleConfiguration
{
/// <summary>
/// Input directory containing changelog YAML files.
/// Defaults to "docs/changelog"
/// </summary>
public string? Directory { get; init; }
/// <summary>
/// Output directory for bundled changelog files.
/// Defaults to "docs/releases"
/// </summary>
public string? OutputDirectory { get; init; }
/// <summary>
/// Whether to resolve (copy contents of each changelog file into the entries array).
/// Defaults to true
/// </summary>
public bool Resolve { get; init; } = true;
/// <summary>
/// Default bundle description used when no profile-specific description is provided.
/// Supports {version}, {lifecycle}, {owner}, and {repo} placeholders.
/// </summary>
public string? Description { get; init; }
/// <summary>
/// Default GitHub repository name applied to all profiles that do not specify their own.
/// Used for generating correct PR/issue links when the product ID differs from the repo name.
/// </summary>
public string? Repo { get; init; }
/// <summary>
/// Default GitHub repository owner applied to all profiles that do not specify their own.
/// </summary>
public string? Owner { get; init; }
/// <summary>
/// When set (including an empty list), PR/issue references whose resolved <c>owner/repo</c> is not listed
/// are rewritten to <c># PRIVATE:</c> sentinels at bundle time. When absent, no link filtering is applied.
/// Requires <see cref="Resolve"/>.
/// </summary>
public IReadOnlyList<string>? LinkAllowRepos { get; init; }
/// <summary>
/// Whether to show release dates in rendered changelog output.
/// When true, bundles with release-date fields will display "Released: date" text.
/// Defaults to false.
/// </summary>
public bool ShowReleaseDates { get; init; }
/// <summary>
/// Named bundle profiles for different release scenarios.
/// </summary>
public IReadOnlyDictionary<string, BundleProfile>? Profiles { get; init; }
}
/// <summary>
/// A named bundle profile configuration.
/// Profiles can be invoked with a version number or promotion report URL.
/// </summary>
public record BundleProfile
{
/// <summary>
/// Product filter pattern for input changelogs.
/// Format: "product {version} {lifecycle}" where placeholders are substituted at runtime.
/// Examples:
/// - "elasticsearch {version} {lifecycle}"
/// - "cloud-serverless {version} *"
/// </summary>
public string? Products { get; init; }
/// <summary>
/// Output filename pattern.
/// {version} is substituted at runtime.
/// Examples:
/// - "elasticsearch-{version}.yaml"
/// - "serverless-{version}.yaml"
/// </summary>
public string? Output { get; init; }
/// <summary>
/// Output products pattern. When set, overrides the products array derived from matched changelogs.
/// Supports {version} and {lifecycle} placeholders.
/// </summary>
public string? OutputProducts { get; init; }
/// <summary>
/// Profile-specific bundle description. When provided, overrides the bundle.description default.
/// Supports {version}, {lifecycle}, {owner}, and {repo} placeholders.
/// </summary>
public string? Description { get; init; }
/// <summary>
/// GitHub repository name stored on each product in the bundle output.
/// Used for generating correct PR/issue links when the product ID differs from the repo name.
/// </summary>
public string? Repo { get; init; }
/// <summary>
/// GitHub repository owner stored on each product in the bundle output.
/// Used for generating correct PR/issue links. Defaults to "elastic" when not specified.
/// </summary>
public string? Owner { get; init; }
/// <summary>
/// Feature IDs to mark as hidden in the bundle output.
/// When the bundle is rendered, entries with matching feature-id values will be commented out.
/// </summary>
public IReadOnlyList<string>? HideFeatures { get; init; }
/// <summary>
/// Whether to show release dates in rendered changelog output for this profile.
/// When provided, overrides the bundle.show_release_dates default.
/// When true, bundles with release-date fields will display "Released: date" text.
/// </summary>
public bool? ShowReleaseDates { get; init; }
/// <summary>
/// Profile source type. When set to <c>"github_release"</c>, the profile fetches
/// PR references directly from a GitHub release and uses them as the bundle filter.
/// Mutually exclusive with <see cref="Products"/>.
/// </summary>
public string? Source { get; init; }
}