Skip to content

Commit 8aaf95d

Browse files
committed
fixup! feat(platform): add 'for_organization' to list all runs of an org
1 parent cc53b89 commit 8aaf95d

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/aignostics/application/_cli.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,12 +899,13 @@ def run_list( # noqa: PLR0913, PLR0917
899899
if format == "json":
900900
print(json.dumps([]))
901901
else:
902+
scope = f" for organization '{for_organization}'" if for_organization else ""
902903
if tags:
903-
message = f"You did not yet create a run matching tags: {tags!r}."
904+
message = f"No runs found{scope} matching tags: {tags!r}."
904905
elif note_regex:
905-
message = f"You did not yet create a run matching note pattern: {note_regex!r}."
906+
message = f"No runs found{scope} matching note pattern: {note_regex!r}."
906907
elif for_organization:
907-
message = f"No runs found for organization '{for_organization}'."
908+
message = f"No runs found{scope}."
908909
else:
909910
message = "You did not yet create a run."
910911
logger.warning(message)
@@ -920,7 +921,8 @@ def run_list( # noqa: PLR0913, PLR0917
920921
console.print(message, style="info")
921922
logger.debug(f"Listed '{len(runs)}' run(s).")
922923
except ForbiddenException:
923-
message = "Access denied: you are not authorized to list runs."
924+
scope = f" for organization '{for_organization}'" if for_organization else ""
925+
message = f"Access denied: you are not authorized to list runs{scope}."
924926
logger.warning(message)
925927
console.print(f"[error]Error:[/error] {message}")
926928
sys.exit(2)

tests/aignostics/platform/e2e_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
ItemState,
2020
RunOutput,
2121
RunState,
22+
SchedulingRequest,
2223
)
2324
from aignx.codegen.models.run_read_response import RunReadResponse
2425
from loguru import logger
@@ -283,10 +284,7 @@ def _submit_and_validate( # noqa: PLR0913, PLR0917
283284

284285
logger.trace(f"Submitting application run for {application_id} version {application_version}")
285286
client = platform.Client()
286-
scheduling = {
287-
"due_date": due_date.isoformat(),
288-
"deadline": deadline.isoformat(),
289-
}
287+
scheduling = SchedulingRequest(due_date=due_date, deadline=deadline)
290288
custom_metadata = {
291289
"sdk": {
292290
"tags": tags or set(),

0 commit comments

Comments
 (0)