From a9d82b4b1bd97916b112abf9878c01f5595b7415 Mon Sep 17 00:00:00 2001 From: jenszo <6693266+jenszo@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:50:01 +0200 Subject: [PATCH 1/8] introducing BOM Report DataService for blackduck-common-api 4.2.3-SNAPSHOT Signed-off-by: jenszo <6693266+jenszo@users.noreply.github.com> --- build.gradle | 2 +- .../service/dataservice/BomReportService.java | 228 ++++++++++++++++++ 2 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/synopsys/integration/blackduck/service/dataservice/BomReportService.java diff --git a/build.gradle b/build.gradle index 715166e57..70e31e1c2 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ repositories { } dependencies { - api 'com.synopsys.integration:blackduck-common-api:2023.4.2.2' + api 'com.synopsys.integration:blackduck-common-api:2023.4.2.3-SNAPSHOT' api 'com.synopsys.integration:phone-home-client:5.1.10' api 'com.synopsys.integration:integration-bdio:26.0.9' api 'com.blackducksoftware.bdio:bdio2:3.2.5' diff --git a/src/main/java/com/synopsys/integration/blackduck/service/dataservice/BomReportService.java b/src/main/java/com/synopsys/integration/blackduck/service/dataservice/BomReportService.java new file mode 100644 index 000000000..6928c4d5c --- /dev/null +++ b/src/main/java/com/synopsys/integration/blackduck/service/dataservice/BomReportService.java @@ -0,0 +1,228 @@ +/* + * blackduck-common + * + * Copyright (c) 2023 Synopsys, Inc. + * Copyright (c) 2023 Jens Nachtigall + * + * Use subject to the terms and conditions of the Synopsys End User Software License and Maintenance Agreement. All rights reserved worldwide. + */ +package com.synopsys.integration.blackduck.service.dataservice; + +import java.util.List; + +import com.synopsys.integration.blackduck.api.generated.discovery.ApiDiscovery; +import com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView; +import com.synopsys.integration.blackduck.api.manual.view.BomReportView; +import com.synopsys.integration.blackduck.api.manual.view.BomReportContentView; +import com.synopsys.integration.blackduck.api.manual.component.BomReportRequest; +import com.synopsys.integration.blackduck.service.BlackDuckApiClient; +import com.synopsys.integration.blackduck.service.DataService; +import com.synopsys.integration.blackduck.service.model.ProjectVersionWrapper; +import com.synopsys.integration.exception.IntegrationException; +import com.synopsys.integration.exception.IntegrationTimeoutException; +import com.synopsys.integration.log.IntLogger; +import com.synopsys.integration.rest.HttpUrl; +import com.synopsys.integration.wait.ResilientJob; +import com.synopsys.integration.wait.ResilientJobConfig; +import com.synopsys.integration.wait.ResilientJobExecutor; +import com.synopsys.integration.wait.tracker.WaitIntervalTracker; +import com.synopsys.integration.wait.tracker.WaitIntervalTrackerFactory; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Blackduck API Data Service implementation to both, request and download Bill of Materials + * reports from Black Duck Hub when it eventually becomes available. + */ +public class BomReportService extends DataService { + + private Logger log = LoggerFactory.getLogger(BomReportService.class); + private static final int BD_WAIT_AND_RETRY_INTERVAL = 5; + + // Internal class to validate user input arugments. + private static class BomRequestValidator { + + // as per REST API Docs + private static List acceptableFormat = List.of("JSON", "RDF", "TAGVALUE", "YAML"); + private static List acceptableType = List.of("SPDX_22", "CYCLONEDX_13", "CYCLONEDX_14"); + + /** + * Validate a user specified format string using acceptableFormat + * @param format The format string to validate + * @return The uppercase format string if valid. + * @throws IllegalArgumentException if tis is not the case + */ + public static String validateFormat(final String format) throws IllegalArgumentException{ + if (acceptableFormat.contains(format.toUpperCase())) { + return format.toUpperCase(); + } + throw new IllegalArgumentException("Bom Format " + format + "is not among the valid ones: " + String.join(",", acceptableFormat)); + } + + /** + * Validate a user specified type string using acceptableType + * @param format The type string to validate + * @return The uppercase format string if valid. + * @throws IllegalArgumentException if tis is not the case + */ + public static String validateType(final String type) throws IllegalArgumentException{ + if (acceptableType.contains(type.toUpperCase())) { + return type.toUpperCase(); + } + throw new IllegalArgumentException("Bom Format " + type + "is not among the valid ones: " + String.join(",", acceptableType)); + } + } + + /** + * Internal download task for use with the ResilientJobExecutor of the Blackduck API, + * supporting interrution, timeout and retry count. + * + * Attempts to download a Bill of Material by url/uuid when it becomes avaialble + * and maps to a BomReportView, respectively. + */ + private static class BomDownloadJob implements ResilientJob { + private BlackDuckApiClient blackDuckApiClient; + private String jobName; + private boolean complete; + private HttpUrl uri; + private BomReportView BomReport; + + /** + * Constructor + * @param blackDuckApiClient An initialized BD API client (which has halready handled OAuth) + * @param jobName An arbitrary job name (only used for external logging) + * @param uri The reports URI as returned from the report creation request + */ + public BomDownloadJob(BlackDuckApiClient blackDuckApiClient, String jobName, HttpUrl uri) { + this.blackDuckApiClient = blackDuckApiClient; + this.jobName = jobName; + this.uri = uri; + this.complete = false; + } + + @Override + public void attemptJob() throws IntegrationException { + try { + // Wait while HTTP 412 Precondition failed is returned. + // for some reason, there will always be a JSON array in the response. + BomReport = blackDuckApiClient.getResponse(uri.appendRelativeUrl("contents"), BomReportView.class); + complete = true; + } catch (IntegrationException e) { + complete = false; + } + } + + @Override + public boolean wasJobCompleted() { + return complete; + } + + @Override + public BomReportView onTimeout() throws IntegrationTimeoutException { + throw new IntegrationTimeoutException("Not able to upload BDIO due to timeout."); + } + + @Override + public BomReportView onCompletion() { + return BomReport; + } + + @Override + public String getName() { + return this.jobName; + } + + } + + /** + * Constuctor of the BOM Data Service + * @param blackDuckApiClient An initialized BD API client (which has halready handled OAuth) + * @param apiDiscovery For the superclass of a Blackduck DataService + * @param logger For unified logging + */ + public BomReportService(BlackDuckApiClient blackDuckApiClient, ApiDiscovery apiDiscovery, IntLogger logger) { + super(blackDuckApiClient, apiDiscovery, logger); + } + + /** + * Sets up a valid Bom report request to the BDH RESET API (e.g. the POST Payload) + * @param type The BOM type, e.g. Cyclone or SPDX, @see BomRequestValidator.acceptableType + * @param format The BOM format, e.g. JSON, tag:value, @see BomRequestValidator.acceptableFormat + * @return The request obect + * @throws IllegalArgumentException + */ + public BomReportRequest createRequest(String type, String format) throws IllegalArgumentException{ + BomReportRequest request = new BomReportRequest(); + request.setReportType("Bom"); // Bom - static, optional? + request.setReportFormat(BomRequestValidator.validateFormat(format).toUpperCase()); //JSON + request.setSbomType(BomRequestValidator.validateType(type).toUpperCase()); // SPDX_22 + return request; + } + + /** + * Request a Bom report creation on the BDH + * @param projectVersion Project version response (wraped as View) carrying project and version uuid, respectively. + * @param reportRequest A populated / configured request + * @return An URL to the scheduled report including the uuid of the report. + * @throws IntegrationException + */ + public HttpUrl createReport(ProjectVersionView projectVersion, BomReportRequest reportRequest) throws IntegrationException { + // This is merely queing the report; it will be available upon completion + HttpUrl versionUrl = projectVersion.getHref(); + log.info("Project Version URL for " + projectVersion.getVersionName() + ": " + versionUrl.toString()); + + // The request returns an empty response with HTTP 201 Created and an attribute "Link" in the reponse header. + // Coincidentially, this is exactly what is returned by post(). + HttpUrl reportUrl = blackDuckApiClient.post( + versionUrl.appendRelativeUrl("Bom-reports"), reportRequest); + + log.info("Report available from: " + reportUrl.toString()); + + return reportUrl; + } + + /** + * Request a Bom report creation on the BDH + * @param wrapper A wrapped View response including project and version uuid. + * @param reportRequest A populated / configured request + * @return An URL to the scheduled report including the uuid of the report. + * @throws IntegrationException + */ + public HttpUrl createReport(ProjectVersionWrapper wrapper, BomReportRequest reportRequest) throws IntegrationException { + // This is merely queing the report creation + return createReport(wrapper.getProjectVersionView(), reportRequest); + } + + /** + * Await a Bom creation and download the report based on the reportUrl (@see createReport) + * @param reportUrl The URI identifying the report with it's uuid + * @param timeout Timeout in seconds + * @return + * @throws IntegrationException Something failed along the way (see stacktrace) + * @throws InterruptedException Interrupted by user + */ + public BomReportView downloadReports(HttpUrl reportUrl, long timeout) throws IntegrationException, InterruptedException { + + WaitIntervalTracker waitIntervalTracker = WaitIntervalTrackerFactory.createConstant(timeout, BD_WAIT_AND_RETRY_INTERVAL); + ResilientJobConfig jobConfig = new ResilientJobConfig(logger, System.currentTimeMillis(), waitIntervalTracker); + BomDownloadJob BomDownloadJob = new BomDownloadJob(blackDuckApiClient, "Awaiting Bom report completion", reportUrl); + ResilientJobExecutor jobExecutor = new ResilientJobExecutor(jobConfig); + + return jobExecutor.executeJob(BomDownloadJob); + } + + /** + * Await a Bom creation and download the report based on the reportUrl (@see createReport) + * @param reportUrl The URI identifying the report with it's uuid + * @param timeout Timeout in seconds + * @param log For unified logging + * @return + * @throws IntegrationException Something failed along the way (see stacktrace) + * @throws InterruptedException Interrupted by user + */ + public BomReportView downloadReports(HttpUrl reportUrl, long timeout, Logger log) throws IntegrationException, InterruptedException { + this.log = log; + return downloadReports(reportUrl, timeout); + } +} From 55fbc57b72f42cc4e1ae7c66d02e82a2e99dc873 Mon Sep 17 00:00:00 2001 From: jenszo <6693266+jenszo@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:07:41 +0200 Subject: [PATCH 2/8] Adapting naming conventions Signed-off-by: jenszo <6693266+jenszo@users.noreply.github.com> --- .../blackduck/service/BlackDuckServicesFactory.java | 5 +++++ .../{BomReportService.java => ReportBomService.java} | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) rename src/main/java/com/synopsys/integration/blackduck/service/dataservice/{BomReportService.java => ReportBomService.java} (98%) diff --git a/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckServicesFactory.java b/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckServicesFactory.java index 0dc9b361f..ef3b5e3d2 100644 --- a/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckServicesFactory.java +++ b/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckServicesFactory.java @@ -51,6 +51,7 @@ import com.synopsys.integration.blackduck.service.dataservice.NotificationService; import com.synopsys.integration.blackduck.service.dataservice.PolicyRuleService; import com.synopsys.integration.blackduck.service.dataservice.ProjectBomService; +import com.synopsys.integration.blackduck.service.dataservice.ReportBomService; import com.synopsys.integration.blackduck.service.dataservice.ProjectGetService; import com.synopsys.integration.blackduck.service.dataservice.ProjectMappingService; import com.synopsys.integration.blackduck.service.dataservice.ProjectService; @@ -211,6 +212,10 @@ public ProjectBomService createProjectBomService() { return new ProjectBomService(blackDuckApiClient, apiDiscovery, logger, createComponentService()); } + public ReportBomService createBomReportService() { + return new ReportBomService(this.getBlackDuckApiClient(), this.getApiDiscovery(), this.getLogger()); + } + public ProjectUsersService createProjectUsersService() { UserGroupService userGroupService = createUserGroupService(); return new ProjectUsersService(blackDuckApiClient, apiDiscovery, logger, userGroupService); diff --git a/src/main/java/com/synopsys/integration/blackduck/service/dataservice/BomReportService.java b/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java similarity index 98% rename from src/main/java/com/synopsys/integration/blackduck/service/dataservice/BomReportService.java rename to src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java index 6928c4d5c..9a5485305 100644 --- a/src/main/java/com/synopsys/integration/blackduck/service/dataservice/BomReportService.java +++ b/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java @@ -35,9 +35,9 @@ * Blackduck API Data Service implementation to both, request and download Bill of Materials * reports from Black Duck Hub when it eventually becomes available. */ -public class BomReportService extends DataService { +public class ReportBomService extends DataService { - private Logger log = LoggerFactory.getLogger(BomReportService.class); + private Logger log = LoggerFactory.getLogger(ReportBomService.class); private static final int BD_WAIT_AND_RETRY_INTERVAL = 5; // Internal class to validate user input arugments. @@ -141,7 +141,7 @@ public String getName() { * @param apiDiscovery For the superclass of a Blackduck DataService * @param logger For unified logging */ - public BomReportService(BlackDuckApiClient blackDuckApiClient, ApiDiscovery apiDiscovery, IntLogger logger) { + public ReportBomService(BlackDuckApiClient blackDuckApiClient, ApiDiscovery apiDiscovery, IntLogger logger) { super(blackDuckApiClient, apiDiscovery, logger); } From 1800ab4215f97d0e386ceb9cd6ce53bf66fd65f9 Mon Sep 17 00:00:00 2001 From: jenszo <6693266+jenszo@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:36:57 +0200 Subject: [PATCH 3/8] Fixing imports Signed-off-by: jenszo <6693266+jenszo@users.noreply.github.com> --- .../service/BlackDuckServicesFactory.java | 2 +- .../service/dataservice/ReportBomService.java | 32 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckServicesFactory.java b/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckServicesFactory.java index ef3b5e3d2..aad9301d0 100644 --- a/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckServicesFactory.java +++ b/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckServicesFactory.java @@ -212,7 +212,7 @@ public ProjectBomService createProjectBomService() { return new ProjectBomService(blackDuckApiClient, apiDiscovery, logger, createComponentService()); } - public ReportBomService createBomReportService() { + public ReportBomService createReportBomService() { return new ReportBomService(this.getBlackDuckApiClient(), this.getApiDiscovery(), this.getLogger()); } diff --git a/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java b/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java index 9a5485305..c40ea890a 100644 --- a/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java +++ b/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java @@ -12,9 +12,9 @@ import com.synopsys.integration.blackduck.api.generated.discovery.ApiDiscovery; import com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView; -import com.synopsys.integration.blackduck.api.manual.view.BomReportView; -import com.synopsys.integration.blackduck.api.manual.view.BomReportContentView; -import com.synopsys.integration.blackduck.api.manual.component.BomReportRequest; +import com.synopsys.integration.blackduck.api.manual.view.ReportBomView; +import com.synopsys.integration.blackduck.api.manual.view.ReportBomContentView; +import com.synopsys.integration.blackduck.api.manual.component.ReportBomRequest; import com.synopsys.integration.blackduck.service.BlackDuckApiClient; import com.synopsys.integration.blackduck.service.DataService; import com.synopsys.integration.blackduck.service.model.ProjectVersionWrapper; @@ -79,14 +79,14 @@ public static String validateType(final String type) throws IllegalArgumentExcep * supporting interrution, timeout and retry count. * * Attempts to download a Bill of Material by url/uuid when it becomes avaialble - * and maps to a BomReportView, respectively. + * and maps to a ReportBomView, respectively. */ - private static class BomDownloadJob implements ResilientJob { + private static class BomDownloadJob implements ResilientJob { private BlackDuckApiClient blackDuckApiClient; private String jobName; private boolean complete; private HttpUrl uri; - private BomReportView BomReport; + private ReportBomView bomReport; /** * Constructor @@ -106,7 +106,7 @@ public void attemptJob() throws IntegrationException { try { // Wait while HTTP 412 Precondition failed is returned. // for some reason, there will always be a JSON array in the response. - BomReport = blackDuckApiClient.getResponse(uri.appendRelativeUrl("contents"), BomReportView.class); + blackDuckApiClient.getResponse(uri.appendRelativeUrl("contents"), ReportBomView.class); complete = true; } catch (IntegrationException e) { complete = false; @@ -119,13 +119,13 @@ public boolean wasJobCompleted() { } @Override - public BomReportView onTimeout() throws IntegrationTimeoutException { + public ReportBomView onTimeout() throws IntegrationTimeoutException { throw new IntegrationTimeoutException("Not able to upload BDIO due to timeout."); } @Override - public BomReportView onCompletion() { - return BomReport; + public ReportBomView onCompletion() { + return bomReport; } @Override @@ -152,8 +152,8 @@ public ReportBomService(BlackDuckApiClient blackDuckApiClient, ApiDiscovery apiD * @return The request obect * @throws IllegalArgumentException */ - public BomReportRequest createRequest(String type, String format) throws IllegalArgumentException{ - BomReportRequest request = new BomReportRequest(); + public ReportBomRequest createRequest(String type, String format) throws IllegalArgumentException{ + ReportBomRequest request = new ReportBomRequest(); request.setReportType("Bom"); // Bom - static, optional? request.setReportFormat(BomRequestValidator.validateFormat(format).toUpperCase()); //JSON request.setSbomType(BomRequestValidator.validateType(type).toUpperCase()); // SPDX_22 @@ -167,7 +167,7 @@ public BomReportRequest createRequest(String type, String format) throws Illegal * @return An URL to the scheduled report including the uuid of the report. * @throws IntegrationException */ - public HttpUrl createReport(ProjectVersionView projectVersion, BomReportRequest reportRequest) throws IntegrationException { + public HttpUrl createReport(ProjectVersionView projectVersion, ReportBomRequest reportRequest) throws IntegrationException { // This is merely queing the report; it will be available upon completion HttpUrl versionUrl = projectVersion.getHref(); log.info("Project Version URL for " + projectVersion.getVersionName() + ": " + versionUrl.toString()); @@ -189,7 +189,7 @@ public HttpUrl createReport(ProjectVersionView projectVersion, BomReportRequest * @return An URL to the scheduled report including the uuid of the report. * @throws IntegrationException */ - public HttpUrl createReport(ProjectVersionWrapper wrapper, BomReportRequest reportRequest) throws IntegrationException { + public HttpUrl createReport(ProjectVersionWrapper wrapper, ReportBomRequest reportRequest) throws IntegrationException { // This is merely queing the report creation return createReport(wrapper.getProjectVersionView(), reportRequest); } @@ -202,7 +202,7 @@ public HttpUrl createReport(ProjectVersionWrapper wrapper, BomReportRequest repo * @throws IntegrationException Something failed along the way (see stacktrace) * @throws InterruptedException Interrupted by user */ - public BomReportView downloadReports(HttpUrl reportUrl, long timeout) throws IntegrationException, InterruptedException { + public ReportBomView downloadReports(HttpUrl reportUrl, long timeout) throws IntegrationException, InterruptedException { WaitIntervalTracker waitIntervalTracker = WaitIntervalTrackerFactory.createConstant(timeout, BD_WAIT_AND_RETRY_INTERVAL); ResilientJobConfig jobConfig = new ResilientJobConfig(logger, System.currentTimeMillis(), waitIntervalTracker); @@ -221,7 +221,7 @@ public BomReportView downloadReports(HttpUrl reportUrl, long timeout) throws Int * @throws IntegrationException Something failed along the way (see stacktrace) * @throws InterruptedException Interrupted by user */ - public BomReportView downloadReports(HttpUrl reportUrl, long timeout, Logger log) throws IntegrationException, InterruptedException { + public ReportBomView downloadReports(HttpUrl reportUrl, long timeout, Logger log) throws IntegrationException, InterruptedException { this.log = log; return downloadReports(reportUrl, timeout); } From 3fac2f8433895d32f696f4d98eda8ff2d5278e60 Mon Sep 17 00:00:00 2001 From: jenszo <6693266+jenszo@users.noreply.github.com> Date: Sun, 1 Oct 2023 12:05:24 +0200 Subject: [PATCH 4/8] Fixing NPE after rmischief find&replace --- .../service/dataservice/ReportBomService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java b/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java index c40ea890a..34ae619f1 100644 --- a/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java +++ b/src/main/java/com/synopsys/integration/blackduck/service/dataservice/ReportBomService.java @@ -106,7 +106,7 @@ public void attemptJob() throws IntegrationException { try { // Wait while HTTP 412 Precondition failed is returned. // for some reason, there will always be a JSON array in the response. - blackDuckApiClient.getResponse(uri.appendRelativeUrl("contents"), ReportBomView.class); + bomReport = blackDuckApiClient.getResponse(uri.appendRelativeUrl("contents"), ReportBomView.class); complete = true; } catch (IntegrationException e) { complete = false; @@ -154,7 +154,7 @@ public ReportBomService(BlackDuckApiClient blackDuckApiClient, ApiDiscovery apiD */ public ReportBomRequest createRequest(String type, String format) throws IllegalArgumentException{ ReportBomRequest request = new ReportBomRequest(); - request.setReportType("Bom"); // Bom - static, optional? + request.setReportType("SBOM"); // SBOM - static, optional? request.setReportFormat(BomRequestValidator.validateFormat(format).toUpperCase()); //JSON request.setSbomType(BomRequestValidator.validateType(type).toUpperCase()); // SPDX_22 return request; @@ -175,7 +175,7 @@ public HttpUrl createReport(ProjectVersionView projectVersion, ReportBomRequest // The request returns an empty response with HTTP 201 Created and an attribute "Link" in the reponse header. // Coincidentially, this is exactly what is returned by post(). HttpUrl reportUrl = blackDuckApiClient.post( - versionUrl.appendRelativeUrl("Bom-reports"), reportRequest); + versionUrl.appendRelativeUrl("sbom-reports"), reportRequest); log.info("Report available from: " + reportUrl.toString()); @@ -206,10 +206,10 @@ public ReportBomView downloadReports(HttpUrl reportUrl, long timeout) throws Int WaitIntervalTracker waitIntervalTracker = WaitIntervalTrackerFactory.createConstant(timeout, BD_WAIT_AND_RETRY_INTERVAL); ResilientJobConfig jobConfig = new ResilientJobConfig(logger, System.currentTimeMillis(), waitIntervalTracker); - BomDownloadJob BomDownloadJob = new BomDownloadJob(blackDuckApiClient, "Awaiting Bom report completion", reportUrl); + BomDownloadJob bomDownloadJob = new BomDownloadJob(blackDuckApiClient, "Awaiting Bom report completion", reportUrl); ResilientJobExecutor jobExecutor = new ResilientJobExecutor(jobConfig); - return jobExecutor.executeJob(BomDownloadJob); + return jobExecutor.executeJob(bomDownloadJob); } /** From 6a000b3499d20546f300cdbe61c0c0b9b4f6b3b5 Mon Sep 17 00:00:00 2001 From: jenszo <6693266+jenszo@users.noreply.github.com> Date: Wed, 4 Oct 2023 06:37:52 +0200 Subject: [PATCH 5/8] gititnore Signed-off-by: jenszo <6693266+jenszo@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7dc7540d5..b9c965b43 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ bin/ *.iml .idea/ out/ +.vscode # build tool .gradle/ From fe7623fef3c5c547640ae8131899a9db51dcfc54 Mon Sep 17 00:00:00 2001 From: David Terry Date: Mon, 2 Oct 2023 13:08:35 -0400 Subject: [PATCH 6/8] return raw response to callers so they can do more advanced things like check headers --- .../integration/blackduck/service/BlackDuckApiClient.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckApiClient.java b/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckApiClient.java index f75dcde30..4f376fffc 100644 --- a/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckApiClient.java +++ b/src/main/java/com/synopsys/integration/blackduck/service/BlackDuckApiClient.java @@ -166,6 +166,10 @@ public Response execute(BlackDuckResponseRequest request) throws IntegrationExce blackDuckHttpClient.throwExceptionForError(response); return response; } + + public Response executeAndRetrieveResponse(BlackDuckResponseRequest request) throws IntegrationException { + return blackDuckHttpClient.execute(request); + } // ------------------------------------------------ // posting and getting location header From 05c086d31354ca6612e778c5cbebb7fb1b7ebe86 Mon Sep 17 00:00:00 2001 From: blackduck-serv-builder Date: Mon, 2 Oct 2023 13:44:01 -0400 Subject: [PATCH 7/8] Release 66.2.8 --- build.gradle | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 70e31e1c2..dbee5c33e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,16 @@ buildscript { apply from: 'https://raw.githubusercontent.com/blackducksoftware/integration-resources/master/gradle_common/buildscript-repositories.gradle', to: buildscript - apply from: 'https://raw.githubusercontent.com/blackducksoftware/integration-resources/master/gradle_common/buildscript-dependencies.gradle', to: buildscript + ////////// START BUILDSCRIPT DEPENDENCY ////////// +dependencies { classpath "com.synopsys.integration:common-gradle-plugin:1.12.0" } + +////////// END BUILDSCRIPT DEPENDENCY ////////// } project.ext.moduleName = 'com.synopsys.integration.blackduck-common' project.ext.javaUseAutoModuleName = 'true' project.ext.junitShowStandardStreams = 'true' -version = '66.2.8-SNAPSHOT' +version = '66.2.8' description = 'A library for using various capabilities of Black Duck, notably the REST API and signature scanning.' From e7632e2b7b3135fe5ede0293f07a8a5c6da19ec3 Mon Sep 17 00:00:00 2001 From: blackduck-serv-builder Date: Mon, 2 Oct 2023 13:48:16 -0400 Subject: [PATCH 8/8] Using the next snapshot post release 66.2.9-SNAPSHOT --- build.gradle | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index dbee5c33e..fa22d0aa0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,13 @@ buildscript { apply from: 'https://raw.githubusercontent.com/blackducksoftware/integration-resources/master/gradle_common/buildscript-repositories.gradle', to: buildscript - ////////// START BUILDSCRIPT DEPENDENCY ////////// -dependencies { classpath "com.synopsys.integration:common-gradle-plugin:1.12.0" } - -////////// END BUILDSCRIPT DEPENDENCY ////////// + apply from: 'https://raw.githubusercontent.com/blackducksoftware/integration-resources/master/gradle_common/buildscript-dependencies.gradle', to: buildscript } project.ext.moduleName = 'com.synopsys.integration.blackduck-common' project.ext.javaUseAutoModuleName = 'true' project.ext.junitShowStandardStreams = 'true' -version = '66.2.8' +version = '66.2.9-SNAPSHOT' description = 'A library for using various capabilities of Black Duck, notably the REST API and signature scanning.'