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

agama-project / agama / 18650407963

20 Oct 2025 11:21AM UTC coverage: 64.449% (+0.5%) from 63.944%
18650407963

push

github

web-flow
feat: add a new questions API (#2813)

This PR introduces a new questions API. It is build on a single resource
`/questions` which lists all the registered questions.

```json
[
  {
    "id": 1,
    "text": "LUKS password",
    "class": "storage.luks",
    "field": {
      "type": "string"
    },
    "actions": [
      {
        "id": "accept",
        "label": "Accept"
      },
      {
        "id": "skip",
        "label": "Skip"
      }
    ],
    "defaultAction": "skip"
  }
]
```

## The new model

According to this new API, each question is composed by:

* `text`: the text for the question.
* `class`: it works as a hint for the UI or to match pre-defined answers
(e.g., "autoyast.unsupported").
* `field`: optionally, a question might define an additional field
(e.g., a password, a selector, etc.).
* `actions`: list of available actions (e.g., "next", "skip", etc.).
* `defaultAction`: default action.

## Registering a question

A new question is registered through a `POST` request to the
`/questions` API. The payload
describes the question.

```json
{
  "text": "LUKS password",
  "class": "storage.luks",
  "field": {
    "type": "string"
  },
  "actions": [
    {
      "id": "accept",
      "label": "Accept"
    },
    {
      "id": "skip",
      "label": "Skip"
    }
  ],
  "defaultAction": "skip"
}
```

## Answering a question

A question is answered by sending a `PATCH` on the connection with the
following payload.

```json
{
    "id": 1,
    "action": "accept",
    "value": "my-password"
}
```

## Automatic answers

As in the previous API, it is possible to set up the questions service
to automatically response some questions.

```json
{
  "update": {
    "questions": {
      "policy": "auto",
      "answers": [
        {
          "class": "storage.luks",
          "action": "ok",
          "value": "secret"
        }
      ]
    }
  }
}
```

## Field types

The field types allow to grow this API to cover more use cases in the
future, like sof... (continued)

2695 of 4701 branches covered (57.33%)

Branch coverage included in aggregate %.

150 of 248 new or added lines in 41 files covered. (60.48%)

427 existing lines in 28 files now uncovered.

25234 of 38634 relevant lines covered (65.32%)

150.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.78
/rust/agama-lib/src/http/base_http_client.rs


Source Not Available

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