Skip to content

Commit

Permalink
Pull decoration refresh and updated (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsKedar authored Oct 1, 2024
1 parent d924ed4 commit d145a83
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public class GitHubProperties extends RepoProperties {
@Getter
@Setter
private Map<FindingSeverity,String> issueslabel;
@Getter
@Setter
private boolean commentUpdate =true;


public String getMergeNoteUri(String namespace, String repo, String mergeId){
String format = "%s/%s/%s/issues/%s/comments";
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/checkmarx/flow/config/RepoProperties.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.checkmarx.flow.config;

import com.checkmarx.flow.service.PullRequestCommentsHelper;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import javax.annotation.PostConstruct;
Expand Down Expand Up @@ -30,6 +32,9 @@ public class RepoProperties {
private String cxSummaryHeader = "Checkmarx Scan Summary";
private Map<String, OptionalScmInstanceProperties> optionalInstances;
private boolean scanSubmittedComment = true;
@Getter
@Setter
private boolean commentUpdate =true;

public Map<String, OptionalScmInstanceProperties> getOptionalInstances() {
return optionalInstances;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/checkmarx/flow/service/RepoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public CxConfig getCxConfigOverride(ScanRequest request) {
public void sendMergeComment(ScanRequest request, String comment,boolean commentUpdate){

try {
RepoComment commentToUpdate =
PullRequestCommentsHelper.getCommentToUpdate(getComments(request), comment);
if(commentUpdate){
RepoComment commentToUpdate =
PullRequestCommentsHelper.getCommentToUpdate(getComments(request), comment);
if (commentToUpdate != null) {
log.debug("Got candidate comment to update. comment: {}", commentToUpdate.getComment());
if (!PullRequestCommentsHelper.shouldUpdateComment(comment, commentToUpdate.getComment())) {
Expand Down

0 comments on commit d145a83

Please sign in to comment.