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

agama-project / agama / 11500434784
68%

Build:
DEFAULT BRANCH: master
Ran 24 Oct 2024 01:45PM UTC
Jobs 2
Files 635
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

24 Oct 2024 01:34PM UTC coverage: 71.503%. Remained the same
11500434784

push

github

web-flow
Resolve search sections that match several devices (#1691)

## Problem

The search functionality described at `auto_storage.md` is pretty
powerful. But the current implementation only allows to:

- search by name
- return 0 or 1 devices per search

## Solution

This implements several parts of the missing functionality, like:

- Ability to match more than one device per `search` section
- Limit the number of matches by using `max`.

This pull request does not add the ability to use other conditions or
matching order beyond `name`. So it's only possible to search either for
a device with a given name, either for all the devices sorted by name.
The syntax for the latter would be this (a search with no conditions):

```
{ "search": {} }
```

For readability, the following alternative syntax is also introduced at
this pull request:

```
{ "search": "*" }
```

The new default for drive entries (if omitted) becomes:

```
{ "search": { "max": 1 } }
```

If several devices match with a given `search` section, the
corresponding configuration containing the `search` is replicated as
many times as needed. Eg. in a system with two disks, the following
config...

```
{
  "storage": {
    "drives": [
      { "search": "*" }
    ]
  }
}
```

...is expanded into:

```
{
  "storage": {
    "drives": [
      { "search": "*" },
      { "search": "*" }
    ]
  }
}
```

This also makes sure everything keeps working when an `alias` is used
together with a `search` that matches several devices (so all the
resulting config objects share the same alias).

## Testing

- Adapted existing unit tests and added a new ones regarding the
`search` functionality
- Added a new unit test to check that resolving a config into several
ones (potentially with a shared alias) works as expected.

51 of 51 new or added lines in 8 files covered. (100.0%)

16937 of 23687 relevant lines covered (71.5%)

35.74 hits per line

Subprojects
ID Flag name Job ID Ran Files Coverage
2 rust 11500434784.2 24 Oct 2024 01:45PM UTC 121
25.26
GitHub Action Run
2 service 11500434799.2 24 Oct 2024 01:37PM UTC 514
89.3
GitHub Action Run
Source Files on build 11500434784
  • Tree
  • List 635
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11500434784
  • 825ad0c8 on github
  • Prev Build on master (#11500434799)
  • Next Build on master (#11515194567)
  • 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

© 2025 Coveralls, Inc