592 Commits

Author SHA1 Message Date
Shawn Pearce
dddc6368c6 Merge branch 'stable-2.8'
* stable-2.8:
  Remove 'including replication' from the show-queue command description
  Add description for commands disabled in slave mode
  Remove unused import of Nio2ServiceFactory
2014-01-23 21:34:09 -08:00
David Pursehouse
ecb03a6d70 Remove 'including replication' from the show-queue command description
Replication is handled by the replication plugin.  The plugin might not
be installed, so including this in the description could be misleading.

Change-Id: If741d932dbabc5425d8a703e8ff12eb0bfd7e321
2014-01-24 14:17:10 +09:00
David Pursehouse
84bcead690 Add description for commands disabled in slave mode
Running the `gerrit` ssh command without arguments to a server that
is running in slave mode results in a list of available commands
being shown.

In this list, the commands that are disabled in slave mode do not
have any description.

Add a description mentioning that the command is disabled due to
the server running in slave mode.

Bug: Issue 2424
Change-Id: Iffc43a921e70a9ed9008a62dcec12b80683b71b3
2014-01-24 14:17:04 +09:00
David Pursehouse
6ef51f6615 Remove unused import of Nio2ServiceFactory
Change-Id: I22ad4a22616ce506cc03008fde639f979deb9a36
2014-01-24 14:02:56 +09:00
Shawn Pearce
d07180faa9 Merge branch 'stable-2.8'
* stable-2.8:
  Remove obsolete commands from slave mode commands list
  SSHD: drop nio2 backend for now as it appears to be broken
2014-01-23 20:49:30 -08:00
Shawn Pearce
735d224e9a Merge "SSHD: drop nio2 backend for now as it appears to be broken" into stable-2.8 2014-01-24 04:48:28 +00:00
David Pursehouse
80b4c8f111 Remove obsolete commands from slave mode commands list
Running the `gerrit` command without any arguments over ssh results
in a list of available commands being shown.

When running the Gerrit server in slave mode, this list includes the
`approve` command which was deprected and then removed, and the
`replicate` command which is now handled by the replication plugin.

Remove these commands from the list.

Change-Id: Ide32dde34dcb1bc59a05001c43d2ce423d193ba0
2014-01-24 12:00:40 +09:00
David Ostrovsky
46f8488a78 SSHD: drop nio2 backend for now as it appears to be broken
Mina SSHD nio2 backend is currently broken. Drop it from the configuration
and code. It appears that the bug is already fixed upstream [1]. Waiting
for the next SSHD release 0.10 for upgrade before we can enable it again.

[1] https://issues.apache.org/jira/browse/SSHD-252

Reported-By: Will DeBerry <willdeberry@gmail.com>
Change-Id: I6dbf0f7a1165b25304ef07f2792db67828dca10c
2014-01-23 00:47:32 +00:00
Dave Borowitz
d064abea4f Start migration to notedb implementation of PatchSetApprovals
Encapsulate the current state of the migration in a NotesMigration
class. For each database table (or broader group of functionality)
that we migrate to notedb, configure a boolean indicating whether that
data should be read from notes, defaulting to false.

Unlike reads, NotesMigration contains just a single boolean
indicating that data should be written. We don't attempt to write
just some types of data; as the migration continues we will just
rewrite history.

Since most existing reads of the PatchSetApprovals table have been
migrated to ApprovalsUtil, most implementation changes happen there.
There are a few other implementations scattered around, and some that
will require a bit more work (e.g. stamping normalized approvals at
submit time).

Change-Id: I5676267d4de607c385e8c9917a89333863b9c9e7
2014-01-08 11:58:24 -08:00
Edwin Kempin
6ff9928f64 Use REST endpoint to create project in SSH create-project command
Change-Id: Icb0e5fa8b156486fffaf40e71b60274d68260e06
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-12-30 08:08:20 -08:00
Dave Borowitz
fcb204627b Only construct ChangeResources via ChangesCollection.parse
In a notedb world we would like to slurp all information about a
change from the git-based storage as soon as a ChangeResource is
constructed, which will involve extra work in this parse, analogous to
how parse currently validates the change permissions.

Preserve the ability to pass in a particular ChangeControl object,
since various callers have specific requirements like reusing the
control elsewhere, or using a control for a different user.

