Skip to content

Conversation

@imobachgs
Copy link
Contributor

@imobachgs imobachgs commented May 14, 2025

Problem

While working on the agama monitor command, I needed to use the Event enum, which is defined in agama-server, from agama-lib. agama-lib is a dependency of agama-server, so I decided to move the Event to agama-lib. However, it depends on some network stuff which is defined in agama-server. So I had to move more stuff to agama-lib.

Let's put aside the fact that we need to improve the Event enum (turning it into a composition of smaller events).

Solution

To improve the code organization, I have added a new agama-network package which the business logic for the network area resides now. It is a big change, but it brings some benefits:

  • Better code organization: most of the network code is in a single place.
  • In the future, if we follow this approach with other areas, the build time should improve.

Additionally, the agama-utils package contains OpenAPI and D-Bus utilities but, in the future, it could even contain the BaseHTTPClient and other reusable code.

Future work

  • The settings module should live in agama-lib, as it can be considered kind of an interface to the network settings.
  • Consider whether the types module still makes sense.

Testing

  • Tested manually

@imobachgs imobachgs requested a review from teclator May 14, 2025 06:08
@imobachgs imobachgs merged commit 9f6edce into master May 14, 2025
6 of 8 checks passed
@imobachgs imobachgs deleted the agama-network branch May 14, 2025 08:47
imobachgs added a commit that referenced this pull request May 14, 2025
Follow up of #2357.

- Enable serde support for uuid. The package is building in OBS, but
failing locally from a clean build.
- Update the changes file for #2357.
@imobachgs imobachgs mentioned this pull request May 26, 2025
imobachgs added a commit that referenced this pull request May 26, 2025
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.

3 participants