9011 Commits

Author SHA1 Message Date
David Pursehouse
62864b7a8a Update version to 2.9-SNAPSHOT in plugin archetype pom files
Also update the versions mentioned in the plugin documentation.

Change-Id: I052d65000e04d019d583b4817eef32312bd225db
2013-10-17 23:08:43 +09:00
David Pursehouse
2e99e0fb86 Update 2.8 release notes with recently added fixes and changes
Also fix wrong indentation level on the "Upgrades" section, and
fix the .war file download link.

Change-Id: I820dd163546aefe808b99b6ee079aaef051d97db
v2.8-rc0
2013-10-17 11:58:54 +09:00
Edwin Kempin
ea62148983 ChangeScreen2: Show download commands defined by plugins
The download commands are returned as part of the FetchInfo of a
revision, but only if the download commands are requested by setting
the option DOWNLOAD_COMMANDS.

This allows to completely customize the download commands on a Gerrit
installation.

This change only effects the download commands that are shown on
ChangeScreen2.

For non-anonymous download commands the username is now again included
into the displayed download commands. Also the HTTP scheme and the
Anonymous HTTP scheme can be used at the same time.

With this change the patch download (base64 & zipped) is still
hard-coded in Gerrit core and does not come from a plugin.

Bug: issue 2116
Change-Id: I8fb21fdeb1a98548ce9027655e1b5e467ee2d27e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-17 11:25:48 +09:00
David Pursehouse
78e868ef89 Merge "Register core plugin that implements the standard download commands" 2013-10-17 02:24:56 +00:00
David Pursehouse
ce423b139e Merge "Add extension points for adding download schemes and commands" 2013-10-17 02:24:45 +00:00
Shawn Pearce
5bba0b245e Merge "SideBySide2: Synchronize horizontal scrolling" 2013-10-16 21:48:19 +00:00
Shawn Pearce
fb6df0ebdb Merge "ChangeScreen2: linkify change author" 2013-10-16 21:24:16 +00:00
David Ostrovsky
49caaf5d89 ChangeScreen2: linkify change author
Bug: issue 2075
Change-Id: I99d9932f3408797d3819a4c03010dbe9ab542f8f
2013-10-16 14:18:21 -07:00
Dave Borowitz
8f6bb178b6 Add query tests for filtering/restarting paginated queries
Change-Id: Ifd8950cb3a2ed72ef19d611f5e5d51f2a03ce097
2013-10-16 14:17:11 -07:00
Dave Borowitz
a475bedc29 Add query tests for pagination and sort key ordering
Change-Id: I64fc2dc6c0bafa446dfde7ab91b0c1be61aa7c4f
2013-10-16 14:17:11 -07:00
Dave Borowitz
d2cccd4974 Don't add 1 to limit for index queries
The comment in AbstractQueryChangesTest incorrectly claimed the SQL
implementation was broken when it was actually the index
implementation.

Change-Id: I63b46a893937176ae02cd8141da9dc97db1d9e54
2013-10-16 14:17:11 -07:00
Shawn Pearce
3402ff3e80 Merge "ChangeScreen2: linkify branch and project name" 2013-10-16 21:13:39 +00:00
Edwin Kempin
7bfe1686e4 Register core plugin that implements the standard download commands
Change-Id: I07e7f9f0a7f68f3491d26afbacee4992c87e81c5
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 22:08:17 +02:00
David Ostrovsky
0d14e71b5f ChangeScreen2: linkify branch and project name
Bug: issue 2075
Change-Id: I6ddef6f1417b53e6a1e2b795ac9b67309d39abb6
2013-10-16 21:40:47 +02:00
Shawn Pearce
e348267448 Merge "Expose some BaseCommand's methods to support generic SSH commands" 2013-10-16 19:34:41 +00:00
David Ostrovsky
e3172b3496 Expose some BaseCommand's methods to support generic SSH commands
Exposing getName() to the derived SSH command implementation class allows us to
implement generic SSH commands.

For example Gerrit Shell plugin can now bind multiple commands to the same
class, which retrieves the shell command passed and executes it:

  public class SshShellModule extends PluginCommandModule {
    @Override
    protected void configureCommands() {
      command("ls").to(ShellCommand.class);
      command("ps").to(ShellCommand.class);
      [...]
    }
  }

With the possible implementation:

  public class ShellCommand extends SshCommand {
    @Override
    protected void run() throws UnloggedFailure {
      String cmd = getName().substring(getPluginName().length() + 1);
      ProcessBuilder proc = new ProcessBuilder(cmd);
      Process cmd = proc.start();
      [...]
    }
  }

And the call:

  davido@wizball:>ssh gerrit shell ls
  davido@wizball:>ssh gerrit shell ps

