Reformatting the code with google-java-format tool in change Id5f3c6de9
resulted in wrapped lines being unwrapped to the new 100 columns limit.
In cases where the wrapped line was wrapped on a string concatenation,
the resulting long line now includes redundant concatenations. See the
upstream issue [1] for an example of this.
Squash the redundant concatenations with:
git ls-files | grep java$ | xargs sed -i '' 's/" + "//g'
(note: this also resulted in a couple of unwanted changes; those are
manually undone.)
[1] https://github.com/google/google-java-format/issues/122
Change-Id: I7348413ae460c8c7a0b0c72dab0a1ae7275a2ec3
Per
https://www.bis.doc.gov/index.php/forms-documents/encryption/328-flowchart-2/file
open source crypto software can be self-classified as 5D002, and
requires only notification of the U.S. Bureau of Industry and
Security.
This registration has been performed by Google, as of Feb 15, 2017.
This gets rid of the special casing for BouncyCastle, simplifying our
build and deployment process.
Change-Id: I680b0a001e5e2e497ed6e62c90c8b8be30efff48
During init we can't get GerritPersonIdent injected which is why we
created an init person identity. Instead we can just create the real
Gerrit person identity via GerritPersonIdentProvider.
Change-Id: Ic23905657fbf9ced80d37d51726f8aa75e0a2259
Signed-off-by: Edwin Kempin <ekempin@google.com>
* submodules:
* Update plugins/reviewnotes from branch 'master'
- Assign unused Future return value to a variable
Error Prone plans to make this pattern into a compile error; this avoids
future breakage.
Change-Id: I6a023f22f472941854a6729f6450b9b70a020069
This reverts commit 3fd92a4ac50e5ef49043858ab2576050634a3c2e.
The change was supposed to print the username in the queue for git over
http operations but the username printed is the one of the person doing
show-queue, not the one doing the git operation.
Change-Id: I2f45d526b684af9f3aa336879b310a165048382e
Error Prone plans to make this pattern into a compile error; this avoids
future breakage.
In some of these cases, it's not obvious that ignoring the return value
is the correct thing to do; the hope is that the construct is ugly
enough to make the author think twice. In many cases though, it's clear
that a locally-created Runnable or Callable already does its own error
handling, so we can leave a comment alongside the ignored return value.
Eventually many of these should be audited again, and we can replace
some of the @SuppressWarnings with Error Prone's @CanIgnoreReturnValue.
That much is left for future cleanup.
Change-Id: Ia989214d85e0d6c387e388a77178e0b5c4bf2498
Having a standard tool for formatting saves reviewers' valuable time.
google-java-format is Google's standard formatter and is somewhat
inspired by gofmt[1]. This commit formats everything using
google-java-format version 1.2.
The downside of this one-off formatting is breaking blame. This can be
somewhat hacked around with a tool like git-hyper-blame[2], but it's
definitely not optimal until/unless this kind of feature makes its way
to git core.
Not in this change:
* Tool support, e.g. Eclipse. The command must be run manually [3].
* Documentation of best practice, e.g. new 100-column default.
[1] https://talks.golang.org/2015/gofmt-en.slide#3
[2] https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html
[3] git ls-files | grep java$ | xargs google-java-format -i
Change-Id: Id5f3c6de95ce0b68b41f0a478b5c99a93675aaa3
Signed-off-by: David Pursehouse <dpursehouse@collab.net>
* stable-2.13:
MetaDataUpdate: Do not close repository that was passed in
BaseInit: Bind DisabledMetricMaker
Update git submodules
Change-Id: Ibd32b0e2b5493d16e4404bf9207cb0c59a829c1d
In some cases a plugin may have an InitStep that refers to other
classes in its implementation, that in turn get a MetricMaker
injected.
Since the MetricMaker, among other things, is not available to
the InitStep, this results in a guice injection error during the
plugins init step of site initialization.
Bind the DisabledMetricMaker to avoid the injection error. This
has the result that the InitStep works, but no metrics can be
recorded. Update the metrics documentation to explicitly mention
that metrics are not available during plugin init steps.
Bug: Issue 5438
Change-Id: Iac9f462eb93a2ae668d5c934e61eda9f23bd3c4d
It make more sense to include the commit SHA-1 of the notes branch from
which the external IDs have been read into the cache key. This makes it
easier to implement this cache within a multimaster setup.
However, obviously, we can include the commit SHA-1 of the notes branch
into the cache key only after the external IDs have been migrated to
NoteDb (because before this the notes branch does not exist yet).
Revert the cache for now and re-add an improved version of the cache
later with the change that implements the migration of the external IDs
to NoteDb.
This reverts the following commits:
- 2869caaf70569fcf777676d605f9d7e70c4ac36d:
Add cache for external ids
- 48d5c9b9aa8aba3de52374328e2a1cc30be64a10:
Make ExternalIdCacheImpl.AllKey public
- 20e5507d46c2a266e73974878685c74adfd6ff6b:
ExternalIdCache: Add method to get external IDs by account ID + scheme
Change-Id: I589242aad32a9c70718542ba950c0a351c594e54
Signed-off-by: Edwin Kempin <ekempin@google.com>
This allows to do checks on Gerrit startup and abort the Gerrit startup
if issues are found. E.g. this allows us to do validation on the Gerrit
config, which is needed by a follow-up change.
The startup checks are done after all lifecycle listeners have been
invoked so that logging is already available and the reason for a
failing startup can be written to the error log.
All implementations of StartupCheck should be bound in
StartupChecks.Module.
Change-Id: I941dad2c926130a1f9c5a1a363f7e1eff0dab304
Signed-off-by: Edwin Kempin <ekempin@google.com>
Guava team recommends MultimapBuilder over specific Multimap
implementations, so callers don't have to know the specific key/value
behaviors of the individual implementations. The static factory
methods in the implementations will be removed in a later version.
LinkedListMultimap and LinkedHashMultimap are not affected, since
MultimapBuilder lacks support for specifying linked entries, and thus
the factory methods are not in immediate danger of deletion.
Change-Id: I7744db687da84a7beae31d1cb8953e782ed23c1d
Guava team recommends using the subinterfaces of Multimap, for the
same reasons they recommend using Set and List rather than Collection:
it documents expectations about ordering, uniqueness, and behavior of
equals. Do this across the board in Gerrit.
Mostly this is straightforward and I tried to exactly match existing
behavior where possible. However, there were a few wrinkles, where
different callers passed different subtypes to the same method.
The main one is arguments to ParameterParser#parse and
splitQueryString, where some callers used SetMultimaps (perhaps
semi-intentionally, or perhaps misunderstanding the nature of
HashMultimap). For the purposes of parameter parsing, a ListMultimap
makes more sense, because it preserves argument order and repetition.
Another instance is a couple places in ReceiveCommits and downstream
where there were SetMultimap<?, Ref>. Since Refs do not implement
equals, this is effectively the same thing as a ListMultimap, and
changing the interface no longer misleads readers into thinking there
might be some deduplication happening.
Finally, this change includes a breaking API change to the return
type of ExternalIncludedIn#getIncludedIn.
Change-Id: I5f1d15e27a32e534a6aaefe204e7a31815f4c8d7
SSH command registration was extended so that command gets registered
only in case when plugin is configured in gerrit.config.
Change-Id: Iffaf00775bdf1242e1fbe1dea15e5ce0bf912079
Signed-off-by: Jacek Centkowski <geminica.programs@gmail.com>
* changes:
Index groups that are created during init
Implement group index for ElasticSearch
Add REST endpoint to reindex a single group
Support default query for groups
Add query operator that matches groups that are visible to all users
Add group query operator to match groups by owner
Add group query operator to match groups by description
Support querying groups by name and name part
Set '_more_groups' on last group of query result
Add tests for group index
Groups API: Add query methods
Support arbitrary group queries via REST
Add new optional interface for REST collections to get request params
Add GroupQueryProcessor
IsVisibleToPredicate: Move describe method into base class
Index group on creation and whenever a group is evicted from cache
Initial implementation of group index in Lucene
Add initial GroupQueryBuilder and define key predicate for group index
Add schema and index definitions for groups index
* stable-2.13:
Gerrit command line utility to set/update secure.config
Fix naming and message prompt for entering passwords
Don't truncate long lines in diff screens
Change-Id: I2210d94e0bc7374eff26614145e3a76b526177f5
When using a secure store for encrypting the secure.config
values, an utility or tool is needed to edit the values
using the same encryption key used by Gerrit at runtime.
Change-Id: Iacb017b010f7efd8217255796e571c5291499c0e
Introducing a cache for external ids is a preparation step for moving
the external ids from ReviewDb into NoteDb. For NoteDb it is planned
to store the external ids in a git note branch, where the note keys
are the sha1's of the external ids and the note values contain the
external id, the account id and optionally email and password. With
this format we can easily lookup external ids by the external id, but
listing all external ids of an account requires parsing all external
ids. Looking up the external ids of an account is possible from the
account index, however for reindexing an account we would still need
to lookup all external ids of the account from git. Having a cache for
the external ids ensures that the external ids are only loaded once
from git. If there is any update to external ids, we take care to
update the cache as well. For this change it means that all code that
modifies external ids must do an extra call to update the external id
cache. This is not optimal since updating the cache can be easily
forgotten. This is why the follow-up change cleans this up by
introducing a dedicated class that handles all external id updates and
then this is the only class that must take care to update the external
id cache.
Change-Id: I9ea979c646cddb9b39e723de5c061a70a2ce6fd6
Signed-off-by: Edwin Kempin <ekempin@google.com>
During the initialization of a new site the InitAdminUser init step
may create an account for the initial admin user. This new account
must be added to the index so that it becomes queryable. For this init
must have the account index available so that it can write the new
account to it. Reading from the index during init is not needed and
not supported.
Alternatively we could require users to run the Reindex program after
the initial site initialization, but likely many people would forget
about it and then wonder why the initial admin user is not working.
Change-Id: Iebee152fa0b28df3fe59da74ad688c4373488c53
Signed-off-by: Edwin Kempin <ekempin@google.com>
During the initialization of a new site some default groups are
automatically created ('Administrators' and 'Non-Interactive Users').
These new groups must be added to the index so that they become
queryable. For this init must have the group index available so that
it can write the new groups to it. Reading from the index during init
is not needed and not supported.
Alternatively we could require users to run the Reindex program after
the initial site initialization, but likely many people would forget
about it and then wonder why the default groups are not available from
the group index.
Change-Id: I274b142a6efde224bba68f8b5c459736d7a1f985
Signed-off-by: Edwin Kempin <ekempin@google.com>
ProjectQoSFilter uses username as a part of task info. However,
AuthFilter which comes later than ProjectQoSFilter renders the
value of username. As a result, username never gets resolved when
using git with http.
The current patch set resolves the username only when it is used,
i.e., in the toString method, and saves the value for reusage.
Bug: Issue 5206
Change-Id: I280c95b242d599919eee3c7007c60a0047170166
This fixes resource leak with JarFile instance acquired by call to
ctor of JarScanner.
Bug: Issue 5198
Change-Id: I80feabcf9e0bfd683d1d8c47f3fd6c9be3ff65a6
* stable-2.13:
Change kind cache: Don't fail if prior ps has no parent, but next ps has 1 parent
Make Gerrit startup timeout configurable
Change-Id: I2e6a53eb33cbe2e3059e65bd72bf80ff65fc2f3b
Allow users to configure the maximum time to wait for the gerrit.sh
start command to run Gerrit.
Bug: Issue 5179
Change-Id: If6ad15b51081c26ff02ecb7ad513551733ce1f79
* submodules:
* Update plugins/replication from branch 'master'
- Remove test prefix from test methods in replication plugin
We previously used 'test' to prefix tests but have decided to stop this.
This change removes the prefix from all test code.
Change-Id: I42e6191ece7872f4647e425e3ca0acf8c6452412
Reformat the Bazel build files with the buildifier tool [1].
The style is different for Bazel files. Most notably, indentation level
is 4 spaces instead of 2, and " is used instead of '.
[1] https://github.com/bazelbuild/buildifier
Change-Id: I95c0c6f11b6d76572797853b4ebb5cee5ebd3c98
Users want to get informed when they are assigned to a change. So far
there was no email notification on assigning a change to a user.
Change-Id: I7953b552f9814c283392b02520f5129e97cff9ff
Signed-off-by: Edwin Kempin <ekempin@google.com>
We previously used 'test' to prefix tests but have decided to stop this.
This change removes the prefix from all test code.
Change-Id: I229a36751adc6a87fbae8d6f373671e141529496