Group index: Minor cleanups

* Document is:visibletoall in all lower case to be consistent with the
  case of other search operators (internally it's case-insensitive).
* Fix some comments.

Change-Id: Ied4c33a6968499b7f6dd9e74f3c25f48fb6bf401
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-01-16 13:49:15 +01:00
parent f7773c4bc0
commit 2086cbbabb
5 changed files with 7 additions and 7 deletions

View File

@@ -37,8 +37,8 @@ Matches groups that have a name part that starts with 'NAMEPART'
(case-insensitive).
[[is]]
[[is-visibleToAll]]
is:visibleToAll::
[[is-visibletoall]]
is:visibletoall::
+
Matches groups that are in the groups options marked as visible to all
registered users.

View File

@@ -52,7 +52,7 @@ public class Index implements RestModifyView<GroupResource, Input> {
.format("External Group Not Allowed: %s", rsrc.getGroupUUID().get()));
}
// evicting the group from the cache, reindexes the account
// evicting the group from the cache, reindexes the group
groupCache.evict(group);
return Response.none();
}

View File

@@ -62,7 +62,7 @@ public class GroupField {
}
};
/** Fuzzy prefix match on group name parts. */
/** Prefix match on group name parts. */
public static final FieldDef<AccountGroup, Iterable<String>> NAME_PART =
new FieldDef.Repeatable<AccountGroup, String>(
"name_part", FieldType.PREFIX, false) {

View File

@@ -77,7 +77,7 @@ public class GroupQueryBuilder extends QueryBuilder<AccountGroup> {
@Operator
public Predicate<AccountGroup> is(String value) throws QueryParseException {
if ("visibleToAll".equalsIgnoreCase(value)) {
if ("visibletoall".equalsIgnoreCase(value)) {
return GroupPredicates.isVisibleToAll();
}
throw error("Invalid query");

View File

@@ -247,13 +247,13 @@ public abstract class AbstractQueryGroupsTest extends GerritServerTests {
@Test
public void byIsVisibleToAll() throws Exception {
assertQuery("is:visibleToAll");
assertQuery("is:visibletoall");
GroupInfo groupThatIsVisibleToAll =
createGroupThatIsVisibleToAll(name("group-that-is-visible-to-all"));
createGroup(name("group"));
assertQuery("is:visibleToAll", groupThatIsVisibleToAll);
assertQuery("is:visibletoall", groupThatIsVisibleToAll);
}
@Test