If a REST error occurs while adding a member or group to a group, the
command fails with "internal server error" which is not helpful to the
user.
Catch REST errors and allow them to be reported back to the user.
Other types of error will still result in "internal server error".
Change-Id: Ia21f7aa28212f6d93ec4e6ff74a9de9ee6428a00
* stable-2.13:
Fix to reindex a change via SSH: get from DB/Notes instead of Lucene
Update git submodules
Fix Postgresql JDBC driver leaking memory
Fix Schema_127 for mysql on case-sensitive FS
Update git submodules
Change-Id: Ida6a895ccb8cab2c68bb0cdb83fe4d076f2b007c
When reindexing a change via SSH, we need to avoid using the
Lucene index to decode the change-id into a ChangeControl.
The rationale stays in the typical use-case of the reindex itself:
if we need to recreate the Lucene index entry we cannot rely on
a Lucene query to find it.
Change-Id: I34dbf535241a604089ddb5d3af570c4b97c5cc2e
The propagate and propagateIfPossible methods are deprecated. Replace
them with the recommended alternatives.
Change-Id: I9107dc51b968e2acc453502ece3c5ed5dd58b5de
Sometimes GSONs JSON serialization method would fail, allowing the
exception to travel up to the event dispatcher and deregister the
listening user, without any logs identicating an issue.
The user would still be connected over SSH, not knowing something
went wrong.
Catch the exception, log it, and allow the stream-event to continue
serving events.
Change-Id: I4b1d4db6934566f1213ebc2e416dd95c1b0b07e6
This version fixed a major issue: [1] that was a reason of frustration
of many plugin developers: Not cache sources files under symbolic link.
Now for all such source files, the warning is issued:
"
Disabling caching for target //plugins/wip:wip__plugin, because one or
more input files are under a symbolic link
({plugins/wip=/home/davido/projects/wip}). This will severely impact
performance! To resolve this, use separate rules and declare
dependencies instead of using symbolic links.
"
To suppress this warning we add project.allow_symlink option. This
doesn't have any impact for gerrit core but silences the warning above
when plugins are built in gerrit tree mode.
As pointed out in this issue: [2], we are using some artifacts as source
to the java_library() rule as well as binary_jar for prebuilt_ja rule.
To avoid the warning, we rename sources to have "-sources.jar" suffix
and we rename *.zip to end with .jar in other places.
"
Assuming edit.src.zip is a JAR and renaming to edit.src.jar in
//gerrit-patch-jgit:edit_src. Change the extension of the binary_jar to
'.jar' to remove this warning.
"
source_under_test attribute was removed from java_test() rule.
Replication and cookbook-plugin are updated as well.
local.properties support was removed, but we use it only for download
process customization in our own python script, so that we can keep it
usage and not need to move it to .buckconfig.local.
[1] https://github.com/facebook/buck/issues/341
[2] https://github.com/facebook/buck/issues/855
Change-Id: Idf76cc71c21df43e808179b645f9175767b322a8
Some automated tools may want to suppress email notifications when
removing reviewers.
Change-Id: I26f66272d4f871aae9d36f3524faea9ffa86ea35
Signed-off-by: Edwin Kempin <ekempin@google.com>
Add new config key "sshd.kex". The default and supported values are:
1. ecdh-sha2-nistp521
2. ecdh-sha2-nistp384
3. ecdh-sha2-nistp256
4. diffie-hellman-group-exchange-sha256
5. diffie-hellman-group-exchange-sha1,
6. diffie-hellman-group14-sha1
7. diffie-hellman-group1-sha1
With Bouncy Castle installed, all of the above are supported (previously
only 6 and 7). With JCE, only 7 is available.
Bug: Issue 3517
Change-Id: I6b44e88dc4a0ff8f693f21510aba30546bf4cd99
(cherry picked from commit b4a04fa1c5d5ab6e87ac5cd2a046395090cf163f)
The propagate and propagateIfPossible methods will be deprecated
in Guava 20. Replace them with the recommended alternatives.
Change-Id: I1c8d19aac5434c938ee10af88766af14e5e4d023
When we converted ReceiveCommits to use BatchUpdate's parallel
functionality in I40545a4d, we lost the automatic request scope
propagation. This was mostly fine, with the notable exception of:
- pushing a new patch set of an existing change, and
- pushing multiple changes so work is in a background thread, and
- mentioning a user in a footer (Signed-Off-By, etc.), and
- not including an email address in that footer, and
- not having the account index enabled.
This would cause AccountResolver to try to call its
Provider<ReviewDb>, which fails because it's not in request scope.
Fix this by passing a ReviewDb into AccountResolver methods. That was
the easy part; the hard part was figuring out how to write a test case
that triggered this. Since the account index is now enabled by
default, this means putting a test-only hack into LuceneIndexModule
to support disabling a specific index. (This could also be useful for
other tests, since we currently don't exercise the non-index
fallbacks.)
Change-Id: I7231be3ea4660c9ee27f09994706b39ee622488a
The nio2 backend does not provide these data, so displaying dummy
values can confuse users.
Modify the command to only show those columns when the backend is
mina, which does support them.
Change-Id: I889339a4811e38c1b02211983bde6b6e017cd600
* stable-2.12:
Set uploader for inline edit
Update 2.12.4 release notes
SshDaemon: Set up the session timeout to make sshd.idleTimeout work
Attach sources for sshd-core and mina-core
Change-Id: I651e8901f96646660790a7ef6a14275f6d94343c
SshServer#start() sets up the session timeout by calling:
setupSessionTimeout(sessionFactory);
but SshDaemon overrides the start() method, does not call super(), and
does not call setupSessionTimeout.
Therefore, no session timeout is set up on ssh sessions, and sessions
continue to be kept open beyond the timeout specified in the configured
sshd.idleTimeout.
Change-Id: Ia72980d3f0f700386f62d301164f61f32405528e
As discussed on Gerrit ML[1] and in referenced issue, there are
situations where you may want to run an online reindex besides
the upgrade gerrit use case. This change allows users to force an
online reindex.
[1] https://groups.google.com/d/msg/repo-discuss/pUn8fHVh58w/icsSFef2CAAJ
feature: issue 3987
Change-Id: Ie88b7effda08996f7c0f325543be703bcf09c794
Plugins may register PostUploadHook instances in order to get notified
after JGit is done uploading a pack.
Now that PostUploadHook can be registered using the DynamicSet, use that
mechanism to register UploadPackMetricsHook.
Change-Id: If848bddc85ca8923a5d55f7dd448ac218c910e1c
When the new option --by-queue is used the output of the show-queue
command is grouped by the work queue. Queue name is printed on top of
the tasks list and the number of worker threads assigned to that thread
pool is printed in the summary line. This option should help Gerrit admins
to identify which thread pools need to be adjusted.
For comparison, here is an example output without the new --by-queue option:
Task State StartTime Command
------------------------------------------------------------------------------
9d51b721 16:29:14.750 git-upload-pack '/gerrit' (admin)
18fr4561 16:29:14.750 git-upload-pack '/gerrit' (admin)
ad52b823 16:29:14.750 git-upload-pack '/gerrit' (admin)
bd51bbcc 16:29:14.750 git-upload-pack '/gerrit' (admin)
11223344 16:29:14.750 git-upload-pack '/gerrit' (admin)
3d120b5c 17:28:20.169 16:28:20.169 Log File Compressor
------------------------------------------------------------------------------
6 tasks
With the --by-queue option the output looks like:
$ ssh -p29418 admin@localhost gerrit show-queue -w --by-queue
Task State StartTime Command
------------------------------------------------------------------------------
Queue: SSH-Interactive-Worker
9d51b721 16:29:14.750 git-upload-pack '/gerrit' (admin)
18fr4561 16:29:14.750 git-upload-pack '/gerrit' (admin)
ad52b823 16:29:14.750 git-upload-pack '/gerrit' (admin)
bd51bbcc 16:29:14.750 git-upload-pack '/gerrit' (admin)
11223344 16:29:14.750 git-upload-pack '/gerrit' (admin)
------------------------------------------------------------------------------
5 tasks, 14 worker threads
Queue: WorkQueue
3d120b5c 17:28:20.169 16:28:20.169 Log File Compressor
------------------------------------------------------------------------------
1 tasks, 1 worker threads
Change-Id: If82bdb50702f2001f887fe5004b0d80b61131a90
NotifyHandling is used for other purposes than adding a review, so
it doesn't really belong in ReviewInput.
Change-Id: I49ce1952eab0a75c8466a871fcc690a94b14e058
If NoteDb reads are enabled then the gsql ssh commands fails with
fatal: internal server error
due to DisabledChangesReviewDbWrapper (see Issue 4247).
As not all tables are migrated yet, it makes sense to still allow
low-level access to the db.
Bug: Issue 4247
Change-Id: Icebe51f470010d913f387bb98f7319616dd89aba
Two reasons:
1. Reusing an existing RevWalk to call isMergedInto or similar on it can
corrupt the state in the caller, see I0d242362.
2. The repository is already open before calling this method.
Pass the Repo instead of RevWalk and create a new clean RevWalk from the
Repo.
Change-Id: I00a6d9061d4c690c236e739b29b66b79427cd47b
Add new config key "sshd.kex". The default and supported values are:
1. ecdh-sha2-nistp521
2. ecdh-sha2-nistp384
3. ecdh-sha2-nistp256
4. diffie-hellman-group-exchange-sha256
5. diffie-hellman-group-exchange-sha1,
6. diffie-hellman-group14-sha1
7. diffie-hellman-group1-sha1
With Bouncy Castle installed, all of the above are supported (previously
only 6 and 7). With JCE, only 7 is available.
Bug: Issue 3517
Change-Id: I6b44e88dc4a0ff8f693f21510aba30546bf4cd99
To run the tests:
bazel test //...
To build the Gerrit plugin API, run:
bazel build gerrit-plugin-api:plugin-api_deploy.jar
To build the Gerrit extension API, run:
bazel build gerrit-extension-api:extension-api_deploy.jar
TODOs:
Licenses
Reduce visibility (all public for now)
Generate HTML Documentation
Core plugins
gerrit_plugin() rule to build plugins in tree and standalone modes
GWT UI (only gwt_module() skylark rule is provided, no gwt_binary())
PolyGerrit UI
WAR
Publish artifacts to Maven Central
Ask Bazel team to add Gerrit to their CI on ci.bazel.io
Contributed-By: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I9a86e670882a44a5c966579cdeb8ed79b1590de3
The changeCache is null when in the context of BatchProgramModule.
The only consumer of changeCache, VisibleRefFilter, is prepared to
handle a null value, so in all code paths it is okay for it to be
null.
This makes reindex work again. Regression introduced in
a758640bc33c20cead19b86a32db075c776c4140 (VisibleRefFilter: Avoid
touching the database for drafts, 2016-06-03):
$ java -jar buck-out/gen/gerrit/gerrit.war reindex -d ../gerrit-testsite
[...]
Reindexing changes: projects: 66% (2/3)[2016-06-06 16:18:36,781] [Index-Batch-3] WARN com.google.gerrit.server.index.change.AllChangesIndexer : Failed to index change 18
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) null returned by binding at com.google.gerrit.pgm.util.BatchProgramModule.configure(BatchProgramModule.java:126)
but parameter 8 of com.google.gerrit.server.project.ProjectControl.<init>() is not @Nullable
while locating com.google.gerrit.server.git.SearchingChangeCacheImpl
for parameter 8 at com.google.gerrit.server.project.ProjectControl.<init>(ProjectControl.java:177)
while locating com.google.gerrit.server.project.ProjectControl annotated with @com.google.inject.internal.UniqueAnnotations$Internal(value=4)
Reported-by: Viktar Donich <viktard@google.com>
Change-Id: Ia0ca0e0e153c9f357e5ebc6edf4b1962a2490f2d
This is an analogous problem to the one with search results fixed in
Ie54b9e2d. VisibleRefFilter is a little trickier because it was using
ChangeCache, which only returned Changes, not the reviewer set. Change
SearchingChangeCacheImpl to cache a different value type and return
ChangeDatas from its search method so we can use the cached
ReviewerSet where appropriate.
Unfortunately for the Reindex program we still need to support not
having a SearchingChangeCacheImpl, which means we have a completely
separate codepath for reading changes from the database.
Change-Id: Ic432a8e48a2bafc8d142b84b25101d95ffb674b7
When a DFS ref update of a NoteDb meta ref fails due to a transient
error in the storage backend, we don't want to incur an additional
write to the ref during reindexing, as it may just fail again. Worse,
while BatchUpdate knows to ignore NoteDb write updates when executing
its NoteDbUpdateManager, it can't as easily ignore them while getting
its index futures. Thus an error that was successfully ignored is
likely to be followed by one that can't be.
Work around this for the case of NoteDb writes enabled but reads
disabled, by explicitly turning off auto-rebuilding from
ChangeIndexer. This doesn't help us in the case of NoteDb reads being
enabled, where we have to be able to read the latest NoteDb data from
the ref in order to reindex.
Change-Id: I64000a57ffcf73a9cbef42a6130e1fb4bc8e98f0
The initial implementation allows to index specified changes. In future
this could be extended to allow indexing of changes by project/branch.
Change-Id: Ia66b086b8bd8d49fe536332d96e3292087fefa01
Move writeError from SetReviewersCommand to BaseCommand. Remove the
similar method from ReviewCommand and adapt the code to the slightly
different signature.
Change-Id: Ie6f326198ff87892f2f7dd6b1ec309d24cb35549