Change-Id: Ia7c9761ef92bb8f05ae3323210babaa02b0dbe6f
2013-12-17 16:03:16 -08:00
Dave Borowitz
ae3e53b50c Delete old PublishDraft
The only remaining caller was ReviewCommand; use the new-style API and
clean that up as well.

Change-Id: I2ee77c11ffada28b0edc7fba14f23d5d1b4313f6
2013-12-16 12:29:27 -08:00
Dave Borowitz
baf96c47f7 CreateBranchCommand: remove unused imports
Change-Id: I8c1b3d60ed8192c64e1299338a4eaa858a8f92e7
2013-12-13 12:31:04 -08:00
Shawn Pearce
71e65d9926 Merge "Add ssh command create-branch for creating branches" 2013-12-13 15:46:55 +00:00
Dave Borowitz
57ecf24c06 Consolidate parsing and formatting for label votes
We currently support two styles of parsing, Label-Value and
Label=Value. Consolidate these into a single LabelVote class.
(Unfortunately for backwards-compatibility reasons we can't just
eliminate Label=Value in ReviewCommand.)

Change-Id: I9e5255b184d786226e6b11fe059001608c00673d
2013-12-11 13:57:50 -08:00
Mani Chandel
7ec4ac71ff Add ssh command create-branch for creating branches
This command will allow users to create branches via ssh.

Feature: Issue 1156
Change-Id: I270df6bc3ed95581aa2fc6845c654f2d9a5c72b1
2013-12-10 19:06:16 +09:00
Matt Baker
edf0ebf252 Remove the use of + when using StringBuilder (2 of 2)
Change-Id: I1637da545620b4d61e5becc2d56cd209daabbc96
2013-12-08 20:00:59 -07:00
Shawn Pearce
dd5f4ca82a Merge branch 'stable-2.8'
* stable-2.8:
  Bugfix: Changing Task state breaks comparator in ShowQueue
2013-12-07 09:51:51 -08:00
Shawn Pearce
eadd369fda Merge branch 'stable-2.7' into stable-2.8
* stable-2.7:
  Bugfix: Changing Task state breaks comparator in ShowQueue

Conflicts:
	gerrit-server/src/main/java/com/google/gerrit/server/git/WorkQueue.java
	gerrit-sshd/src/main/java/com/google/gerrit/sshd/commands/ShowQueue.java

Change-Id: I7f5d5484c49a8dfb1e634ad57e28ba13ed3a607d
2013-12-07 09:47:58 -08:00
Sven Selberg
ae4349db63 Bugfix: Changing Task state breaks comparator in ShowQueue
This can happens if you have a long queue and the state of
a task (DONE, CANCELLED, RUNNING, READY, SLEEPING, OTHER)
changes while the sorting is ongoing. The reason this
generates an error is because the Task State defines
the tasks’ place in the queue.

If Task state changes while the sorting of the queue is
ongoing the Comparator violates its contract of:
X<Y, Y<Z => X<Z
and throws:
IllegalArgumentException: Comparison mehtod violates its
general contract!

Fixed this bug by saving a snapshot of the state and delay
of the tasks in a wrapper.
* Introduced interface TaskInfo that is implemented by
  QueueTaskInfo
* Added getTaskInfos method in WorkQueue decoupling it from
  ShowQueue implementation by Interface and factory.

Signed-off-by: Gustaf Lundh <gustaf.lundh@sonymobile.com>
Change-Id: Iea17046aea1b8c6119cfc663438e17f663e05b22
2013-12-07 09:43:11 -08:00
Dariusz Luksza
357a242708 Enable standalone JavaScript plugins
The idea of 'standalone JavaScript plugins' came during the 'JavaScript
plugins' talk at the Gerrit User Summit.

The main concept is to automatically install and expose all *.js files
that are in Gerrit's plugins/ directory.  This should lower the entry
point barrier for JS developers.

There is one limitation of such plugins: they cannot contribute
additional resources.  When such are required, the implementer should
inline them in JS code or use the gerrit-plugin-js-archetype.

Change-Id: Ibad8c3938c0855fcabe6937fd8b4d508a9a2eac3
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
2013-12-07 18:01:54 +01:00
Dave Borowitz
8d2ab515cb Fix various unchecked warnings
Checked type inference has changed slightly in Java 7, so many of the
suppressions are no longer necessary.

Change-Id: I73585e888b8204429ea67c8f4822d81d4dad8c46
2013-12-05 09:11:11 -08:00
Colby Ranger
faef658f38 Include addReviewer in ChangeApi.
Also, update the PostReviewers.Input to be named AddReviewerInput.

Change-Id: Ide60a3f261d59a3af988d94c3c1bdbd1dcfdcd79
2013-12-04 13:56:05 -08:00
alex.ryazantsev
05872efbbd Replace 'for' loop with 'foreach'
Change-Id: I5ca01d678b8cf9e9fc75b21270329b483e31694e
2013-12-04 01:02:53 +04:00
David Pursehouse
2ede20d73d Add --branch option on the review ssh command
The review command allows the patch set to be specified by the commit's
sha1 revision.  It is possible that the revision does not identify a
unique change if the same sha1 has been pushed to more than one project
or to more than one branch of the same project.  This causes the review
to fail with an error.

The results can be narrowed down to a specific project by using the
--project option, but it will still fail if the sha1 is on more than
one branch in the same project.

Add a new --branch option that allows to narrow down the results by
branch.

Bug: Issue 1752
Change-Id: I555dc9de1b092e7562f5d99c4c60df589935a47f
2013-12-04 00:02:16 +09:00
Shawn Pearce
05cb053378 Save GWT compile time by avoiding javac
GWT only needs the rebind code for CSS and ServerLinker to be
precompiled as bytecode. Save build time by passing no source
files to the java_library() used by gwt_module().

For a full draft build of ui_safari this cuts the refresh time
down from 32.015s to 26.158s on my MacBook. Saving 6s on each
UI reload adds up during development.

The common annotations need to be provided as bytecode, avoiding
spurious warnings from GWT when there is a Java syntax error.

Change-Id: I37826498650c65c05303e7d4d1177d05781c56f6
2013-11-30 11:06:50 -08:00
Edwin Kempin
bbc4fa77b0 Merge "Fix 'Potential heap pollution via vargs parameter' warnings" 2013-11-29 19:45:53 +00:00
Shawn Pearce
d170274b24 Fix 'Potential heap pollution via vargs parameter' warnings
Most existing sites are safe.  The implementating method only scans
the array and does not retain it beyond the method invocation.  In the
questionable cases use ImmutableList instead of a varargs array.

Change-Id: Ic2d0c1c1801a68ec58b642552e97e2d193b40a98
2013-11-29 11:37:14 -08:00
David Pursehouse
85c458b4d8 Merge "Remove unused @SuppressWarnings" 2013-11-29 08:08:53 +00:00
Shawn Pearce
74966d5b04 Remove unused @SuppressWarnings
Eclipse Kepler says these are not necessary.

Change-Id: Ie7af85e512532b084a1a13df37792ffec11680fc
2013-11-29 09:03:35 +01:00
Shawn Pearce
72fb6cc514 Remove unused .gitignore
These were necessary only for the Maven based build.

Change-Id: Ie26669e6ccae60a52d2db1b8ad362e2fa88a26f2
2013-11-28 22:56:51 -08:00
David Ostrovsky
c53fd3ae49 Delete eclipse left-over files from the Maven poop era
Change-Id: Ie3a75e8c6a2d274cd39e362259ab20cff474eb8d
2013-11-28 22:55:09 -08:00
David Ostrovsky
27d1ec933f CommandMetaData: Delete deprecated descr() method
Change-Id: Ic8109b79756765d48f2bc015d5ef274229593466
2013-11-29 00:05:16 +01:00
David Pursehouse
7c1408a39f Merge branch 'stable-2.8'
* stable-2.8:
  Update the 2.8 release notes with recently merged changes
  Update documentation of the `review` command
  Fixed several spelling mistakes
  Remove deprecated approve SSH alias

Conflicts:
	Documentation/cmd-index.txt

Change-Id: Ieb4708793b0e323dcb2a68a31e59035519ec4af9
2013-11-28 17:09:03 +09:00
David Ostrovsky
b6f01308af Remove deprecated approve SSH alias
Change-Id: I540c8e9f1476c17cfd64079f513de8bd48ce774d
2013-11-27 21:22:06 +01:00
Shawn Pearce
dd218662c0 Replace <code> with {@code} in javadoc
{@code foo} is shorter and easier to read and write than
<code>foo</code>, which is why it was introduced years ago in the
javadoc processor.  Make consistent use of it throughout the
documentation comments.

Change-Id: I59d428cb6c5015453629398b0697891b83c8e91d
2013-11-24 13:12:20 -08:00
David Ostrovsky
75d3f60f23 Restore configuration option sshd.requestLog
66252ed8ea3859433b2e9572b9d3bc68e73bdedd erroneously removed that option.

Found by Bruce Zu.

Change-Id: I403a6c9755afb6097a8c42212dae62e29b38e7d6
2013-11-24 18:01:00 +01:00
Edwin Kempin
b926a7c0d8 Add --notify option to SSH review command
This allows to control to whom to send email notifications to after
the review is stored.

Change-Id: Ifbef1419e59a8cb5750cb0e48f47b6652aae9e36
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-24 07:45:12 +01:00
Shawn Pearce
2d6cb9a62b Merge "Support to configure default submit type for newly created projects" 2013-11-23 01:00:04 +00:00
Eryk Szymanski
feebf7cc98 Clean-up of formatDate method in SshLogLayout
Change-Id: Idf321a7f91354f6e232e2cc4f945e74156902713
2013-11-21 16:53:55 +01:00
Edwin Kempin
a79ea550cc Support to configure default submit type for newly created projects
Bug: issue 2257
Change-Id: If65a15c1f2928d26ffb2ab6fb12acbdc9b2cdda8
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-11-20 07:01:51 +01:00
David Ostrovsky
8e4a99051d Document programmatic HTTPD and SSHD logging configuration
Change-Id: Ie342a593a8ae854fe33f312cac22e1089119614a
2013-11-20 00:02:12 +01:00
Eryk Szymanski
66252ed8ea Enable sshd_log and httpd_log to use log4j config
At the moment log4j configuration is a bit inconsistent: it is
possible to configure error_log and gc_log using file provided
with log4j.configuration system property, however httpd_log and
sshd_log configuration is hard-coded in corresponding classes
(HttpLog and SshLog).

Make logs configuration more consistent by using log4j for all
logs. If log4j.configuration variable is not set, log behavior
remains intact and code-level log configuration will be used.

In case of log4.configuration points to log4j.properties file the
hard-coded configuration will be ommited and log4j.properties will
be used instead.

In addition shouldConfigureLogSystem() call moved from ErrorLogFile
to LogUtil in com.google.gerrit.util package and removed deprecated
reference to log4j LogManager.DEFAULT_CONFIGURATION_KEY so that
gerrit common does not require log4j.

Two inner MyLayout classes (one from SshLog and one from HttpLog)
have been extracted to separate files and renamed accordingly to
enable to use them from log4j.properties file if required. At the
moment those are extracted as is - refactoring will follow.

Change-Id: Icb1a3787b98392a9df9bb2afa4dc857f8cfada3a
Signed-off-by: Eryk Szymanski <eryksz@gmail.com>
2013-11-19 13:06:05 -08:00
Shawn Pearce
40b526ae33 Merge "Remove unnecessary 'return' statements" 2013-11-18 03:51:16 +00:00
alex.ryazantsev
cc2bccfdfd Remove unnecessary 'return' statements
Change-Id: Ie517a85ad5d0d53479b8f726b932048acce4f889
2013-11-18 02:23:53 +00:00
alex.ryazantsev
5c96817e31 Remove unnecessary assignments
Change-Id: I7890b296474811b16f57e029f9142655df1bc945
2013-11-18 02:12:52 +00:00
Shawn Pearce
cb48541b99 Merge "Cleanup implementation of REST views" 2013-11-15 08:24:30 +00:00
Shawn Pearce
445a70549e Merge "Bump args4j version to 2.0.26" 2013-11-15 08:05:28 +00:00
David Ostrovsky
985752f232 Bump args4j version to 2.0.26
New version has features which be useful for Gerrit core and plugins:

* new hidden attribute, specifying to hide it in help message
* new depends attribute, specifying the dependent option(s)
* multiValued attribute was removed

Change-Id: Ic7e9f37231cb83940db50fe3b9efe8ad972108cf
2013-11-15 09:58:39 +01:00
Shawn Pearce
a9e635929b Merge changes I3e19b234,I9d7d04f4
* changes:
  Add UI action to trigger GC on a project
  Add option for running GC whether progress information should be shown
2013-11-15 08:02:05 +00:00