From 9871b78e4583831901b744932476f4b18bfa6569 Mon Sep 17 00:00:00 2001 From: Go Frendi Gunawan Date: Tue, 28 Nov 2023 14:42:09 +0700 Subject: [PATCH] fix execution id propagation (#57) * fix execution id propagation * update * remove variable --- pyproject.toml | 2 +- src/zrb/task/base_task.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5eae7a8f..bffcd66b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "zrb" -version = "0.0.116" +version = "0.0.117" authors = [ { name="Go Frendi Gunawan", email="gofrendiasgard@gmail.com" }, ] diff --git a/src/zrb/task/base_task.py b/src/zrb/task/base_task.py index ed204014..12cbcbdf 100644 --- a/src/zrb/task/base_task.py +++ b/src/zrb/task/base_task.py @@ -293,6 +293,15 @@ def _get_normalized_input_key(self, key: str) -> str: return key return to_variable_name(key) + def _propagate_execution_id(self): + execution_id = self.get_execution_id() + for upstream_task in self._get_upstreams(): + upstream_task._set_execution_id(execution_id) + upstream_task._propagate_execution_id() + for checker_task in self._get_checkers(): + checker_task._set_execution_id(execution_id) + checker_task._propagate_execution_id() + async def _run_and_check_all( self, env_prefix: str, @@ -307,6 +316,7 @@ async def _run_and_check_all( self._set_execution_id( get_random_name(add_random_digit=True, digit_count=5) ) + self._propagate_execution_id() self.log_info('Set input and env map') await self._set_keyval(kwargs=kwargs, env_prefix=env_prefix) self.log_info('Set run kwargs') @@ -533,7 +543,7 @@ async def _set_keyval(self, kwargs: Mapping[str, Any], env_prefix: str): # set checker keyval # local_env_map = self.get_env_map() checker_coroutines = [] - for checker_task in self._checkers: + for checker_task in self._get_checkers(): checker_task.add_input(*self._get_inputs()) checker_task.add_env(*self._get_envs()) checker_coroutines.append(asyncio.create_task(