commit | 1783743d4450f4f1273d667b68711bdf2c100a69 | [log] [tgz] |
---|---|---|
author | Patrizio <patrizio.gelosi@amarulasolutions.com> | Thu Feb 22 17:11:55 2024 +0100 |
committer | Patrizio <patrizio.gelosi@amarulasolutions.com> | Mon Feb 26 10:53:28 2024 +0100 |
tree | c7bd9f16359882f3954468e68fa73fbd6e9ff992 | |
parent | 15ac2838f558c07cbcd8ed23ce687639c1d118e2 [diff] |
Entire Change Set as default scope for reviews The default scope for reviews has been changed to encompass the entire Change Set, instead of just the most recent Patch Set as previously. To initiate reviews specifically for the latest Patch Sets (without the voting functionality), the "/review_last" command must be used. Jira-Id: IT-103 Change-Id: Ice8bad4a8bf8b311d53ab70d40fa88fbc9902293 Signed-off-by: Patrizio <patrizio.gelosi@amarulasolutions.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/client/ClientCommands.java b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/client/ClientCommands.java index 262c3fb..c63f0b9 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/client/ClientCommands.java +++ b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/client/ClientCommands.java
@@ -40,9 +40,9 @@ log.debug("Forced review command detected in message {}", comment); settings.setForcedReview(true); } - if (command == COMMAND_SET.REVIEW) { - log.debug("Forced review command applied to the whole Change Set"); - settings.setForcedReviewChangeSet(true); + if (command == COMMAND_SET.REVIEW_LAST) { + log.debug("Forced review command applied to the last Patch Set"); + settings.setForcedReviewLastPatchSet(true); } return true; }
diff --git a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/client/gerrit/GerritClientPatchSet.java b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/client/gerrit/GerritClientPatchSet.java index 237b298..bb15657 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/client/gerrit/GerritClientPatchSet.java +++ b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/client/gerrit/GerritClientPatchSet.java
@@ -42,7 +42,7 @@ } private boolean isChangeSetBased(GerritChange change) { - return change.getIsCommentEvent() || DynamicSettings.getInstance(change).getForcedReviewChangeSet(); + return !DynamicSettings.getInstance(change).getForcedReviewLastPatchSet(); } private int retrieveRevisionBase(GerritChange change) throws Exception {
diff --git a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/model/settings/Settings.java b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/model/settings/Settings.java index a8dc276..5c3b1be 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/model/settings/Settings.java +++ b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/model/settings/Settings.java
@@ -18,10 +18,6 @@ @NonNull private Integer votingMaxScore; private Boolean forcedReview = false; - private Boolean forcedReviewChangeSet = false; - - public Boolean getForcedReviewLastPatchSet() { - return forcedReview && !forcedReviewChangeSet; - } + private Boolean forcedReviewLastPatchSet = false; }