Skip to content

Commit ac1a36c

Browse files
committed
feat(hardware): builds subcommand
Obtains builds per compatible list. It supports the same options as the results builds subcommands. Signed-off-by: Camila Alvarez <cam.alvarez.i@gmail.com>
1 parent edcbb07 commit ac1a36c

3 files changed

Lines changed: 34 additions & 2 deletions

File tree

docs/results.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Example:
2828
kci-dev results summary --giturl 'https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git' --branch master --commit d1486dca38afd08ca279ae94eb3a397f10737824
2929
```
3030

31-
### builds
31+
### <a id="result-builds"></a>builds
3232

3333
List builds results.
3434

@@ -113,6 +113,17 @@ Example:
113113
kci-dev results hardware boots --name mediatek,mt8195 --origin maestro --json
114114
```
115115

116+
#### builds
117+
118+
List build results for a hardware with `name` list for the last seven days.
119+
It supports the same options as [results builds](#result-builds).
120+
121+
Example:
122+
123+
```sh
124+
kci-dev results hardware builds --name mediatek,mt8195 --origin maestro --json
125+
```
126+
116127
## Common parameters
117128

118129
### --origin

kcidev/libs/dashboard.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,10 @@ def dashboard_fetch_hardware_boots(name, origin, use_json):
165165
return dashboard_api_post(
166166
f"hardware/{urllib.parse.quote_plus(name)}/boots", {}, use_json, body
167167
)
168+
169+
170+
def dashboard_fetch_hardware_builds(name, origin, use_json):
171+
body = _create_hardware_request_body(origin)
172+
return dashboard_api_post(
173+
f"hardware/{urllib.parse.quote_plus(name)}/builds", {}, use_json, body
174+
)

kcidev/subcommands/results/hardware.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@
44

55
from kcidev.libs.dashboard import (
66
dashboard_fetch_hardware_boots,
7+
dashboard_fetch_hardware_builds,
78
dashboard_fetch_hardware_list,
89
dashboard_fetch_hardware_summary,
910
)
1011
from kcidev.subcommands.results.options import (
1112
builds_and_tests_options,
1213
results_display_options,
1314
)
14-
from kcidev.subcommands.results.parser import cmd_hardware_list, cmd_summary, cmd_tests, cmd_builds
15+
from kcidev.subcommands.results.parser import (
16+
cmd_builds,
17+
cmd_hardware_list,
18+
cmd_summary,
19+
cmd_tests,
20+
)
1521

1622

1723
def hardware_common_opt(func):
@@ -54,3 +60,11 @@ def boots(name, origin, use_json, download_logs, status, filter, count):
5460
data = dashboard_fetch_hardware_boots(name, origin, use_json)
5561
cmd_tests(data["boots"], name, download_logs, status, filter, count, use_json)
5662

63+
64+
@hardware.command()
65+
@hardware_common_opt
66+
@results_display_options
67+
@builds_and_tests_options
68+
def builds(name, origin, use_json, download_logs, status, filter, count):
69+
data = dashboard_fetch_hardware_builds(name, origin, use_json)
70+
cmd_builds(data, name, download_logs, status, count, use_json)

0 commit comments

Comments
 (0)