Skip to content

Commit

Permalink
Fix comments removal & scan-all-PRs iteration bugs (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman authored Mar 12, 2024
1 parent 8a702e2 commit e712bb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scanpullrequest/scanallpullrequests.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func scanAllPullRequests(repo utils.Repository, client vcsclient.VcsClient) (err
}
if !shouldScan {
log.Info("Pull Request", pr.ID, "has already been scanned before. If you wish to scan it again, please comment \"rescan\".")
return
continue
}
repo.PullRequestDetails = pr
if e = scanPullRequest(&repo, client); e != nil {
Expand Down
10 changes: 4 additions & 6 deletions utils/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ func HandlePullRequestCommentsAfterScan(issues *IssuesCollection, repo *Reposito
// we will not cause a Frogbot run to fail but will instead log the error.
log.Debug("Looking for an existing Frogbot pull request comment. Deleting it if it exists...")
// Delete previous PR regular comments, if exists (not related to location of a change)
if err = DeleteExistingPullRequestComments(repo, client); err != nil {
log.Error(fmt.Sprintf("%s:\n%v", commentRemovalErrorMsg, err))
return
if e := DeleteExistingPullRequestComments(repo, client); e != nil {
log.Error(fmt.Sprintf("%s:\n%v", commentRemovalErrorMsg, e))
}
// Delete previous PR review comments, if exists (related to location of a change)
if err = DeleteExistingPullRequestReviewComments(repo, pullRequestID, client); err != nil {
log.Error(fmt.Sprintf("%s:\n%v", commentRemovalErrorMsg, err))
return
if e := DeleteExistingPullRequestReviewComments(repo, pullRequestID, client); e != nil {
log.Error(fmt.Sprintf("%s:\n%v", commentRemovalErrorMsg, e))
}
}

Expand Down

0 comments on commit e712bb9

Please sign in to comment.