Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public void AddRange(IEnumerable<ReviewRevisionModel> revisionModels)
}
}

public void RemoveAll(System.Predicate<ReviewRevisionModel> match)
{
_list.RemoveAll(match);
}

public void Clear()
{
_list.Clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ private async Task CreateRevisionIfRequired(CodeFile codeFile,
var prevRevisionId = review.Revisions.Last().RevisionId;
review = await GetBaseLineReview(codeFile.Language, codeFile.PackageName, pullRequestModel, true);
review.ReviewId = pullRequestModel.ReviewId;
//Remove previous revisions with revision ID.
//Currently revision ID is getting duplicated when a PR api review is created for a brand new package.
//In case of brand new package, we don't have any baseline from automatic review. So it uses previous PR api review as baseline and
//below revision ID copy step makes duplicate revision IDs in such cases.
//We should ensure that no revision exists in review with previous revision ID before we update new revision
review.Revisions.RemoveAll(r => r.RevisionId == prevRevisionId);
newRevision.RevisionId = prevRevisionId;
}
}
Expand Down