Skip to content

Commit 0112d04

Browse files
author
Alan Christie
committed
feat: Instance response running_workflow_step now running_workflow_step_id
1 parent 5b1f315 commit 0112d04

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tests/wapi_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def create_instance(self, *, running_workflow_step_id: str) -> dict[str, Any]:
282282
next_id: int = len(instances) + 1
283283
instance_id: str = _INSTANCE_ID_FORMAT.format(id=next_id)
284284
record = {
285-
"running_workflow_step": running_workflow_step_id,
285+
"running_workflow_step_id": running_workflow_step_id,
286286
}
287287
instances[instance_id] = record
288288

workflow/workflow_engine.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
213213
_LOGGER.debug(
214214
"API.get_instance(%s) returned: -\n%s", instance_id, str(response)
215215
)
216-
r_wfsid: str = response["running_workflow_step"]
216+
r_wfsid: str | None = response.get("running_workflow_step_id")
217+
assert r_wfsid
217218
rwfs_response, _ = self._wapi_adapter.get_running_workflow_step(
218219
running_workflow_step_id=r_wfsid
219220
)
@@ -225,7 +226,7 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
225226
step_name: str = rwfs_response["name"]
226227

227228
# Get the step's running workflow record.
228-
r_wfid = rwfs_response["running_workflow"]
229+
r_wfid: str = rwfs_response["running_workflow"]
229230
assert r_wfid
230231
rwf_response, _ = self._wapi_adapter.get_running_workflow(
231232
running_workflow_id=r_wfid
@@ -280,7 +281,7 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
280281
str(response),
281282
)
282283
assert "id" in rwfs_response
283-
r_wfsid = rwfs_response["id"]
284+
new_r_wfsid: str = rwfs_response["id"]
284285
project_id = rwf_response["project"]["id"]
285286
variables = rwf_response["variables"]
286287
lp: LaunchParameters = LaunchParameters(
@@ -292,15 +293,15 @@ def _handle_pod_message(self, msg: PodMessage) -> None:
292293
specification=json.loads(next_step["specification"]),
293294
specification_variables=variables,
294295
running_workflow_id=r_wfid,
295-
running_workflow_step_id=r_wfsid,
296+
running_workflow_step_id=new_r_wfsid,
296297
)
297298
lr = self._instance_launcher.launch(lp)
298299
# Handle a launch error?
299300
if lr.error_num:
300301
self._set_step_error(
301302
next_step_name,
302303
r_wfid,
303-
r_wfsid,
304+
new_r_wfsid,
304305
lr.error_num,
305306
lr.error_msg,
306307
)

0 commit comments

Comments
 (0)