Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
32c80e2
Add release-note create command
lcawl Dec 2, 2025
67e4f85
Fix IDE0002 linting error
lcawl Dec 2, 2025
dd3a7c4
Change headline to title command option
lcawl Dec 2, 2025
5f46774
Potential fix for pull request finding 'Call to System.IO.Path.Combine'
lcawl Dec 2, 2025
26a1f69
Apply github-code-quality suggestions
lcawl Dec 2, 2025
a9be764
Fix formatting
lcawl Dec 2, 2025
6e34670
Merge branch 'main' into feature/release-notes
lcawl Dec 2, 2025
7f940c6
Use --products instead of --product, target, and lifecycle options
lcawl Dec 2, 2025
155335e
Merge branch 'main' into feature/release-notes
lcawl Dec 3, 2025
c8f3633
Remove --id command option
lcawl Dec 3, 2025
e766a3f
Rename command to changelog add
lcawl Dec 3, 2025
2492be2
Add config command option
lcawl Dec 3, 2025
c255c5e
Rename config example; remove labelmappings
lcawl Dec 3, 2025
a7f16ac
Add areas and products to the config
lcawl Dec 3, 2025
7e2cce7
Validate type, subtype, and lifecycle
lcawl Dec 3, 2025
7b2eeb4
Potential fix for pull request finding 'Missed opportunity to use Where'
lcawl Dec 4, 2025
0b1054d
Potential fix for pull request finding 'Nested 'if' statements can be…
lcawl Dec 4, 2025
66d67ec
Fix linting
lcawl Dec 4, 2025
7915e92
Potential fix for pull request finding 'Missed opportunity to use Where'
lcawl Dec 4, 2025
ace3790
Potential fix for pull request finding 'Nested 'if' statements can be…
lcawl Dec 4, 2025
9ce0442
Rename files
lcawl Dec 4, 2025
660847e
Use raw string literal
lcawl Dec 4, 2025
ec4157e
Potential fix for pull request finding 'Missed opportunity to use Where'
lcawl Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions config/release-notes.yml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Release Notes Configuration
# This file configures how PR labels are mapped to YAML fields in release notes fragments
# Place this file as `release-notes.yml` in the `config/` directory

# Available types for release notes
available_types:
- feature
- enhancement
- bug-fix
- known-issue
- breaking-change
- deprecation
- docs
- regression
- security
- other

# Available subtypes for breaking changes
available_subtypes:
- api
- behavioral
- configuration
- dependency
- subscription
- plugin
- security
- other

# Available lifecycle values
available_lifecycles:
- preview
- beta
- ga

# Label mappings - maps GitHub PR labels to YAML field values
label_mappings:
# Maps PR labels to "type" field
type:
bug: bug-fix
enhancement: enhancement
feature: feature
breaking: breaking-change
deprecation: deprecation
security: security
docs: docs
regression: regression
known-issue: known-issue

# Maps PR labels to "subtype" field (for breaking changes)
subtype:
breaking:api: api
breaking:behavioral: behavioral
breaking:config: configuration
breaking:dependency: dependency
breaking:subscription: subscription
breaking:plugin: plugin
breaking:security: security

# Maps PR labels to "product" field
# Add mappings for your products, e.g.:
product:
product:elasticsearch: elasticsearch
product:kibana: kibana
product:elasticsearch-client: elasticsearch-client
product:apm: apm
product:beats: beats
product:elastic-agent: elastic-agent
product:fleet: fleet
product:cloud-hosted: cloud-hosted
product:cloud-enterprise: cloud-enterprise
# Add more product mappings as needed

# Maps PR labels to "area" field
# Areas vary by product - add mappings for your specific areas
area:
area:search: search
area:security: security
area:ml: machine-learning
area:observability: observability
area:index-management: index-management
# Add more area mappings as needed

# Maps PR labels to "lifecycle" field
lifecycle:
lifecycle:preview: preview
lifecycle:beta: beta
lifecycle:ga: ga

