Merge "Fix flogger errorprone compile time errors" into stable-3.5
diff --git a/rv-reviewers/rv-reviewer.js b/rv-reviewers/rv-reviewer.js
index 6145013..338b428 100644
--- a/rv-reviewers/rv-reviewer.js
+++ b/rv-reviewers/rv-reviewer.js
@@ -16,6 +16,8 @@
  */
 import {htmlTemplate} from './rv-reviewer_html.js';
 
+const SYSTEM_GROUP_PREFIX = 'global%3A';
+
 class RvReviewer extends Polymer.Element {
   /** @returns {string} name of the component */
   static get is() { return 'rv-reviewer'; }
@@ -104,7 +106,9 @@
       if (!groups) { return []; }
       const groupSuggestions = [];
       for (const key in groups) {
-        if (!groups.hasOwnProperty(key) || key.startsWith('user/')) {
+        if (!groups.hasOwnProperty(key) ||
+             groups[key].id.startsWith(SYSTEM_GROUP_PREFIX) ||
+             key.startsWith('user/')) {
           continue;
         }
         groupSuggestions.push({
diff --git a/src/main/java/com/googlesource/gerrit/plugins/reviewers/ReviewersResolver.java b/src/main/java/com/googlesource/gerrit/plugins/reviewers/ReviewersResolver.java
index fc5d9e0..ea7d8e1 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/reviewers/ReviewersResolver.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/reviewers/ReviewersResolver.java
@@ -98,8 +98,8 @@
         Account.Id id = result.asList().get(0).account().id();
         if (uploader == null || id.get() != uploader._accountId) {
           reviewers.add(id);
-          return true;
         }
+        return true;
       }
       return false;
     } catch (StorageException | IOException | ConfigInvalidException e) {
diff --git a/src/main/resources/Documentation/config.md b/src/main/resources/Documentation/config.md
index 1b51181..173f51a 100644
--- a/src/main/resources/Documentation/config.md
+++ b/src/main/resources/Documentation/config.md
@@ -51,7 +51,10 @@
 filter.\<filter\>.reviewer
 :	An account or a group name. Must be an exact match (case sensitive) with the
 	account's email address or username, or the group name.  Multiple `reviewer`
-	occurrences are allowed.
+	occurrences are allowed.\
+	**NOTE**: *Reviewers are added in the context of the uploader which means
+	that if a group is configured it needs to be visible to the uploader for
+	reviewers to be added.*
 
 filter.\<filter\>.cc
 :	An account or a group name. Must be an exact match (case sensitive) with the