log.Trace("Inserting new review for user %d, repo %d, commit %s with the updated files %v.",userID,pullID,commitSHA,review.UpdatedFiles)
_,err:=engine.Insert(review)
returnerr
returnnil,err
}
log.Trace("Updating already existing review with ID %d (user %d, repo %d, commit %s) with the updated files %v.",review.ID,userID,pullID,commitSHA,review.UpdatedFiles)
// Explicitly store files that have changed in the database, if any is present at all.
// This has the benefit that the "Has Changed" attribute will be present as long as the user does not explicitly mark this file as viewed, so it will even survive a page reload after marking another file as viewed.
// On the other hand, this means that even if a commit reverting an unseen change is committed, the file will still be seen as changed.
// Explicitly store files that have changed in the database, if any is present at all.
// This has the benefit that the "Has Changed" attribute will be present as long as the user does not explicitly mark this file as viewed, so it will even survive a page reload after marking another file as viewed.
// On the other hand, this means that even if a commit reverting an unseen change is committed, the file will still be seen as changed.
log.Warn("Could not update review for user %d, pull %d, commit %s and the changed files %v: %v",review.UserID,review.PullID,review.CommitSHA,filesChangedSinceLastDiff,err)
returnnil,err
}
// Update the local review to reflect the changes immediately