Skip to content

[cmd/mdatagen] Implement numeric validation in generated Go config code (#14806) - #15270

Merged
dmitryax merged 1 commit into
open-telemetry:mainfrom
blami:feat/14809
May 26, 2026
Merged

[cmd/mdatagen] Implement numeric validation in generated Go config code (#14806)#15270
dmitryax merged 1 commit into
open-telemetry:mainfrom
blami:feat/14809

Conversation

@blami

@blami blami commented May 7, 2026

Copy link
Copy Markdown
Contributor

Implements support for the JSON Schema numeric validation keywords 'minimum', 'maximum', 'exclusiveMaximum' and 'exclusiveMinimum' in mdatagen config generation pipeline.

Fixes #14806

  • Added unit tests in generation_test.go
  • The samplescraper golden file (generated_config.go) is updated to reflect the new generated output.

@blami
blami requested review from a team and dmitryax as code owners May 7, 2026 17:28
@linux-foundation-easycla

linux-foundation-easycla Bot commented May 7, 2026

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: blami / name: Ondrej Balaz (ce877be)

@blami

blami commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

I wonder if this should also cover multipleOf as none of the other subtasks of #14809 lists it and numeric this one seems to be logical place. Let me know if I should add it.

@dmitryax

dmitryax commented May 8, 2026

Copy link
Copy Markdown
Member

I don't think we have an existing use case for multipleOf at this point. So that can wait until required

@dmitryax
dmitryax enabled auto-merge May 8, 2026 02:41
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.27%. Comparing base (82b7309) to head (ab7dd7a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15270      +/-   ##
==========================================
- Coverage   91.27%   91.27%   -0.01%     
==========================================
  Files         709      709              
  Lines       46203    46218      +15     
==========================================
+ Hits        42171    42184      +13     
- Misses       2817     2818       +1     
- Partials     1215     1216       +1     

☔ View full report in Codecov by Sentry.
📢 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.

auto-merge was automatically disabled May 8, 2026 05:09

Head branch was pushed to by a user without write access

@blami
blami force-pushed the feat/14809 branch 3 times, most recently from 24c1814 to 6b8175e Compare May 8, 2026 12:49
@blami
blami force-pushed the feat/14809 branch 2 times, most recently from ffa2bb1 to ce877be Compare May 9, 2026 00:31
@blami

blami commented May 9, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for approval @dmitryax , I fixed the linter issues (I forgot to run make fmt), should be clean now. As for govulncheck failure I believe that's related to stdlib CVEs fixed in go 1.26.3 and should be clean once build switched to that version.

@dmitryax

Copy link
Copy Markdown
Member

@blami please rebase and fix the CI failures

@blami

blami commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

@dmitryax done, can you re-run the CI? Also if there's a better way to ensure all is clean locally before pushing than just making sure there are no errors in make (as per CONTRIBUTING.md) I'd like to know.

@blami
blami force-pushed the feat/14809 branch 2 times, most recently from bba407a to 06f1a53 Compare May 13, 2026 13:00
@blami

blami commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@dmitryax Can you help me to start the CI workflows? Thanks.

@blami
blami force-pushed the feat/14809 branch 5 times, most recently from 347e0ca to 1e78dd0 Compare May 26, 2026 14:53
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

Implements support for the JSON Schema numeric validation keywords
'minimum', 'maximum', 'exclusiveMaximum' and 'exclusiveMinimum' in
mdatagen config generation pipeline.

<!-- Issue number if applicable -->
Fixes: open-telemetry#14806

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

* Added unit tests in generation_test.go
* The samplescraper golden file (`generated_config.go`) is updated to
reflect the new generated output.
@dmitryax
dmitryax enabled auto-merge May 26, 2026 20:21
@dmitryax
dmitryax added this pull request to the merge queue May 26, 2026
Merged via the queue into open-telemetry:main with commit 5de93b9 May 26, 2026
68 checks passed
@otelbot

otelbot Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @blami! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cmd/mdatagen] Implement numeric validation in generated Go config code

3 participants