Skip to content

[chore][cmd/mdatagen] Align types for mdatagen configs#15659

Open
jkoronaAtCisco wants to merge 3 commits into
open-telemetry:mainfrom
jkoronaAtCisco:mdatagen_config_types
Open

[chore][cmd/mdatagen] Align types for mdatagen configs#15659
jkoronaAtCisco wants to merge 3 commits into
open-telemetry:mainfrom
jkoronaAtCisco:mdatagen_config_types

Conversation

@jkoronaAtCisco

@jkoronaAtCisco jkoronaAtCisco commented Jul 24, 2026

Copy link
Copy Markdown
Member

Description

Replace JSON Schema vocabulary with Go-centric types in mdatagen config schema: int/bool/slice/map instead of integer/boolean/array/object, and merge items/additionalProperties into a single values field.

Testing

Unit tests and sample component aligned.

Documentation

  1. Added list of supported types to README.md file
  2. Metadata.yaml schema aligned

Authorship

  • I, a human, wrote this pull request description myself.

@jkoronaAtCisco
jkoronaAtCisco requested review from a team and dmitryax as code owners July 24, 2026 20:03
@jkoronaAtCisco jkoronaAtCisco changed the title [chpore]align types for mdatagen configs [chore][cmd/mdatagen] Align types for mdatagen configs Jul 24, 2026
@jkoronaAtCisco
jkoronaAtCisco marked this pull request as draft July 24, 2026 20:05
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.02%. Comparing base (52e6bf4) to head (d31ee19).

Files with missing lines Patch % Lines
internal/schemagen/schema.go 16.66% 4 Missing and 1 partial ⚠️
cmd/mdatagen/internal/cfggen/type_ref.go 71.42% 1 Missing and 1 partial ⚠️
cmd/mdatagen/internal/cfggen/docgen.go 87.50% 1 Missing ⚠️
cmd/mdatagen/internal/cfggen/generation.go 97.22% 1 Missing ⚠️
internal/schemagen/resolver.go 50.00% 0 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (85.71%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15659      +/-   ##
==========================================
- Coverage   91.03%   91.02%   -0.02%     
==========================================
  Files         729      729              
  Lines       48491    48463      -28     
==========================================
- Hits        44144    44113      -31     
- Misses       3020     3024       +4     
+ Partials     1327     1326       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jkoronaAtCisco
jkoronaAtCisco marked this pull request as ready for review July 24, 2026 20:28

@dmitryax dmitryax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one nit

if md.Items != nil {
// []T — item type uses propName+"_item", matching MapGoType
collectDefsForSchema(propName+"_item", md.Items, defs)
case "slice", "map":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move them all to enum constants. See the pattern we follow in the repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants