Search in sources :

Example 1 with BitBucketClientException

use of com.checkmarx.flow.exception.BitBucketClientException in project cx-flow by checkmarx-ltd.

the class BitBucketService method processCommit.

void processCommit(ScanRequest request, ScanResults results) throws BitBucketClientException {
    try {
        String comment = HTMLHelper.getMergeCommentMD(request, results, properties);
        log.debug(LOG_COMMENT, comment);
        sendCommitComment(request, comment);
    } catch (HttpClientErrorException e) {
        log.error("Error occurred while creating Commit comment", e);
        throw new BitBucketClientException();
    }
}
Also used : HttpClientErrorException(org.springframework.web.client.HttpClientErrorException) BitBucketClientException(com.checkmarx.flow.exception.BitBucketClientException)

Example 2 with BitBucketClientException

use of com.checkmarx.flow.exception.BitBucketClientException in project cx-flow by checkmarx-ltd.

the class BitBucketService method processMerge.

void processMerge(ScanRequest request, ScanResults results) throws BitBucketClientException {
    try {
        String comment = HTMLHelper.getMergeCommentMD(request, results, properties);
        log.debug(LOG_COMMENT, comment);
        sendMergeComment(request, comment);
    } catch (HttpClientErrorException e) {
        log.error("Error occurred while creating Merge Request comment", e);
        throw new BitBucketClientException();
    }
}
Also used : HttpClientErrorException(org.springframework.web.client.HttpClientErrorException) BitBucketClientException(com.checkmarx.flow.exception.BitBucketClientException)

Example 3 with BitBucketClientException

use of com.checkmarx.flow.exception.BitBucketClientException 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();
    }
}
Also used : PullRequestReport(com.checkmarx.flow.dto.report.PullRequestReport) HttpClientErrorException(org.springframework.web.client.HttpClientErrorException) BitBucketClientException(com.checkmarx.flow.exception.BitBucketClientException)

Aggregations

BitBucketClientException (com.checkmarx.flow.exception.BitBucketClientException)3 HttpClientErrorException (org.springframework.web.client.HttpClientErrorException)3 PullRequestReport (com.checkmarx.flow.dto.report.PullRequestReport)1