From a0a36db3484f090ff5e71268ec86e4d279ce2dc1 Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 12 Mar 2024 11:38:28 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=9C=AA=E6=89=A7=E8=A1=8C=E8=8A=82=E7=82=B9=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=B6=E5=85=8D=E6=B8=B2=E6=9F=93=E8=A1=A8=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E4=B8=AD=E5=8F=98=E9=87=8F=E4=BB=8D=E8=A2=AB=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#7358?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- gcloud/tasktmpl3/domains/constants.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e599933bae..196ed9ed72 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: hooks: - id: check-merge-conflict - repo: https://github.com/psf/black - rev: stable + rev: 22.8.0 hooks: - id: black language_version: python3.6 diff --git a/gcloud/tasktmpl3/domains/constants.py b/gcloud/tasktmpl3/domains/constants.py index 3ab3a6077b..d7e8371948 100644 --- a/gcloud/tasktmpl3/domains/constants.py +++ b/gcloud/tasktmpl3/domains/constants.py @@ -169,7 +169,8 @@ def get_need_render_context_keys(): else: raise Exception(f"can not preview inputs for node type: {node_type}") raw_inputs = {key: info["value"] for key, info in raw_inputs.items()} - hydrated_context = context.hydrate(deformat=True) + need_render = pipeline["activities"][node_id]["component"]["inputs"]["job_content"]["need_render"] + hydrated_context = context.hydrate(deformat=need_render) inputs = Template(raw_inputs).render(hydrated_context) return inputs From 1991a268a847d896aa19da7a59ed29670d777de4 Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 16 Apr 2024 11:40:50 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=9C=AA=E6=89=A7=E8=A1=8C=E8=8A=82=E7=82=B9=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=B6=E5=85=8D=E6=B8=B2=E6=9F=93=E8=A1=A8=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E4=B8=AD=E5=8F=98=E9=87=8F=E4=BB=8D=E8=A2=AB=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#7358?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/tasktmpl3/domains/constants.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gcloud/tasktmpl3/domains/constants.py b/gcloud/tasktmpl3/domains/constants.py index d7e8371948..35914e5a64 100644 --- a/gcloud/tasktmpl3/domains/constants.py +++ b/gcloud/tasktmpl3/domains/constants.py @@ -126,7 +126,12 @@ def get_need_render_context_keys(): need_render_context_keys = get_need_render_context_keys() else: need_render_context_keys = list(pipeline["data"].get("inputs", {}).keys()) + list(parent_params.keys()) - + need_render_keys = { + "${%s}" % key + for key, val in pipeline["activities"][node_id]["component"]["inputs"].items() + if not val["need_render"] + } + need_render_context_keys = need_render_context_keys.difference(need_render_keys) context_values = [ ContextValue(key=key, type=VAR_CONTEXT_MAPPING[info["type"]], value=info["value"], code=info.get("custom_type")) for key, info in list(pipeline["data"].get("inputs", {}).items()) + list(parent_params.items()) @@ -169,8 +174,7 @@ def get_need_render_context_keys(): else: raise Exception(f"can not preview inputs for node type: {node_type}") raw_inputs = {key: info["value"] for key, info in raw_inputs.items()} - need_render = pipeline["activities"][node_id]["component"]["inputs"]["job_content"]["need_render"] - hydrated_context = context.hydrate(deformat=need_render) + hydrated_context = context.hydrate(deformat=True) inputs = Template(raw_inputs).render(hydrated_context) return inputs From 84875d9cb707a20cf906338d715758d38f068f96 Mon Sep 17 00:00:00 2001 From: liujun Date: Thu, 25 Apr 2024 15:55:20 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=9C=AA=E6=89=A7=E8=A1=8C=E8=8A=82=E7=82=B9=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=B6=E5=85=8D=E6=B8=B2=E6=9F=93=E8=A1=A8=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E4=B8=AD=E5=8F=98=E9=87=8F=E4=BB=8D=E8=A2=AB=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#7358?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/tasktmpl3/domains/constants.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcloud/tasktmpl3/domains/constants.py b/gcloud/tasktmpl3/domains/constants.py index 35914e5a64..157f727ff9 100644 --- a/gcloud/tasktmpl3/domains/constants.py +++ b/gcloud/tasktmpl3/domains/constants.py @@ -126,12 +126,12 @@ def get_need_render_context_keys(): need_render_context_keys = get_need_render_context_keys() else: need_render_context_keys = list(pipeline["data"].get("inputs", {}).keys()) + list(parent_params.keys()) - need_render_keys = { + no_need_render_keys = { "${%s}" % key - for key, val in pipeline["activities"][node_id]["component"]["inputs"].items() - if not val["need_render"] + for key, val in pipeline["activities"].get(node_id, {}).get("component", {}).get("inputs", {}).items() + if not val.get("need_render") } - need_render_context_keys = need_render_context_keys.difference(need_render_keys) + need_render_context_keys = need_render_context_keys.difference(no_need_render_keys) context_values = [ ContextValue(key=key, type=VAR_CONTEXT_MAPPING[info["type"]], value=info["value"], code=info.get("custom_type")) for key, info in list(pipeline["data"].get("inputs", {}).items()) + list(parent_params.items()) From 5ba4a454630ae2a86bcee914243f83ad470ffe80 Mon Sep 17 00:00:00 2001 From: liujun Date: Thu, 16 May 2024 16:32:47 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=9C=AA=E6=89=A7=E8=A1=8C=E8=8A=82=E7=82=B9=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=B6=E5=85=8D=E6=B8=B2=E6=9F=93=E8=A1=A8=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E4=B8=AD=E5=8F=98=E9=87=8F=E4=BB=8D=E8=A2=AB=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#7358?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/tasktmpl3/domains/constants.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/gcloud/tasktmpl3/domains/constants.py b/gcloud/tasktmpl3/domains/constants.py index 157f727ff9..a9eadc44cc 100644 --- a/gcloud/tasktmpl3/domains/constants.py +++ b/gcloud/tasktmpl3/domains/constants.py @@ -125,12 +125,15 @@ def get_need_render_context_keys(): if node_type == NodeType.ServiceActivity.value and node_code != "subprocess_plugin": need_render_context_keys = get_need_render_context_keys() else: - need_render_context_keys = list(pipeline["data"].get("inputs", {}).keys()) + list(parent_params.keys()) - no_need_render_keys = { - "${%s}" % key - for key, val in pipeline["activities"].get(node_id, {}).get("component", {}).get("inputs", {}).items() - if not val.get("need_render") - } + need_render_context_keys = set(list(pipeline["data"].get("inputs", {}).keys()) + list(parent_params.keys())) + no_need_render_keys = set( + { + "${%s}" % key + for key, val in pipeline["activities"].get(node_id, {}).get("component", {}).get("inputs", {}).items() + if not val.get("need_render") + } + ) + need_render_context_keys = need_render_context_keys.difference(no_need_render_keys) context_values = [ ContextValue(key=key, type=VAR_CONTEXT_MAPPING[info["type"]], value=info["value"], code=info.get("custom_type")) From 9c18178ad9ba121f040348094f4621657df0358f Mon Sep 17 00:00:00 2001 From: liujun Date: Wed, 29 May 2024 15:25:21 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=9C=AA=E6=89=A7=E8=A1=8C=E8=8A=82=E7=82=B9=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=97=B6=E5=85=8D=E6=B8=B2=E6=9F=93=E8=A1=A8=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E4=B8=AD=E5=8F=98=E9=87=8F=E4=BB=8D=E8=A2=AB=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#7358?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/tasktmpl3/domains/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcloud/tasktmpl3/domains/constants.py b/gcloud/tasktmpl3/domains/constants.py index a9eadc44cc..6aa3e961b6 100644 --- a/gcloud/tasktmpl3/domains/constants.py +++ b/gcloud/tasktmpl3/domains/constants.py @@ -130,7 +130,7 @@ def get_need_render_context_keys(): { "${%s}" % key for key, val in pipeline["activities"].get(node_id, {}).get("component", {}).get("inputs", {}).items() - if not val.get("need_render") + if val.get("need_render") is False } )