• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openSUSE / agama / 7246554818
72%

Build:
DEFAULT BRANCH: master
Ran 18 Dec 2023 10:12AM UTC
Jobs 3
Files 658
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Dec 2023 10:08AM UTC coverage: 74.724% (+0.008%) from 74.716%
7246554818

push

github

web-flow
Changing the network model (#924)

## Problem

Agama's network model is heavily inspired by
[nmstate](https://github.com/nmstate/nmstate/blob/c9fd1e80d/rust/src/lib/ifaces/ethernet.rs#L64).
Connections are represented [by an
enum](https://github.com/openSUSE/agama/blob/<a class=hub.com/openSUSE/agama/commit/<a class="double-link" href="https://git"><a class=hub.com/openSUSE/agama/commit/2bc452b39e4460122ab52c5a72ee0d1dfe154cec">2bc452b39/rust/agama-dbus-server/src/network/model.rs#L220)
and each variant contains a struct which depends on the type (e.g., the
[WirelessConnection](https://github.com/openSUSE/agama/blob/2bc452b39e4460122ab52c5a72ee0d1dfe154cec/rust/agama-dbus-server/src/network/model.rs#L542)
struct). Those structs have a `base` field that points to a
[BaseConnection
struct](https://github.com/openSUSE/agama/blob/master/rust/agama-dbus-server/src/network/model.rs#L328)
which holds the common fields for all connection types.

And that's perfectly fine. However, we decided to introduce some methods
to hide the fact that the common information lives in a separate
`struct`. We could say it is for encapsulation reasons, but I don't know
whether it is a good idea. Even we created some *getters* and *setters*
for those fields, adding quite some
[boilerplate](https://github.com/openSUSE/agama/blob/master/rust/agama-dbus-server/src/network/model.rs#L264-L299)
[code](https://github.com/openSUSE/agama/blob/master/rust/agama-dbus-server/src/network/model.rs#L318-L324)

Additionally, until we introduced the `ConnectionBuilder` (in #885),
creating a new connection with some custom data (like an id and a UUID)
was not straightforward because you needed to make the `BaseConnection`
first (see [this
example](https://github.com/openSUSE/agama/blob/2bc452b39e4460122ab52c5a72ee0d1dfe154cec/rust/agama-dbus-server/src/network/model.rs#L136-L141).

## Proposal

Although I am not 100% sure whether it is a better idea, I am exploring
the possibility of using a simpler layout to represent a connection. In
this case, we would use a ... (continued)

1413 of 2163 branches covered (0.0%)

Branch coverage included in aggregate %.

147 of 186 new or added lines in 8 files covered. (79.03%)

4 existing lines in 2 files now uncovered.

15970 of 21100 relevant lines covered (75.69%)

21.25 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
74.19
0.0% rust/agama-dbus-server/src/network/dbus/tree.rs
4
0.0
0.0% rust/agama-dbus-server/src/network/nm/adapter.rs
7
71.88
-0.11% rust/agama-dbus-server/src/network/model.rs
7
0.0
0.0% rust/agama-dbus-server/src/network/nm/client.rs
8
77.78
1.74% rust/agama-dbus-server/src/network/dbus/interfaces.rs
12
81.94
-0.77% rust/agama-dbus-server/src/network/nm/dbus.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
77.78
1.74% rust/agama-dbus-server/src/network/dbus/interfaces.rs
3
81.94
-0.77% rust/agama-dbus-server/src/network/nm/dbus.rs
Subprojects
ID Flag name Job ID Ran Files Coverage
1 rust 7246554818.1 18 Dec 2023 10:12AM UTC 61
40.45
GitHub Action Run
1 service 7225274242.1 15 Dec 2023 05:42PM UTC 304
84.88
GitHub Action Run
1 web 7245193463.1 18 Dec 2023 08:04AM UTC 293
73.86
GitHub Action Run
Source Files on build 7246554818
  • Tree
  • List 658
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #7246554818
  • 275c770f on github
  • Prev Build on master (#7245193463)
  • Next Build on master (#7247240764)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc