From e1e510ce1e37a5ae82478226b6987a83f22d1ecb Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 25 May 2025 21:08:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E9=85=8D=E7=BD=AE=E4=BF=AE=E6=94=B9=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84bug=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE=E5=8F=82=E6=95=B0=E6=B3=A8?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将系统设置参数注入移至 outputContext读取输入参数之后 -修复了某些情况下系统设置参数可能被覆盖的问题 - 优化了代码结构,提高了可读性和维护性 --- packages/core/pipeline/src/core/executor.ts | 14 +++++++------- .../plugin-cert/src/plugin/cert-plugin/index.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/core/pipeline/src/core/executor.ts b/packages/core/pipeline/src/core/executor.ts index fee6c98d..7c01dd48 100644 --- a/packages/core/pipeline/src/core/executor.ts +++ b/packages/core/pipeline/src/core/executor.ts @@ -295,6 +295,12 @@ export class Executor { const pluginConfig = await this.options.pluginConfigService.getPluginConfig(pluginName); //从outputContext读取输入参数 const input = cloneDeep(step.input); + const sysInput = pluginConfig.sysSetting?.input || {}; + //注入系统设置参数 + for (const sysInputKey in sysInput) { + input[sysInputKey] = sysInput[sysInputKey]; + } + Decorator.inject(define.input, instance, input, (item, key) => { if (item.component?.name === "output-selector") { const contextKey = input[key]; @@ -314,12 +320,6 @@ export class Executor { } }); - const sysInput = pluginConfig.sysSetting?.input || {}; - //注入系统设置参数 - for (const sysInputKey in sysInput) { - input[sysInputKey] = sysInput[sysInputKey]; - } - const newInputHash = hashUtils.md5(JSON.stringify(input)); step.status!.inputHash = newInputHash; //判断是否需要跳过 @@ -438,7 +438,7 @@ export class Executor { const runnableError = error as RunnableError; content = `流水线ID:${this.pipeline.id},运行ID:${this.runtime.id}\n\n`; for (const re of runnableError.errors) { - content += ` - ${re.runnable.title} 执行失败,错误详情:${re.e.message || re.e?.error?.message}\n\n`; + content += ` - ${re.runnable.title} 执行失败,错误详情:${re.e?.message || re.e?.error?.message}\n\n`; } } else { content = `流水线ID:${this.pipeline.id},运行ID:${this.runtime.id}\n\n${this.currentStatusMap?.currentStep?.title} 执行失败\n\n错误详情:${error.message}`; diff --git a/packages/plugins/plugin-cert/src/plugin/cert-plugin/index.ts b/packages/plugins/plugin-cert/src/plugin/cert-plugin/index.ts index 39a1e552..6f6a58c4 100644 --- a/packages/plugins/plugin-cert/src/plugin/cert-plugin/index.ts +++ b/packages/plugins/plugin-cert/src/plugin/cert-plugin/index.ts @@ -320,7 +320,7 @@ export class CertApplyPlugin extends CertApplyBasePlugin { this.logger.info("当前正在使用 google EAB授权"); eab = await this.getAccess(this.eabAccessId); } else if (this.googleCommonEabAccessId) { - this.logger.info("当前正在使用 google公共EAB授权"); + this.logger.info("当前正在使用 google 公共EAB授权"); eab = await this.getAccess(this.googleCommonEabAccessId, true); } else { throw new Error("google需要配置EAB授权或服务账号授权");