From 4195f75ea9c42b8812e18083459ae16cdc4aa45e Mon Sep 17 00:00:00 2001 From: delvh Date: Wed, 20 Sep 2023 16:15:54 +0200 Subject: [PATCH 1/2] Really ignore the ignored error in `SyncAndGetUserSpecificDiff` This error was already supposed to be ignored but alas, it wasn't properly ignored. --- services/gitdiff/gitdiff.go | 1 + 1 file changed, 1 insertion(+) diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go index 4cc093e65debd..c3d10b374b3b8 100644 --- a/services/gitdiff/gitdiff.go +++ b/services/gitdiff/gitdiff.go @@ -1302,6 +1302,7 @@ func SyncAndGetUserSpecificDiff(ctx context.Context, userID int64, pull *issues_ // But as that does not work for all potential errors, we simply mark all files as unchanged and drop the error which always works, even if not as good as possible if err != nil { log.Error("Could not get changed files between %s and %s for pull request %d in repo with path %s. Assuming no changes. Error: %w", review.CommitSHA, latestCommit, pull.Index, gitRepo.Path, err) + err = nil } filesChangedSinceLastDiff := make(map[string]pull_model.ViewedState) From a04823990e37c781d3aa46a0282560d94e458e83 Mon Sep 17 00:00:00 2001 From: delvh Date: Wed, 20 Sep 2023 16:29:31 +0200 Subject: [PATCH 2/2] Fix successful return instead of ignoring the error --- services/gitdiff/gitdiff.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go index c3d10b374b3b8..fd0f32717c4b6 100644 --- a/services/gitdiff/gitdiff.go +++ b/services/gitdiff/gitdiff.go @@ -1302,7 +1302,6 @@ func SyncAndGetUserSpecificDiff(ctx context.Context, userID int64, pull *issues_ // But as that does not work for all potential errors, we simply mark all files as unchanged and drop the error which always works, even if not as good as possible if err != nil { log.Error("Could not get changed files between %s and %s for pull request %d in repo with path %s. Assuming no changes. Error: %w", review.CommitSHA, latestCommit, pull.Index, gitRepo.Path, err) - err = nil } filesChangedSinceLastDiff := make(map[string]pull_model.ViewedState) @@ -1344,7 +1343,7 @@ outer: } } - return diff, err + return diff, nil } // CommentAsDiff returns c.Patch as *Diff