Change-Id: I43be66a99340e839b70c07e93752278cee5f039d
2013-10-16 12:32:55 -07:00
Edwin Kempin
29324b1fa6 Add extension points for adding download schemes and commands
Implementing the new extension points doesn't have any effect yet.
This is also why they are not yet documented. The documentation will
be added later once Gerrit makes use of them.

Change-Id: I30f46a1a4188d31a0aa825ad64cd794253932053
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 21:22:08 +02:00
Shawn Pearce
59816f869e Merge "ChangeScreen2: Show "Change-Id" instead of only "Id" in change info" 2013-10-16 18:38:43 +00:00
Shawn Pearce
b0c23b9399 Merge "Only return detailed accounts if requested" 2013-10-16 18:37:34 +00:00
Shawn Pearce
0e5f1f86a7 Merge "Cleanup project ConfigInfo constructor" 2013-10-16 18:35:55 +00:00
Shawn Pearce
8259041b4c Cleanup project ConfigInfo constructor
CurrentUser and ProjectState are implied by the ProjectControl.

Change-Id: I302882e39d20ae055e31d1691dffa85f4c5720eb
2013-10-16 11:34:33 -07:00
Shawn Pearce
df308aa46c Merge "Fix updating of project options" 2013-10-16 18:32:57 +00:00
Edwin Kempin
bb23f0fe3f Fix updating of project options
The REST endpoint that updates the project option is supposed to
return the updated project options, however at the moment it returns
the project options as they were before the update. As result
after changing the project options in the WebUI one needs to refresh
the screen in order to see the new values.

The problem was that ProjectControl was created for the project with
the old values and after the configuration was updated, this old
project control instance with the outdated project instance was used
to create the project options that are returned.

Change-Id: Ib3b94639364ef1ddb96772989937043c4251a30f
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 11:31:38 -07:00
Shawn Pearce
98aa6d3825 Merge changes I9ec71290,I6c20de69
* changes:
  Don't allow project owners to delete branches if force push is blocked
  Add acceptance test for testing branch deletion via REST
2013-10-16 18:29:04 +00:00
Edwin Kempin
40bd574102 Don't allow project owners to delete branches if force push is blocked
For deleting a branch by pushing to Gerrit it is required to have
force push permissions. For convenience project owners are allowed to
delete branches through WebUI/REST/SSH without force push permission
(because they anyway can assign this permission themselves). However
force push can be blocked on a parent project to prevent project
owners from deleting branches. In this case assigning force push on a
project has no effect. The problem is that project owners can still
delete the branches through WebUI/REST/SSH although force push is
actually blocked for them.

With this change project owners are only allowed to delete branches if
force push is not blocked for them. Administrators can still delete
branches even if force push is blocked.

Change-Id: I9ec712907e6f6f5a3cf33648d59340eaa72548f6
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 11:28:18 -07:00
Shawn Pearce
0e78dd70fa Merge "Create enum containing all Gerrit top menu items" 2013-10-16 18:20:54 +00:00
Dariusz Luksza
2d3afab63f Create enum containing all Gerrit top menu items
Instead of relying on string names for Gerrit's top menu items,
provide an enumeration that contains definitions of all top items.

It also adds GWT Extensions module to fulfill compilation dependency
for gwtui.

Change-Id: I7a109885b9a65b132e7119851cd76be527f75364
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
2013-10-16 11:19:29 -07:00
Shawn Pearce
5bb29a3ef1 Merge "ChangeScreen2: Simplify update available bar" 2013-10-16 17:55:10 +00:00
Shawn Pearce
eaa7183f9b Merge "Fix RpcStatus to display "Working..." when header is hidden" 2013-10-16 17:54:40 +00:00
Shawn Pearce
21854c9074 Merge "Fix Jetty server calling buck with custom PATH" 2013-10-16 17:53:23 +00:00
Dave Borowitz
ef21debe37 Use a fake MillisProvider in AbstractQueryChangesTest
Setting only the change timestamp based on a counter is not
sufficient; other callers elsewhere also call
DateTimeUtils.currentTimeMillis().

Change-Id: I897a6413a0d3f94cbab276bfc24468ee21458fdd
2013-10-16 10:10:56 -07:00
Dave Borowitz
288ed98c01 Remove usages of System.currentTimeMillis() from gerrit-reviewdb
Unlike pure server code, reviewdb.client is used from GWT, so we
cannot just use joda's DateTimeUtils.currentTimeMillis(). Instead,
just introduce arguments where necessary. Passing TimeUtil.nowTs() is
a bit cumbersome but usually short enough to type.

Change-Id: I87ef09b0920bc36851bca893a2a37348ffc6bf3a
2013-10-16 10:10:56 -07:00
Dave Borowitz
1d69c2e8ce Add TimeUtil.nowTs() to create a new Timestamp
Change-Id: I5b2457703a5812c99cd71dc2ad87e45ae5d665e2
2013-10-16 10:10:55 -07:00
Dave Borowitz
46b1ac8f07 Use DateTimeUtils.currentTimeMillis() to get current time
This method from joda-time supports replacing the system time provider
with a custom provider for tests. Since it is verbose, and we expect
more related methods, put it in the more succinct TimeUtil.nowMs().

This commit covers the trivial cases in the server side; client-side
code still uses System.currentTimeMillis().

Change-Id: I6c56e8c5bbb0cf7b0271e431d1ebdb532967b9e8
2013-10-16 10:10:55 -07:00
Edwin Kempin
d7c1d09738 Add acceptance test for testing branch deletion via REST
Change-Id: I6c20de69c96c22be1937f64e69cef7b0efb4d877
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 18:51:07 +02:00
Edwin Kempin
925bcc15e0 Merge "Improve documentation of buck settings override" 2013-10-16 15:40:41 +00:00
Dave Borowitz
a2023e9486 Use TimeUnits for sort key calculations
The unspecified units were confusing when writing tests around these
values, so be explicit about units in variable names and quantities
for conversion.

Use Ints.checkedCast so we fail fast when inserting a change 4000+
years in the future rather than having it not show up in search
results.

Correct the sort key epoch time, which likely had a timezone error
when initially calculated:

$ python -c 'import datetime; print datetime.datetime.fromtimestamp(1222819200L)'
2008-09-30 17:00:00

This mistake does not affect any data; the comment in the code was
just confusingly incorrect.

Change-Id: I6d8bcf4985e91c3d115002db42642049da8c708f
2013-10-16 15:37:06 +00:00
Edwin Kempin
ee7fbf3a3b Merge "Don't display project commands multiple times on save of options" 2013-10-16 15:35:38 +00:00
David Pursehouse
06a972965f Merge "AccountInfo: Link to how detailed account information is requested" 2013-10-16 15:21:33 +00:00
David Pursehouse
211cd6f76a Merge "Include username in REST example for getting change details" 2013-10-16 15:19:38 +00:00
David Pursehouse
d79c63ba13 Merge "Fix inclusion of username if detailed account information is requested" 2013-10-16 15:18:31 +00:00
David Pursehouse
4856782145 Improve documentation of buck settings override
Change-Id: I87e2ad3bc8e417f26758765cc6bde8880b3c653e
2013-10-17 00:14:47 +09:00
Fredrik Luthander
a3cf3548a8 Config file documentation: refs/meta/config and capabilities
Adds general information about global capabilities, how the server
ownership is administered and what it looks like underneath, i.e.
refs/meta/config.

Change-Id: Ia0da5d692b7f3c43c4471668944bdcc9de3b3cd6
Signed-off-by: Fredrik Luthander <fredrik.luthander@sonymobile.com>
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2013-10-16 16:52:12 +02:00
Edwin Kempin
65886f0e1e Include username in REST example for getting change details
Getting change details includes detailed account information, but the
example didn't show the username for the AccountInfos.

Change-Id: If0ff49924e3aa57cee087f16f3087304488f957b
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 15:04:59 +02:00
Edwin Kempin
fd03c30aad Only return detailed accounts if requested
We always returned detailed account information even if it wasn't
requested.

Change-Id: I8bf7c05feee659259b7a239facc50d96c3bae395
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 14:58:23 +02:00
Edwin Kempin
4a00e22d70 Fix inclusion of username if detailed account information is requested
The documentation of AccountInfo claims that the username is included
if detailed account information is requested but this was not the
case.

Change-Id: Ic28cadb6b7236ce69b60cb9d237fe18eae01e8e0
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 14:34:24 +02:00
Edwin Kempin
a13c5b8ee2 AccountInfo: Link to how detailed account information is requested
Some fields in AccountInfo are only included if detailed account
information is requested. Link to the option that includes detailed
account information so that readers know how these fields can be
retrieved.

Change-Id: I6d209469942549ffe4e5626ebc8604963899f29a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 14:14:54 +02:00
Edwin Kempin
4cfd76d888 Don't display project commands multiple times on save of options
On each save of the project options on the ProjectInfoScreen the
project commands are added once more to screen so that they are
displayed multiple times.

Change-Id: I5d9729d7a9870780c550429d841fae14396ef203
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2013-10-16 12:47:03 +02:00
Edwin Kempin
e1537dcce3 Merge "Update the replication and reviewnotes plugins" 2013-10-16 08:24:21 +00:00
David Pursehouse
df254424f0 Update the replication and reviewnotes plugins
This updates the plugins to versions that are adapted to the
simplified GitReferenceUpdatedListener.Event API.

Change-Id: I0d01639c4738945aafd3920acdfbe26cf23c176b
2013-10-16 10:22:37 +02:00