use of com.checkmarx.flow.dto.report.PullRequestReport in project cx-flow by checkmarx-ltd.
the class BitBucketService method setBuildEndStatus.
public void setBuildEndStatus(ScanRequest request, ScanResults results, ScanDetails scanDetails) {
if (properties.isBlockMerge()) {
String status = BUILD_SUCCESSFUL;
if (!thresholdValidator.isMergeAllowed(results, properties, new PullRequestReport(scanDetails, request))) {
status = BUILD_FAILED;
}
JSONObject buildStatusBody = createBuildStatusRequestBody(status, BUILD_STATUS_KEY_FOR_CXFLOW, "Checkmarx Scan Results", results.getLink(), results.getScanSummary().toString());
sendBuildStatus(request, buildStatusBody.toString());
}
}
use of com.checkmarx.flow.dto.report.PullRequestReport in project cx-flow by checkmarx-ltd.
the class BitBucketService method processServerMerge.
void processServerMerge(ScanRequest request, ScanResults results, ScanDetails scanDetails) throws BitBucketClientException {
try {
String comment = HTMLHelper.getMergeCommentMD(request, results, properties);
log.debug(LOG_COMMENT, comment);
if (properties.isBlockMerge()) {
if (thresholdValidator.isMergeAllowed(results, properties, new PullRequestReport(scanDetails, request))) {
sendServerMergeComment(request, comment);
} else {
sendServerMergeTask(request, comment);
}
} else {
sendServerMergeComment(request, comment);
}
} catch (HttpClientErrorException e) {
log.error("Error occurred while creating Merge Request comment", e);
throw new BitBucketClientException();
}
}
Aggregations