-
Notifications
You must be signed in to change notification settings - Fork 201
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
YAML consolidation prelude: new YAML dump APIs (FR-702) #251
YAML consolidation prelude: new YAML dump APIs (FR-702) #251
Conversation
Draft as it depends on #250 |
c68271a
to
b605144
Compare
b605144
to
6920acc
Compare
Codecov Report
@@ Coverage Diff @@
## main #251 +/- ##
==========================================
+ Coverage 99.12% 99.13% +0.01%
==========================================
Files 60 60
Lines 10229 10404 +175
==========================================
+ Hits 10139 10314 +175
Misses 90 90
Continue to review full report at Codecov.
|
bb22c20
to
086c4c8
Compare
4744eb7
to
2496e6f
Compare
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.
Thank you Simon! This is another great step in consolidating our YAML parsing story.
It is looking very good overall. I asked for some clarification and mentioned a few nitpicks in the inline comments. We should be good to merge this after those are resolved!
Also, I can confirm that the netplan_state_write_yaml()
function isn't used anywhere and was never released. So we're good to "break" that API.
This allows for more flexibility than using filenames. The implementation is split in two functions to allow for future variants, i.e. updating an existing netplan configuration tree. This patch is technically an API break but the removed API was never released. V2: * use a helper function netplan_state_has_nondefault_globals() * fix the write_netplan_conf_full behavior on empty state to not create an empty file * DRASTICALLY simplify the implementation of netplan_state_dump_yaml(), fixing a leak by not using a new list in the first place
2496e6f
to
2815606
Compare
This API is also using file descriptors for flexibility. The idea is to be able to copy only part of a YAML document based on a "prefix", that is subsequent keys into YAML maps, separated by '\t' characters. V2: add some comments and use better names for the static helpers
2815606
to
b10ff76
Compare
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.
Thank you for addressing the comments, especially the netplan_state_nondefault_globals()
function should avoid issues with our snapd integration so good idea going with option (3) there!
LGTM. Let's merge this.
Description
Introduce a couple of APIs that are needed for the various YAML consolidation efforts. Note that this is technically an API break, but the function that is removed has never been part of a release, so this should be OK.
Checklist
make check
successfully.make check-coverage
).