Skip to content

Conversation

@ancorgs
Copy link
Contributor

@ancorgs ancorgs commented Oct 17, 2025

Pull request created to discuss some aspects about the code organization.

  1. I created the concept of Section for 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 that Agama::Storage::DevicegraphConversions::ToJSONConversions::Section::Block was already too much.
  2. For symmetry with the other conversions, I created a DevicegraphConversions::ToJSON class and a DevicegraphConversions::ToJSONConversions::Devicegraph one. But I find the second to be unnecessary. It's just one extra level but with the same responsibilities and API.
  3. I decided to nest the partitions directly on the "partitionable" device instead of doing it inside of :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.
  4. I separated the concept of sections and nested devices. There is indeed a semantical difference. But honestly I only separated the concept to avoid some kind of "circular dependency" (it is not elegant if the sections create devices because then ToJSONConversions::Device would require the sections and some section may require ToJSONConversions::Device).

@coveralls
Copy link

coveralls commented Oct 17, 2025

Coverage Status

coverage: 63.767% (+0.2%) from 63.577%
when pulling 40e13a3 on ancorgs:json_devicegraph2
into a74ccf2 on agama-project:master.

@ancorgs ancorgs force-pushed the json_devicegraph2 branch 10 times, most recently from 3ee70bc to cadcd40 Compare October 21, 2025 08:08
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.

2 participants