Skip to content

Adapt network to the new config based HTTP API (backend)#2862

Merged
teclator merged 4 commits intoapi-v2from
agama-api-v2_network-backend
Nov 11, 2025
Merged

Adapt network to the new config based HTTP API (backend)#2862
teclator merged 4 commits intoapi-v2from
agama-api-v2_network-backend

Conversation

@teclator
Copy link
Copy Markdown
Contributor

@teclator teclator commented Nov 11, 2025

Problem

There is a new config based HTTP API and all the services needs to be adapted. The aim of this PR is to adapt the network backend service (replace #2840).

Solution

In the new architecture all the Agama modules will live in its own package implementing the actors/service as described in (#2715), but as network was already using a actors model using an enums approach it was decided to use the current service in the first iteration of changes.

Changes done

  • Added the actions for getting the system, proposal and current network configuration using the actual actions passing messages system based on enums.
  • All the structs or types that are related to the API (needs to be serialized) has been moved to agama-utils, it was decided to not depend on agama-lib anymore. The types will be re-exported to be used by agama-network when needed.
  • As the current merge is concatenating the connections array, the patch (updateConfig) will replace the connections with the given one when present, but is something we need to revisit and decide how to do it in a better way.
  • Removed the network web service.
  • As the proposal, system info and config contains similar collections and just change the absence or presence of some of them we have introduced the NetworkCollection and NetworkConnectionCollections in order to do the conversion between them.

TODO

  • Move to the actors/service model using traits instead of enums and adding the issues and progress monitor to the network service.
  • Remove all the actions which are not needed anymore (old network web service).
  • Add unit tests covering the new approach.

@coveralls
Copy link
Copy Markdown

coveralls commented Nov 11, 2025

Coverage Status

coverage: 64.118% (-0.7%) from 64.776%
when pulling f5f25e7 on agama-api-v2_network-backend
into da86580 on api-v2.

teclator and others added 2 commits November 11, 2025 09:26
Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>
@teclator teclator force-pushed the agama-api-v2_network-backend branch from 3ced1f6 to 1b02ac9 Compare November 11, 2025 14:27
@teclator teclator marked this pull request as ready for review November 11, 2025 14:31
@teclator teclator force-pushed the agama-api-v2_network-backend branch from 78df5ad to f5f25e7 Compare November 11, 2025 15:38
pub async fn for_network_manager() -> NetworkSystem<NetworkManagerAdapter<'static>> {
let adapter = NetworkManagerAdapter::from_system()
.await
.expect("Could not connect to NetworkManager");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be better to return a Result instead.

@teclator teclator merged commit 8742b52 into api-v2 Nov 11, 2025
15 of 16 checks passed
@teclator teclator deleted the agama-api-v2_network-backend branch November 11, 2025 16:00
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