Conversion of devicegraph to json #2815
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request created to discuss some aspects about the code organization.
Sectionfor stuff that used to be D-Bus interfaces (Drive, Block, Filesystem, etc.) But I didn't group all the sections at a separate namespace because I felt thatAgama::Storage::DevicegraphConversions::ToJSONConversions::Section::Blockwas already too much.For symmetry with the other conversions, I created aDevicegraphConversions::ToJSONclass and aDevicegraphConversions::ToJSONConversions::Devicegraphone. But I find the second to be unnecessary. It's just one extra level but with the same responsibilities and API.:partition_table(that is, inside the PartitionTable interface). That's a change compared to the D-BUS interface (they are nested within PartitionTable there). It kind of makes sense from the organization point of view and also from the code point of view (see below), but I'm not 100% sure.ToJSONConversions::Devicewould require the sections and some section may requireToJSONConversions::Device).