Skip to content

Commit 1c783c1

Browse files
committed
🐛 Various bug fixes and test tweaks
1 parent a9de9d1 commit 1c783c1

6 files changed

Lines changed: 18 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# [v1.3.0](https://github.com/simvue-io/simvue-cli/releases/tag/v1.3.0) - 2025-12-02
1+
# [v1.3.1](https://github.com/simvue-io/simvue-cli/releases/tag/v1.3.1) - 2025-12-02
22

33
- Added filtering to `simvue run list` command.
44
- Added ability to include metadata columns in run list.
55
- Added `simvue config show` command.
66

7+
# ~~[v1.3.0](https://github.com/simvue-io/simvue-cli/releases/tag/v1.3.0) - 2025-12-02~~ Broken Release
8+
79
# [v1.2.2](https://github.com/simvue-io/simvue-cli/releases/tag/v1.2.2) - 2025-10-14
810

911
- Added support for Python3.14.

src/simvue_cli/actions.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,16 +357,17 @@ def parse_filters(filters: list[str]) -> list[str]:
357357

358358

359359
def get_runs_list(
360-
sort_by: list[str], reverse: bool, filters: list[str], **kwargs
360+
sort_by: list[str], reverse: bool, filters: list[str] | None = None, **kwargs
361361
) -> Generator[tuple[str, Run], None, None]:
362362
"""Retrieve list of Simvue runs"""
363363
_sorting: list[dict[str, str]] = [
364364
{"column": c, "descending": not reverse} for c in sort_by
365365
]
366366

367-
_filters = parse_filters(filters)
367+
if filters:
368+
kwargs["filters"] = json.dumps(parse_filters(filters))
368369

369-
return Run.get(sorting=_sorting, filters=json.dumps(_filters), **kwargs)
370+
return Run.get(sorting=_sorting, **kwargs)
370371

371372

372373
def get_alerts_list(
@@ -384,14 +385,15 @@ def get_alerts_list(
384385

385386

386387
def get_tag_list(
387-
sort_by: list[str], reverse: bool, filters: list[str], **kwargs
388+
sort_by: list[str], reverse: bool, filters: list[str] | None = None, **kwargs
388389
) -> None:
389390
"""Retrieve list of Simvue tags"""
390391
_sorting: list[dict[str, str]] = [
391392
{"column": c, "descending": not reverse} for c in sort_by
392393
]
393-
_filters = parse_filters(filters)
394-
return Tag.get(sorting=_sorting, filters=json.dumps(_filters), **kwargs)
394+
if filters:
395+
kwargs["filters"] = json.dumps(parse_filters(filters))
396+
return Tag.get(sorting=_sorting, **kwargs)
395397

396398

397399
def get_storages_list(**kwargs) -> typing.Generator[tuple[str, Storage], None, None]:

src/simvue_cli/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ def tag_list(
12091209
if color:
12101210
columns.append("colour")
12111211

1212-
if name:
1212+
if description:
12131213
columns.append("description")
12141214

12151215
table = create_objects_display(

src/simvue_cli/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def set_configuration_option(
6565

6666
def get_url_and_headers() -> tuple[str, dict[str, str]]:
6767
"""Retrieve the Simvue server URL and headers for requests"""
68-
_config = SimvueConfiguration.fetch()
68+
_config = SimvueConfiguration.fetch(mode="offline")
6969
_headers: dict[str, str] = {
7070
"Authorization": f"Bearer {_config.server.token.get_secret_value()}"
7171
}

tests/test_command_line_interface.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import contextlib
2+
import uuid
23
import random
34
import string
45
import typing
@@ -342,8 +343,9 @@ def test_folder_list(create_plain_run: tuple[simvue.Run, dict]) -> None:
342343

343344

344345
def test_tag(create_plain_run: tuple[simvue.Run, dict]) -> None:
345-
run, run_data = create_plain_run
346+
run, _ = create_plain_run
346347
assert run.id
348+
tag_uuid = f"{uuid.uuid4()}".split("-")[0]
347349
runner = click.testing.CliRunner()
348350
result = runner.invoke(
349351
sv_cli.simvue,
@@ -354,7 +356,7 @@ def test_tag(create_plain_run: tuple[simvue.Run, dict]) -> None:
354356
"cyan",
355357
"--description",
356358
"CLI test tag",
357-
"simvue_cli_test",
359+
f"simvue_cli_test_{tag_uuid}",
358360
],
359361
catch_exceptions=False
360362
)

tests/unit/test_cli_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"object", ("runs", "tag", "folders", "users", "tenants", "storages", "artifacts")
2020
)
2121
def test_object_list(create_plain_run, object) -> None:
22-
assert next(getattr(simvue_cli.actions, f"get_{object}_list")(count=10, sort_by=["created"], reverse=False))
22+
assert next(getattr(simvue_cli.actions, f"get_{object}_list")(count=10, sort_by=["created"], reverse=False, filters=None))
2323

2424

2525
def test_run_deletion(request) -> None:

0 commit comments

Comments
 (0)