Skip to content

Commit 9fd588f

Browse files
committed
include offliner definition version in task info response
1 parent 52115a2 commit 9fd588f

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

api/src/zimitfrontend/routes/schemas.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class TaskInfo(CamelModel):
2424
flags: list[TaskInfoFlag]
2525
progress: int | None
2626
rank: int | None
27+
offliner_definition_version: str
2728

2829

2930
class TaskCreateRequest(CamelModel):
@@ -90,6 +91,7 @@ class ZimfarmTask(BaseModel):
9091
# rank is populated only on GET /requested_tasks/{id}, and not on any of
9192
# other endpoint and not on the webhook calls
9293
rank: int | None = None
94+
version: str
9395

9496

9597
class HookStatus(BaseModel):

api/src/zimitfrontend/routes/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def get_task_info(task: Any) -> TaskInfo:
7979
else 0
8080
),
8181
rank=zimfarm_task.rank,
82+
offliner_definition_version=zimfarm_task.version,
8283
)
8384

8485

api/tests/unit/routes/test_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
],
6363
progress=0,
6464
rank=123,
65+
offliner_definition_version="initial",
6566
),
6667
id="full",
6768
),
@@ -81,6 +82,7 @@
8182
flags=[],
8283
progress=0,
8384
rank=456,
85+
offliner_definition_version="initial",
8486
),
8587
id="simple",
8688
),
@@ -101,6 +103,7 @@
101103
flags=[],
102104
progress=0,
103105
rank=456,
106+
offliner_definition_version="initial",
104107
),
105108
id="limit_not_hit",
106109
),
@@ -121,6 +124,7 @@
121124
flags=[],
122125
progress=100,
123126
rank=456,
127+
offliner_definition_version="initial",
124128
),
125129
id="no_limit_info",
126130
),

0 commit comments

Comments
 (0)