From 414ece71279bc87cad64bd298543cd49a13a469a Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 5 Dec 2024 10:29:46 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E9=9B=86=E6=88=90?= =?UTF-8?q?=E4=B8=8E=E5=8F=91=E7=89=88=E6=B5=81=E6=B0=B4=E7=BA=BF=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BD=9C=E4=B8=9A=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1304912309223424]集成与发版流水线创建作业失败 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1304912309223424 --- .../util/DeployPipelineConfigManager.java | 80 +++++++++++-------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/src/main/java/neatlogic/module/deploy/util/DeployPipelineConfigManager.java b/src/main/java/neatlogic/module/deploy/util/DeployPipelineConfigManager.java index 6ea1b8ca..7513bbdc 100644 --- a/src/main/java/neatlogic/module/deploy/util/DeployPipelineConfigManager.java +++ b/src/main/java/neatlogic/module/deploy/util/DeployPipelineConfigManager.java @@ -221,18 +221,21 @@ public class DeployPipelineConfigManager { autoexecServiceCrossoverService.updateAutoexecCombopConfig(deployPipelineConfig.getAutoexecCombopConfigVo()); } if (isHasBuildOrDeployTypeTool) { - Set operationIdSet = getOperationIdSet(deployPipelineConfig);List buildTypeToolIdList = new ArrayList<>(); - List deployTypeToolIdList = new ArrayList<>(); - Long buildTypeId = autoexecTypeMapper.getTypeIdByName("BUILD"); - Long deployTypeId = autoexecTypeMapper.getTypeIdByName("DEPLOY"); - List operationIdList = new ArrayList<>(operationIdSet); - if (buildTypeId != null) { - buildTypeToolIdList = autoexecToolMapper.getToolIdListByIdListAndTypeId(operationIdList, buildTypeId); - } - if (deployTypeId != null) { - deployTypeToolIdList = autoexecToolMapper.getToolIdListByIdListAndTypeId(operationIdList, deployTypeId); + Set operationIdSet = getOperationIdSet(deployPipelineConfig); + if (CollectionUtils.isNotEmpty(operationIdSet)) { + List buildTypeToolIdList = new ArrayList<>(); + List deployTypeToolIdList = new ArrayList<>(); + Long buildTypeId = autoexecTypeMapper.getTypeIdByName("BUILD"); + Long deployTypeId = autoexecTypeMapper.getTypeIdByName("DEPLOY"); + List operationIdList = new ArrayList<>(operationIdSet); + if (buildTypeId != null) { + buildTypeToolIdList = autoexecToolMapper.getToolIdListByIdListAndTypeId(operationIdList, buildTypeId); + } + if (deployTypeId != null) { + deployTypeToolIdList = autoexecToolMapper.getToolIdListByIdListAndTypeId(operationIdList, deployTypeId); + } + setIsHasBuildOrDeployTypeTool(deployPipelineConfig, buildTypeToolIdList, deployTypeToolIdList); } - setIsHasBuildOrDeployTypeTool(deployPipelineConfig, buildTypeToolIdList, deployTypeToolIdList); } } return deployPipelineConfig; @@ -291,8 +294,23 @@ public class DeployPipelineConfigManager { resultList.add(deployAppConfig); } - List buildTypeToolIdList = new ArrayList<>(); - List deployTypeToolIdList = new ArrayList<>(); + if (isDeleteDisabledPhase) { + for (DeployAppConfigVo deployAppConfig : resultList) { + DeployPipelineConfigVo deployPipelineConfig = deployAppConfig.getConfig(); + if (deployPipelineConfig != null) { + deleteDisabledPhase(deployPipelineConfig); + } + } + } + if (isUpdateConfig) { + for (DeployAppConfigVo deployAppConfig : resultList) { + DeployPipelineConfigVo deployPipelineConfig = deployAppConfig.getConfig(); + if (deployPipelineConfig != null) { + IAutoexecServiceCrossoverService autoexecServiceCrossoverService = CrossoverServiceFactory.getApi(IAutoexecServiceCrossoverService.class); + autoexecServiceCrossoverService.updateAutoexecCombopConfig(deployPipelineConfig.getAutoexecCombopConfigVo()); + } + } + } if (isHasBuildOrDeployTypeTool) { Set operationIdSet = new HashSet<>(); for (DeployAppConfigVo deployAppConfig : resultList) { @@ -301,29 +319,23 @@ public class DeployPipelineConfigManager { operationIdSet.addAll(getOperationIdSet(deployPipelineConfig)); } } - Long buildTypeId = autoexecTypeMapper.getTypeIdByName("BUILD"); - Long deployTypeId = autoexecTypeMapper.getTypeIdByName("DEPLOY"); - List operationIdList = new ArrayList<>(operationIdSet); - if (buildTypeId != null) { - buildTypeToolIdList = autoexecToolMapper.getToolIdListByIdListAndTypeId(operationIdList, buildTypeId); - } - if (deployTypeId != null) { - deployTypeToolIdList = autoexecToolMapper.getToolIdListByIdListAndTypeId(operationIdList, deployTypeId); - } - } - - for (DeployAppConfigVo deployAppConfig : resultList) { - DeployPipelineConfigVo deployPipelineConfig = deployAppConfig.getConfig(); - if (deployPipelineConfig != null) { - if (isDeleteDisabledPhase) { - deleteDisabledPhase(deployPipelineConfig); + if (CollectionUtils.isNotEmpty(operationIdSet)) { + Long buildTypeId = autoexecTypeMapper.getTypeIdByName("BUILD"); + Long deployTypeId = autoexecTypeMapper.getTypeIdByName("DEPLOY"); + List buildTypeToolIdList = new ArrayList<>(); + List deployTypeToolIdList = new ArrayList<>(); + List operationIdList = new ArrayList<>(operationIdSet); + if (buildTypeId != null) { + buildTypeToolIdList = autoexecToolMapper.getToolIdListByIdListAndTypeId(operationIdList, buildTypeId); } - if (isUpdateConfig) { - IAutoexecServiceCrossoverService autoexecServiceCrossoverService = CrossoverServiceFactory.getApi(IAutoexecServiceCrossoverService.class); - autoexecServiceCrossoverService.updateAutoexecCombopConfig(deployPipelineConfig.getAutoexecCombopConfigVo()); + if (deployTypeId != null) { + deployTypeToolIdList = autoexecToolMapper.getToolIdListByIdListAndTypeId(operationIdList, deployTypeId); } - if (isHasBuildOrDeployTypeTool) { - setIsHasBuildOrDeployTypeTool(deployPipelineConfig, buildTypeToolIdList, deployTypeToolIdList); + for (DeployAppConfigVo deployAppConfig : resultList) { + DeployPipelineConfigVo deployPipelineConfig = deployAppConfig.getConfig(); + if (deployPipelineConfig != null) { + setIsHasBuildOrDeployTypeTool(deployPipelineConfig, buildTypeToolIdList, deployTypeToolIdList); + } } } } -- Gitee