commit | c10040ab7ebcb196074174c034a1afec106f257c | [log] [tgz] |
---|---|---|
author | Patrizio <patrizio.gelosi@amarulasolutions.com> | Thu Mar 07 08:30:32 2024 +0100 |
committer | Patrizio Gelosi <patrizio.gelosi@amarulasolutions.com> | Thu Mar 07 12:30:12 2024 +0100 |
tree | ea469191de43deaedd8d5031aab982b153cd9672 | |
parent | a2597d2452361ae9feb34f4a7e3d7ce105aac2ea [diff] |
Clear score for lack of valid comments If ChatGPT provides no valid review comments that align with the directives, the Change Set score is reset to 0. Jira-Id: IT-103 Change-Id: I2a4097bc4a3384763ddc401e2e13962cedd03436 Signed-off-by: Patrizio <patrizio.gelosi@amarulasolutions.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/PatchSetReviewer.java b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/PatchSetReviewer.java index 4c3b2a5..f9471c0 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/PatchSetReviewer.java +++ b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/PatchSetReviewer.java
@@ -123,7 +123,12 @@ } private Integer getReviewScore() { - return config.isVotingEnabled() && !reviewScores.isEmpty() ? Collections.min(reviewScores) : null; + if (config.isVotingEnabled()) { + return reviewScores.isEmpty() ? 0 : Collections.min(reviewScores); + } + else { + return null; + } } }