Skip to content

[cmd/mdatagen] Add support for optional attribute #13007

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sincejune
Copy link
Contributor

@sincejune sincejune commented May 9, 2025

Description

Add support for optional attribute, ref: Conditional Required Attribute

Notes:

  • Add helper.tmpl for helper templates
  • Add With<AttributeName>EventAttribute and With<AttributeName>MetricAttribute for optional attributes
  • Add some helper functions in go files.

Link to tracking issue

Relevant to #12571

Testing

Updated

Documentation

Added

@sincejune sincejune requested review from a team, evan-bradley and dmitryax as code owners May 9, 2025 14:30
Copy link

codecov bot commented May 9, 2025

Codecov Report

Attention: Patch coverage is 97.16981% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.64%. Comparing base (5800834) to head (80f6fa6).

Files with missing lines Patch % Lines
cmd/mdatagen/internal/command.go 92.30% 0 Missing and 2 partials ⚠️
cmd/mdatagen/internal/event.go 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13007      +/-   ##
==========================================
+ Coverage   91.62%   91.64%   +0.01%     
==========================================
  Files         504      504              
  Lines       27888    27960      +72     
==========================================
+ Hits        25553    25624      +71     
+ Misses       1844     1843       -1     
- Partials      491      493       +2     

☔ 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.

@sincejune sincejune marked this pull request as draft May 9, 2025 16:24
@sincejune
Copy link
Contributor Author

I added some helper functions in the Go files to simplify the templates. I'd like to remove the helper functions if possible, but it doesn't seem to be easy.

@sincejune sincejune marked this pull request as ready for review May 9, 2025 17:19
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.

1 participant