-
Notifications
You must be signed in to change notification settings - Fork 33
Add docs-builder release-notes create command #2298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 67e4f85
Fix IDE0002 linting error
lcawl dd3a7c4
Change headline to title command option
lcawl 5f46774
Potential fix for pull request finding 'Call to System.IO.Path.Combine'
lcawl 26a1f69
Apply github-code-quality suggestions
lcawl a9be764
Fix formatting
lcawl 6e34670
Merge branch 'main' into feature/release-notes
lcawl 7f940c6
Use --products instead of --product, target, and lifecycle options
lcawl 155335e
Merge branch 'main' into feature/release-notes
lcawl c8f3633
Remove --id command option
lcawl e766a3f
Rename command to changelog add
lcawl 2492be2
Add config command option
lcawl c255c5e
Rename config example; remove labelmappings
lcawl a7f16ac
Add areas and products to the config
lcawl 7e2cce7
Validate type, subtype, and lifecycle
lcawl 7b2eeb4
Potential fix for pull request finding 'Missed opportunity to use Where'
lcawl 0b1054d
Potential fix for pull request finding 'Nested 'if' statements can be…
lcawl 66d67ec
Fix linting
lcawl 7915e92
Potential fix for pull request finding 'Missed opportunity to use Where'
lcawl ace3790
Potential fix for pull request finding 'Nested 'if' statements can be…
lcawl 9ce0442
Rename files
lcawl 660847e
Use raw string literal
lcawl ec4157e
Potential fix for pull request finding 'Missed opportunity to use Where'
lcawl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
lcawl marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
src/services/Elastic.Documentation.Services/ReleaseNotes/ReleaseNotesConfiguration.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; } = []; | ||
| } |
35 changes: 35 additions & 0 deletions
35
src/services/Elastic.Documentation.Services/ReleaseNotes/ReleaseNotesData.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; } | ||
| } |
27 changes: 27 additions & 0 deletions
27
src/services/Elastic.Documentation.Services/ReleaseNotes/ReleaseNotesInput.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; } | ||
| } | ||
|
|
15 changes: 15 additions & 0 deletions
15
src/services/Elastic.Documentation.Services/ReleaseNotes/ReleaseNotesYamlStaticContext.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.