# Maps PR labels to "highlight" flag
highlight:
highlight: true
release-highlight: true
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Vecc.YamlDotNet.Analyzers.StaticGenerator" />
<PackageReference Include="YamlDotNet" />
<PackageReference Include="System.IO.Abstractions" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Elastic.Documentation\Elastic.Documentation.csproj"/>
<ProjectReference Include="..\..\Elastic.Documentation.Configuration\Elastic.Documentation.Configuration.csproj"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// 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.Services.ReleaseNotes;

/// <summary>
/// Configuration for release notes generation, including label mappings
/// </summary>
public class ReleaseNotesConfiguration
{
public LabelMappings LabelMappings { get; set; } = new();
public List<string> AvailableTypes { get; set; } =
[
"feature",
"enhancement",
"bug-fix",
"known-issue",
"breaking-change",
"deprecation",
"docs",
"regression",
"security",
"other"
];

public List<string> AvailableSubtypes { get; set; } =
[
"api",
"behavioral",
"configuration",
"dependency",
"subscription",
"plugin",
"security",
"other"
];

public List<string> AvailableLifecycles { get; set; } =
[
"preview",
"beta",
"ga"
];

public static ReleaseNotesConfiguration Default => new();
}

public class LabelMappings
{
/// <summary>
/// Maps PR labels to type values (e.g., "bug" -> "bug-fix")
/// </summary>
public Dictionary<string, string> Type { get; set; } = [];

/// <summary>
/// Maps PR labels to subtype values (e.g., "breaking:api" -> "api")
/// </summary>
public Dictionary<string, string> Subtype { get; set; } = [];

/// <summary>
/// Maps PR labels to product IDs (e.g., "product:elasticsearch" -> "elasticsearch")
/// </summary>
public Dictionary<string, string> Product { get; set; } = [];

/// <summary>
/// Maps PR labels to area values (e.g., "area:search" -> "search")
/// </summary>
public Dictionary<string, string> Area { get; set; } = [];

/// <summary>
/// Maps PR labels to lifecycle values (e.g., "lifecycle:preview" -> "preview")
/// </summary>
public Dictionary<string, string> Lifecycle { get; set; } = [];

/// <summary>
/// Maps PR labels to highlight flag (e.g., "highlight" -> true)
/// </summary>
public Dictionary<string, bool> Highlight { get; set; } = [];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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.Services.ReleaseNotes;

/// <summary>
/// Data structure for release notes YAML file matching the exact schema
/// </summary>
public class ReleaseNotesData
{
// Automated fields
public int Id { get; set; }
public string? Pr { get; set; }
public List<string>? Issues { get; set; }
public string Type { get; set; } = string.Empty;
public string? Subtype { get; set; }
public List<ProductInfo> Products { get; set; } = [];
public List<string>? Areas { get; set; }

// Non-automated fields
public string Title { get; set; } = string.Empty;
public string? Description { get; set; }
public string? Impact { get; set; }
public string? Action { get; set; }
public string? FeatureId { get; set; }
public bool? Highlight { get; set; }
}

public class ProductInfo
{
public string Product { get; set; } = string.Empty;
public string? Target { get; set; }
public string? Lifecycle { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// 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.Services.ReleaseNotes;

/// <summary>
/// Input data for creating a release notes changelog fragment
/// </summary>
public class ReleaseNotesInput
{
public required string Title { get; set; }
public required string Type { get; set; }
public required List<ProductInfo> Products { get; set; }
public string? Subtype { get; set; }
public string[] Areas { get; set; } = [];
public string? Pr { get; set; }
public string[] Issues { get; set; } = [];
public string? Description { get; set; }
public string? Impact { get; set; }
public string? Action { get; set; }
public string? FeatureId { get; set; }
public bool? Highlight { get; set; }
public int? Id { get; set; }
public string? Output { get; set; }
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 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

using YamlDotNet.Serialization;

namespace Elastic.Documentation.Services.ReleaseNotes;

[YamlStaticContext]
[YamlSerializable(typeof(ReleaseNotesData))]
[YamlSerializable(typeof(ProductInfo))]
[YamlSerializable(typeof(ReleaseNotesConfiguration))]
[YamlSerializable(typeof(LabelMappings))]
public partial class ReleaseNotesYamlStaticContext;

Loading
Loading