-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 新增内置赋值节点 #82 #92
base: develop
Are you sure you want to change the base?
Conversation
bkflow/pipeline_plugins/components/collections/value_assign/v1_0_0.py
Outdated
Show resolved
Hide resolved
def plugin_execute(self, data, parent_data): | ||
runtime = BambooDjangoRuntime() | ||
upsert_dict = {} | ||
pipeline_id = self._runtime_attrs["root_pipeline_id"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
尽量不从隐藏属性拿数据,看看 parent_data 有没有
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parent_data没有这部分数据
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看看 self.top_pipeline_id
bkflow/pipeline_plugins/components/collections/value_assign/v1_0_0.py
Outdated
Show resolved
Hide resolved
$.atoms.value_assign = [ | ||
{ | ||
tag_code: "bk_assignment_list", | ||
type: "datatable", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前端建议定制组件,用表格太不直观
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
等前端出组件调试
def plugin_execute(self, data, parent_data): | ||
runtime = BambooDjangoRuntime() | ||
upsert_dict = {} | ||
pipeline_id = self._runtime_attrs["root_pipeline_id"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看看 self.top_pipeline_id
# 处理输入变量与目标变量的类型转换(输入常量时) 如果是相同类型则必然成功 | ||
try: | ||
# 尝试将输入转换为目标变量类型 | ||
input_val = type(context.value)(input_val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确认下,如果变量没有默认值,那么这种方案是不是就有问题。
是否可以考虑如果不做类型校验,评估合理性;确认下这样是不是都可以正常赋值,如果是的话在插件说明中体现
bound_service = ValueAssignService | ||
form = settings.STATIC_URL + "components/value_assign/v1_0_0.js" | ||
version = "v1.0.0" | ||
desc = "提供内置赋值功能" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里需要补充实现机制,比如目标变量必须存在、类型校验或不校验等
pipeline_id = self._runtime_attrs["root_pipeline_id"] | ||
assign_list = data.get_one_of_inputs("bk_assignment_list") | ||
# 构建目标变量集合 | ||
target_var_set = {"${{{}}}".format(assign["bk_assgin_target_var"]) for assign in assign_list} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个模板提出来,作为类变量即可
No description provided.