fix: 修复公共插件配置修改不生效的bug,优化系统设置参数注入时机

- 将系统设置参数注入移至 outputContext读取输入参数之后
-修复了某些情况下系统设置参数可能被覆盖的问题
- 优化了代码结构,提高了可读性和维护性
pull/409/head
xiaojunnuo 2025-05-25 21:08:23 +08:00
parent 36bc3ff22d
commit e1e510ce1e
2 changed files with 8 additions and 8 deletions

View File

@ -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}`;

View File

@ -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授权或服务账号授权");