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

openSUSE / agama / 8156832468
72%

Build:
DEFAULT BRANCH: master
Ran 05 Mar 2024 01:17PM UTC
Jobs 3
Files 692
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

05 Mar 2024 01:09PM UTC coverage: 74.401% (-0.3%) from 74.665%
8156832468

push

github

web-flow
Expose the software service through the HTTP/JSON API (#1069)

Trello:
https://trello.com/c/2MjaulMd/3566-3-expose-the-software-api-over-http

This PR exposes the public[^1] part of the software API through the
HTTP/JSON interface. It includes:

* `/software/patterns`: list of patterns, including whether they are
selected (and by whom).
* `/software/products`: list of products.
* `/software/probe`: starts the software probing.
* `/software/config`: describing the software configuration.

```json
{
  "patterns": [
    "gnome"
  ],
  "product": "Tumbleweed"
}
```

Additionally, it exposes the following events through the websocket:

* `PatternsChanged`, containing the patterns and who selected them
('user' or 'auto').
* `ProductChanged`, with the name of the new product.

[^1] The part of the D-Bus API that it is used by the web UI.

## Implementation details

In this phase of the development, we are still deciding the best way to
implement these HTTP/JSON interfaces. The implementation has two parts:

* The [HTTP/JSON interface
itself](https://github.com/openSUSE/agama/blob/http-software-srv/rust/agama-server/src/software/web.rs#L104),
which is implemented as a
[Router](https://docs.rs/axum/latest/axum/struct.Router.html) and a set
of small functions (one per each endpoing+verb).
* An [events
stream](https://github.com/openSUSE/agama/blob/http-software-srv/rust/agama-server/src/software/web.rs#L60)
which emits Event values (see
[stream](https://tokio.rs/tokio/tutorial/streams) in the Tokio
documentation).

About the service status, the zbus proxies are cached and can be cloned,
so it looks like a good idea to keep our clients as part of the state.

## In the future

There are a few improvements we could consider in the future:

* Split the events in different types depending on the service
(`SoftwareEvent`, `ManagerEvent`), so those services only know about
their types.
* Consolidate all errors und... (continued)

1481 of 2260 branches covered (65.53%)

Branch coverage included in aggregate %.

21 of 133 new or added lines in 5 files covered. (15.79%)

3 existing lines in 3 files now uncovered.

16914 of 22464 relevant lines covered (75.29%)

22.93 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
7
0.0
0.0% rust/agama-server/src/agama-web-server.rs
10
27.27
-6.06% rust/agama-server/src/web.rs
24
5.56
5.56% rust/agama-lib/src/software/client.rs
71
14.46
rust/agama-server/src/software/web.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
5.56
5.56% rust/agama-lib/src/software/client.rs
1
0.0
0.0% rust/agama-server/src/agama-web-server.rs
1
27.27
-6.06% rust/agama-server/src/web.rs
Subprojects
ID Flag name Job ID Ran Files Coverage
1 rust 8156832468.1 05 Mar 2024 01:17PM UTC 79
43.52
GitHub Action Run
1 web 8133647628.1 03 Mar 2024 11:08PM UTC 297
73.63
GitHub Action Run
1 service 7975321865.1 20 Feb 2024 02:48PM UTC 316
85.22
GitHub Action Run
Source Files on build 8156832468
  • Tree
  • List 692
  • Changed 38
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #8156832468
  • 7d5e54cf on github
  • Prev Build on master (#8133647628)
  • Next Build on master (#8159724217)
  • 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