Skip to content

Commit

Permalink
bugfix: 修复独立子流程执行历史inputs格式的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshuaikang committed Sep 7, 2023
1 parent a18bb9d commit f663aa8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gcloud/taskflow3/domains/dispatchers/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,11 @@ def get_node_detail_v2(
}

detail = result.data
pipeline_instance = kwargs["pipeline_instance"]
node_info = self._get_node_info(
node_id=self.node_id, pipeline=pipeline_instance.execution_data, subprocess_stack=subprocess_stack
)
node_code = node_info.get("component", {}).get("code")
# 节点已经执行
if detail:
detail = detail[self.node_id]
Expand All @@ -745,6 +750,10 @@ def get_node_detail_v2(
}
for hist in hist_result.data:
hist["ex_data"] = hist.get("outputs", {}).get("ex_data", "")
if node_info["type"] == "ServiceActivity" and node_code == "subprocess_plugin":
# 对于独立子流程节点要重新渲染输出
raw_inputs = hist["inputs"]["subprocess"]["pipeline"]["constants"]
hist["inputs"] = {key[2:-1]: value.get("value") for key, value in raw_inputs.items()}
detail["histories"] = hist_result.data
detail["history_id"] = -1
# 如果用户传了 loop 参数,并且 loop 小于当前节点已循环次数,则从历史数据获取结果
Expand All @@ -764,6 +773,10 @@ def get_node_detail_v2(

for hist in detail["histories"]:
# 重试记录必然是因为失败才重试
if node_info["type"] == "ServiceActivity" and node_code == "subprocess_plugin":
# 对于独立子流程节点要重新渲染输出
raw_inputs = hist["inputs"]["subprocess"]["pipeline"]["constants"]
hist["inputs"] = {key[2:-1]: value.get("value") for key, value in raw_inputs.items()}
hist.setdefault("state", bamboo_engine_states.FAILED)
hist["history_id"] = hist["id"]
format_pipeline_status(hist)
Expand Down

0 comments on commit f663aa8

Please sign in to comment.