CXFLW-1590 Fixed issue for Pr feedback false #1422
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Since version 1.7.01, when passing argument --gitlab.scan-submitted-comment="false", instead of only disabling the MR comment that says "Scan submitted to checkmarx", it also disable the comment containing the scan summary. This contradicts the documentation and makes it impossible to only disable the scan submitted comment. This is caused by this if that was added in ResultsService in version 1.7.01:
case GITLABMERGE:
if (gitLabService.isScanSubmittedComment() && request.getScanSubmittedComment()) {
gitLabService.processMerge(request, results);
gitLabService.endBlockMerge(request);
}
Expected Behavior
When scan-submitted-comment is set to false, cxflow should still add the scan summary as a merge request comment but should not comment to say that a scan was submitted to checkmarx.
Actual Behavior
When scan-submitted-comment is set to false, cxflow does not comment in the merge request at all. It runs a scan and does nothing with the result.
Reproduction
Start from this template and modify checkmarx-scan-mr to send this argument to cxflow : --gitlab.scan-submitted-comment="false"
Run the merge request pipeline. cxflow will run but won't comment the scan summary to your merge request.
Environment Details
Tested on cxflow 1.7.06 with java 17.