Skip to content

Commit

Permalink
Update metadata schema with new fields without enforcing them (#12498)
Browse files Browse the repository at this point in the history
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

First PR to update metadata schema without enforcing it as suggested at
#12464 (comment).

<!-- Issue number if applicable -->
#### Link to tracking issue
Related to
#12359

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: ChrsMark <[email protected]>
  • Loading branch information
ChrsMark authored Feb 26, 2025
1 parent 66d83f0 commit 4afbfbd
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
25 changes: 25 additions & 0 deletions .chloggen/update_metadata_schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: mdatagen

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Update metadata schema with new fields without enforcing them

# One or more tracking issues or pull requests related to the change
issues: [12359]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
20 changes: 14 additions & 6 deletions cmd/mdatagen/internal/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,20 @@ type Codeowners struct {
}

type Status struct {
Stability StabilityMap `mapstructure:"stability"`
Distributions []string `mapstructure:"distributions"`
Class string `mapstructure:"class"`
Warnings []string `mapstructure:"warnings"`
Codeowners *Codeowners `mapstructure:"codeowners"`
UnsupportedPlatforms []string `mapstructure:"unsupported_platforms"`
Stability StabilityMap `mapstructure:"stability"`
Distributions []string `mapstructure:"distributions"`
Class string `mapstructure:"class"`
Warnings []string `mapstructure:"warnings"`
Codeowners *Codeowners `mapstructure:"codeowners"`
UnsupportedPlatforms []string `mapstructure:"unsupported_platforms"`
Deprecation DeprecationMap `mapstructure:"deprecation"`
}

type DeprecationMap map[string]DeprecationInfo

type DeprecationInfo struct {
Date string `mapstructure:"date"`
Migration string `mapstructure:"migration"`
}

var validClasses = []string{
Expand Down
5 changes: 5 additions & 0 deletions cmd/mdatagen/metadata-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ status:
stable: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
deprecated: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
unmaintained: [<metrics|traces|logs|traces_to_metrics|metrics_to_metrics|logs_to_metrics|extension,converter,provider>]
# [WIP] Will be a requirement for deprecated components: The deprecation information for the deprecated components
deprecation:
<component>:
date: string
migration: string
# Optional: The distributions that this component is bundled with (For example core or contrib). See statusdata.go for a list of common distros.
distributions: [string]
# Optional: A list of warnings that should be brought to the attention of users looking to use this component
Expand Down

0 comments on commit 4afbfbd

Please sign in to comment.