gerrit/gerrit-acceptance-tests
Edwin Kempin 77a3ac909e Also return inactive accounts for internal account queries
By default account queries only returned active accounts since
AccountIndexRewriter added "is:active" to the query if the query didn't
have a predicate for the ACTIVE field yet. This default makes sense for
user queries, but for Gerrit internal queries we rather want to find all
matching accounts (active and inactive accounts).

E.g. AccountCacheImpl#ByNameLoader uses the InternalAccountQuery to find
accounts by username and assumes that also inactive accounts would be
included in the result.

To fix this the logic for adding "is:active" to the query is removed
from AccountIndexRewriter. Instead users of AccountQueryProcessor must
now add the "is:active" predicate to the query if it is desired. We do
this for the QueryAccounts REST endpoint, for the reviewer suggestion
and for the account suggestion in the singleusergroup plugin. This way
the behaviour in the UI and in REST API users stays the same. Only the
behaviour for internal account queries is changed.

An alternative fix has been implemented as change I2402da18f7 but review
discussions on that change showed that the solution that is implemented
in this change is preferred.

Change-Id: I795925f14435088885bb22ab7183e4058bb802fd
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-07-17 15:22:45 +02:00
..
src/test Also return inactive accounts for internal account queries 2017-07-17 15:22:45 +02:00
BUILD Move prolog:common rule to gerrit-server root build file 2017-05-18 06:17:11 +02:00
tests.bzl Don't ship bouncycastle libraries in plugin API 2017-04-07 07:38:04 +02:00