From 8b99013878149d8aa4003c4dd532e39060d91aca Mon Sep 17 00:00:00 2001 From: rvema Date: Mon, 28 Mar 2022 16:25:28 -0400 Subject: [PATCH] fix order of serialization --- pom.xml | 4 ++-- .../dashboard/service/BuildServiceImpl.java | 20 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 92da1b64..f312165f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ api jar ${project.groupId}:${project.artifactId} - 3.4.30 + 3.4.31 Hygieia Rest API Layer https://github.com/Hygieia/api @@ -59,7 +59,7 @@ - 3.15.21 + 3.15.26 4.2.18.RELEASE 8.5.70 1.9.4 diff --git a/src/main/java/com/capitalone/dashboard/service/BuildServiceImpl.java b/src/main/java/com/capitalone/dashboard/service/BuildServiceImpl.java index aa90161a..7009b873 100644 --- a/src/main/java/com/capitalone/dashboard/service/BuildServiceImpl.java +++ b/src/main/java/com/capitalone/dashboard/service/BuildServiceImpl.java @@ -173,16 +173,22 @@ public String createV2(BuildDataCreateRequest request) throws HygieiaException { public BuildDataCreateResponse createV3(BuildDataCreateRequest request) throws HygieiaException { BuildDataCreateResponse response = new BuildDataCreateResponse(); Build build = createBuild(request); - try { - org.apache.commons.beanutils.BeanUtils.copyProperties(response, build); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new HygieiaException(e); - } finally { - if (settings.isLookupDashboardForBuildDataCreate()) { + String clientReference = StringUtils.isNotEmpty(build.getClientReference()) ? build.getClientReference() : request.getClientReference(); + if(settings.isLookupDashboardForBuildDataCreate()) { + try { + org.apache.commons.beanutils.BeanUtils.copyProperties(response, build); populateDashboardId(response); + } catch (IllegalAccessException | InvocationTargetException e) { + LOGGER.error("correlation_id=" + clientReference + + ", build_url=" + build.getBuildUrl() + + ", build_duration_millis=" + build.getDuration() + + ", build_started_by=" + build.getStartedBy() + + ", build_status=" + build.getBuildStatus() + + ", hygieia_build_id=" + build.getId() + + ", hygieia_build_view_link=" + settings.getHygieia_ui_url()+"/build/"+build.getId()); } } - String clientReference = StringUtils.isNotEmpty(build.getClientReference()) ? build.getClientReference() : request.getClientReference(); + response.setClientReference(clientReference); // Will be refactored soon CollectorItem buildCollectorItem = collectorItemRepository.findOne(build.getCollectorItemId());