Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Fixed bug and Changes to decrease processing time #173

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<artifactId>api-audit</artifactId>
<packaging>jar</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<version>3.7.23-SNAPSHOT</version>
<version>3.7.24-SNAPSHOT</version>
<description>Hygieia Audit Rest API Layer</description>
<url>https://github.com/Hygieia/${repository.name}</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,16 @@ private CodeReviewAuditResponseV2 getPeerReviewResponses(CollectorItem repoItem,
if (noPR.getCommits().isEmpty()){continue;}

// get the latest commit & filter out merge commit by checking non-matching scmNums
noPR.getCommits().sort(Comparator.comparing(Commit::getScmCommitTimestamp).reversed());
noPR.getCommits().sort(Comparator.comparing(Commit::getScmCommitTimestamp));
Commit lastCommit = noPR.getCommits().get(noPR.getCommits().size()-1);

// refine list of PRs to search through (created after PR and merged before the merge of the noPR)
List<GitRequest> refinedPRList = peerReviewed.stream().filter(
pr -> pr.getCreatedAt() >= noPR.getCreatedAt()).filter(
pr -> pr.getMergedAt() <= noPR.getMergedAt()).collect(Collectors.toList());

// iterate through the peerReviewed and their commits to see if the failed PR's commit exists in there
for (GitRequest yesPR: peerReviewed.stream().filter(pr -> pr.getCreatedAt() >= noPR.getCreatedAt()).collect(Collectors.toList())) {
for (GitRequest yesPR: refinedPRList) {
for (Commit commit: yesPR.getCommits()) {
if (lastCommit.getScmRevisionNumber().equalsIgnoreCase(commit.getScmRevisionNumber())){

Expand Down