Change feature_id to feature-id in changelogs #2421
Merged
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.
Background
While working on #2412, I encountered this error on the `docs-builder changelog bundle" command:
The command worked when I updated the changelog files to use
feature_id: xxxbut that does not align with the schema in https://docs-v3-preview.elastic.dev/elastic/docs-builder/tree/main/contribute/changelog and AFAICT there was no conscious choice to use underscore and IMO it's less confusing to keep the command option and the schema in sync.Summary
Updated the
docs-builder changelog addcommand and related code to usefeature-idinstead offeature_id.Changes Made:
ChangelogData.cs: Added[YamlMember(Alias = "feature-id", ApplyNamingConventions = false)]to theFeatureIdproperty to ensure YAML serialization usesfeature-idinstead offeature_id.ChangelogServiceTests.cs: Updated the test assertion to check forfeature-idinstead offeature_id.feature-idcorrectly:--feature-idfeature-id:# feature-id:The C# parameter name
featureIdremains camelCase (standard), andConsoleAppFrameworkconverts it to--feature-idfor the CLI. The YAML output now uses feature-id with a hyphen as required.Tests
Alternatives
If it's preferrable to stick with
feature_idin the changelog files, IMO we should change the command option to--featureor--feature_idto avoid confusion.Generative AI disclosure
Tool(s) and model(s) used: composer-1 agent