We used to think adding this method to the top level is enough
and could avoid misuses. But it turns out we still need them in
other permission backend classes so that we only need to rescope
a user when necessary, which could provide better performance.
See I67b72b59 as an example.
Change-Id: I9ef30fb38315250fa63fb8b3d27e19e19d5e3e22
This allows us to replace them with custom bindings at Google.
Change-Id: I084ad42395882fd10d8cb9c8f3b842faac6dc52a
Signed-off-by: Edwin Kempin <ekempin@google.com>
This is a preparation to move the bindings for the REST API out of
GerritGlobalModule so that at Google we can replace them with custom
bindings.
Change-Id: I36b24206375ee0db4f14e8d50de7cd2721236747
Signed-off-by: Edwin Kempin <ekempin@google.com>
This makes the name consistent with the other REST API modules.
Change-Id: I5723685fddea36d1a4f777103b8f5bd27ac230ac
Signed-off-by: Edwin Kempin <ekempin@google.com>
This reverts commit 727d718b77d53e19ba14161ced72e0125087c220.
Reason for revert: We actually don't need this class to be public.
Change-Id: I25ceacb6e29f8e655bc5a28343d15b2e65aa3981
This allows us to bind this class in our custom Guice stack at
Google.
Change-Id: I2307538a30e80f388346455ff17ef3710bc9ce8c
Signed-off-by: Edwin Kempin <ekempin@google.com>
All logging of this class should be done through the locally defined
'sshDaemonLog' Logger (and not through the inherited 'log' Logger from
AbstractLoggingBean).
Change-Id: I2d1031fe51601f11911b110c482482ff2482ce1a
Signed-off-by: Edwin Kempin <ekempin@google.com>
Because of problems in the GWT UI's display of blame annotations, the
change.allowBlame config was used to disable the Gerrit feature
altogether. Since then, the PolyGerrit UI can display blame annotations
without these problems, but the feature remains disabled.
The change.allowBlame config handling is changed to only disable blame
in the frontend of the GWT UI. Note: this removes the ability to disable
the blame API via server config.
Change-Id: Ic25aed5a533e0044956359587321676b022c21ec
This was wrongly changed in I601ea1200a. This commit changes it back to
the correct value (a provider of the CurrentUser).
Change-Id: I6cbee0cd3013e6fc53514db4c1b855e8da52e63b
When calling operations that create a lot of ProjectControls (e.g.
ListProjects) we observe OOMs in our Gerrit jobs from time to time. This
commit puts a max. limit on the cache size to prevent this from
happening.
The approach implemented is not an LRU. On purpose, we want to keep
PerThreadCache simple and don't add a dependency on e.g. Guava's LRU.
Change-Id: Ic2f6e11719b52ee2112f72698e887cbf8ca254d0
* stable-2.15:
Revert "Filter account entry suggestions"
ChangeIndexedListener: pass project name information
Set version to 2.15.2-SNAPSHOT
Change-Id: Id36088686621e5ce4c61633d8df732a49d205209
Every time a lambda taking an argument is created, an object is created.
This object is unique and makes it harder for the JIT compilation to
optimize the code.
By replacing lambdas with method references, we help the JIT better
understand our code, and reduce object creations* and garbage
collection.
Using method references also helps humans better understand the code,
and might even make compilation faster: the method, and where it lives,
is explicitely written: no need to guess it.
repoUpgraded.stream().map(n -> n.get()).collect(...);
Where does the get method come from? Hard to tell.
repoUpgraded.stream().map(NameKey::get).collect()
Same line of code, using a method reference. It is clear that the input
objects are NameKey-s, and we call the get method on them.
* This is technically wrong, as a pointer is created even when we use a
method reference, but it is at least smaller than the lambda
counterpart.
Change-Id: Ic85b1b593d42968f262d3afe49a2ad87a4b766b9
UIActions (GetRevisionActions) calls have a 99.9%ile latency > 1 minute.
We only have metrics on the REST endpoint which does not give much
indication on why this endpoint is slow.
UIActions is implemented in a way that it calls #getDescription on all
RestViews that implement the UIActions interface. This means we do
serial calls to a lot of these methods. This commit adds a latency
metric to instrument these calls. Knowing which actions are slow can
guide futher steps that we take.
Possibilities include reworking slow actions or looking into more
parallelism.
Change-Id: I261bfb1a5a43b81f11dba019d405126198908c5f
The log message had 3 parameters, but only 2 placeholders in the format
string.
Change-Id: I2ffbba76837adb92d924a8692913b6ef3e675f30
Signed-off-by: Edwin Kempin <ekempin@google.com>
We must use '{}' as placeholders for the parameters.
Change-Id: I729e7856882c0b37a4c6e19f022c981876ef8c95
Signed-off-by: Edwin Kempin <ekempin@google.com>
The debug logs say 'event listener', but the warning logs just
'listener'. Make this consistent and always use 'event listener' which
is more precise.
Change-Id: I447a00cce0b11e5337801ce5d84c7954c1340f59
Signed-off-by: Edwin Kempin <ekempin@google.com>
There is only one place where PatchListNotAvailableException is logged
as a warning, everywhere else (EventFactory, ChangeAbandoned,
ChangeMerged, ...) it is logged as an error. Make this consistent.
Change-Id: I0104a280c984e2c8244618fa518b320bad0407af
Signed-off-by: Edwin Kempin <ekempin@google.com>
Without the stacktrace the error log is not very useful.
Change-Id: I29688404e51f999bc06c6ec47b2de5bd1a6e238d
Signed-off-by: Edwin Kempin <ekempin@google.com>
The PRED_commit_message_1 rule doesn't need the whole PatchSetInfo
values to be loaded to function properly: only the commit message is
required.
This change improves this by only loading the commit message from the
repository.
Fix a test case: the commit_message predicate does not use the account
index anymore. Before that, it was indirectly used to gather
informations on the author and committer. These two informations were
loaded but never used.
Change-Id: I3a964bae3512ee6fba7895739f32fd592e8595bf