Skip to content
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

mdatagen: get package name from metadata #11468

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

braydonk
Copy link
Contributor

@braydonk braydonk commented Oct 16, 2024

Description

I noticed a mistake in my previous PR #11232; some function calls did not pass the correct package name in (passing in "metadata" instead of the intended generated package name). This PR attempts to address the potential for this mistake to even occur by providing a wrapper generateFile function that automatically uses the generated package name from the metadata. The original version of the function that accepts a package name is intact for the templates that are going in the base package instead of the generated one.

Link to tracking issue

Bug originally from #11231
Fixes #11469

Testing

make mdatagen-test

Also added a custom generated package to the sample components, which would have caught the original bug.

Documentation

@braydonk braydonk requested a review from a team as a code owner October 16, 2024 13:31
I noticed a mistake in my previous PR open-telemetry#11232; some function calls did
not pass the correct package name in (passing in "metadata" instead of
the intended generated package name). This PR attempts to address the
potential for this mistake to even occur by providing a wrapper
`generateFile` function that automatically uses the generated package
name from the metadata. The original version of the function that
accepts a package name is intact for the templates that are going in the
base package instead of the generated one.
@braydonk
Copy link
Contributor Author

I believe this change should not need a changelog. It is a fix for a bug that never made it into a release, and otherwise provides no user-visible changes.

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 87.78195% with 65 lines in your changes missing coverage. Please review.

Project coverage is 92.04%. Comparing base (388bae7) to head (a7da76a).

Files with missing lines Patch % Lines
...amplereceiver/internal/custom/generated_metrics.go 91.69% 23 Missing and 2 partials ⚠️
...plereceiver/internal/custom/generated_telemetry.go 65.45% 19 Missing ⚠️
...samplereceiver/internal/custom/generated_config.go 87.30% 4 Missing and 4 partials ⚠️
...ampleprocessor/internal/custom/generated_config.go 88.23% 2 Missing and 2 partials ⚠️
cmd/mdatagen/internal/command.go 66.66% 0 Missing and 3 partials ⚠️
...pleprocessor/internal/custom/generated_resource.go 91.42% 3 Missing ⚠️
...mplereceiver/internal/custom/generated_resource.go 91.42% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11468      +/-   ##
==========================================
- Coverage   92.14%   92.04%   -0.10%     
==========================================
  Files         433      439       +6     
  Lines       20389    20914     +525     
==========================================
+ Hits        18787    19250     +463     
- Misses       1238     1292      +54     
- Partials      364      372       +8     

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

@braydonk
Copy link
Contributor Author

The new coverage issue are just for the generated custom package I added, which I don't think are any more/less covered than the other generated metadata package and are just there as goldens anyway. So I think the codecov can be accepted.

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.

mdatagen: using the wrong package name for a generateFile call
1 participant