-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add ability to marshal yaml-tagged structs #10282
Conversation
Thanks for digging into this. Overall I think this is a clean solution to the problem that will likely adequately address it. I do have a few questions:
I can try to find answers for these as well, just wasn't sure what you may have found. |
@evan-bradley, #10200 looks like a pretty good solution too. I am not very confident in my understanding how this all fits together but it seems 10200 tries to solve it at a higher level by normalizing the two styles, while this PR tries to redirect to what might be the more "native" way to do things.
Can you give me an example? I focused mostly on working towards some test cases so easily could have overlooked this. If an example of this fit into the test cases I can try to adapt this PR to handle it.
Off the top of my head I suppose more specific maps e.g. |
The Prometheus
Specifically, here's a snippet of a
Types like |
I'm probably missing something because I'm not very familiar with the internals of the
What's the context of the
Again probably missing something but why would it render to a string? I would expect a |
@djaglowski and I had an offline discussion about this yesterday, here were our outcomes:
Given that we're okay with the difference in behavior between this PR and #10200, I would say that I prefer this to #10200 since it is simpler and allows us to rely on a third-party library rather than have an implicit dependency on that library's struct tags. I will also follow up on the concrete differences in the final YAML representation between this approach and #10200. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good, I'll run some tests to compare it to #10200.
This will need a changelog entry as well.
Follow ups:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10282 +/- ##
==========================================
+ Coverage 92.53% 92.56% +0.03%
==========================================
Files 388 387 -1
Lines 18317 18269 -48
==========================================
- Hits 16949 16911 -38
+ Misses 1022 1011 -11
- Partials 346 347 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I tested this with a local build and everything looked like how I would expect. Thanks for taking this.
Possible solution for #10139 (comment)
More thorough explanation here: #10139 (comment)
Some open questions: