11094 Commits

Author SHA1 Message Date
David Ostrovsky
a3892f5a7f Bump Jcraft SSH library to 0.1.51
ChangeLog claims that new release fixes sporadic "verify: false" failures.

Change-Id: I1deba0b20dd713c0a9d2ed53b1751dbd078094ab
2014-04-21 09:40:59 +02:00
Edwin Kempin
67f9b1c3c9 Merge "Merge branch 'stable-2.9'" 2014-04-17 07:57:53 +00:00
Edwin Kempin
e61af1bb72 Merge "Update JGit to get latest archive format registration fix" 2014-04-17 07:41:27 +00:00
David Pursehouse
b2eb1260bb Merge branch 'stable-2.9'
* stable-2.9:
  Enable automatic close changes on 'refs/meta/config'
  Implement pagination in group list screen
  Add option 'n' and 'S' to groups REST API to limit group results.
  Do not refresh group list if filter did not change
  Don't show the submit button for draft patch sets
  Prevent draft changes from being abandoned
  Allow plugins to refresh Gerrit's menu bar

Change-Id: Iedfdea0105829119dfe5e2d729bb53b55b233d74
2014-04-17 14:31:46 +09:00
David Pursehouse
830f16ccbc Merge branch 'stable-2.8' into stable-2.9
* stable-2.8:
  Enable automatic close changes on 'refs/meta/config'
  Implement pagination in group list screen
  Add option 'n' and 'S' to groups REST API to limit group results.
  Do not refresh group list if filter did not change
  Don't show the submit button for draft patch sets
  Prevent draft changes from being abandoned

Change-Id: I5e6d415efbae92af684efa8df0f8a7e7f4e8a5ed
2014-04-17 14:14:43 +09:00
Bruce Zu
77bb62076c Enable automatic close changes on 'refs/meta/config'
Bug: issue 2569
Change-Id: Ic192daa21cfcc1f26fa9f00feb14f41013a29fb9
2014-04-17 13:47:47 +09:00
Dave Borowitz
ebeb4a8e2a Update JGit to get latest archive format registration fix
Change-Id: Ie62d825603c0aa091bf79972804f4128ca067380
2014-04-16 15:29:05 -07:00
Anthony Chin
d5edded54d Implement pagination in group list screen
Group list screen now uses pagination similar to project list screen.
The number of groups displayed is determined by the 'Maximum Page
Size' in user preferences.

Change-Id: Id4649fda4b06ef62bf9d630460aeefc1c5f65989
2014-04-16 21:21:00 +09:00
Anthony Chin
dc78329e34 Add option 'n' and 'S' to groups REST API to limit group results.
List groups endpoint now has an option to limit the number of results
returned and a start to define nonzero offset in order to support
groups pagination.

Add and document 'n' and 'S' function to allow query group list from
a specified limit and start.

Both options will then be used to render group list with pagination
in web UI.

Change-Id: Ibf244b1cfe83c56dc1c23aabf70a55697b52c835
2014-04-16 21:20:02 +09:00
Edwin Kempin
0309802819 Merge "StringListPanel: Do not ignore empty values when adding new row" 2014-04-16 09:42:52 +00:00
Anthony Chin
e3ba9e44e6 Do not refresh group list if filter did not change
Every time key up event is raised in the group list filter box, the
group list was getting refreshed even if the filter did not change
(e.g. moving the cursor was refreshing the list).

Only call the refresh if the filter is changed or enter is pressed.

Change-Id: I64d24eeae08f35723b401fffd9a3e8ed84c8d00c
2014-04-16 03:43:45 +00:00
Dave Borowitz
dc80fddce0 Add simple tests to launch Reindex
We currently have no tests for the Reindex injector stack, and it is
not uncommon for changes to break Reindex as contributors do not
always know or remember to run it.

Add tests that run the Reindex program directly via GerritLauncher,
using a real injector stack on a newly created site.

Eventually we may want to reindex a site with changes in it, wiring up
GerritServer, which is beyond the scope of this test.

Change-Id: Ic6f32ee4d24395be74b3ea60b9084c79531c6a4a
2014-04-15 07:55:59 -06:00
Dave Borowitz
dcbb89ae6f Merge "Fix: Guice creation error in Reindex" 2014-04-15 12:14:04 +00:00
David Pursehouse
6534b9eb47 Don't show the submit button for draft patch sets
Currently the button is enabled for all open changes, but if
the patch set is a draft, pressing it results in an error.

Change-Id: I382fc9330b73d357c00ba0209f18d2c1584e9256
2014-04-15 18:56:54 +09:00
David Ostrovsky
62096c7b03 Prevent draft changes from being abandoned
When a draft change is abandoned it is currently published to all
users by setting the status to ABANDONED.  Restoring the change will
effectively publish the change as /restore sets the status to NEW.

To not complicate the workflow, prevent draft changes from being
abandoned.

Change-Id: If747264fa66a2139e0d8f13987125d853ec3bed9
2014-04-15 18:49:24 +09:00
Edwin Kempin
049c35574d Allow plugins to refresh Gerrit's menu bar
Change-Id: Id908ebe23a07f2ae45e131a9b8a98c24f4a9cf74
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-15 11:26:55 +02:00
Edwin Kempin
b40f4a1571 StringListPanel: Do not ignore empty values when adding new row
The position of a value in the value list defines its meaning. If
empty values are ignored the positions of follow-up values are wrong.
Also the up and down arrows for sorting are then displayed in the
wrong columns since they are displayed after the last value of the
value list.

Change-Id: I83a346c48018737ec0154c5f4e224b6de8226801
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-15 11:13:02 +02:00
Bruce Zu
52b7839c2d Fix: Guice creation error in Reindex
Run reindex without '--recheck-mergeable' will get
Guice creation error which say No implementation for
com.google.gerrit.server.change.ChangeKindCache was bound.

Fixed.

Change-Id: I89118ce699e91b82f26da772fd252e4f29645dc0
2014-04-15 13:03:06 +08:00
Shawn Pearce
46c3071948 Restore ChangeKindCacheImpl.Key's public accessors
The virtual hosting cache behind gerrit-review needs to have direct
read access to the members of persisted cache keys.

Change-Id: I6ad9f09cbdb575dd3d4f267ed5ff361bcc9e415d
2014-04-14 15:44:07 -07:00
Shawn Pearce
480a8ecf78 Merge "Rewrite my menu preferences to avoid ProjectState caching" 2014-04-14 19:51:38 +00:00
Shawn Pearce
3f621ca0c2 Rewrite my menu preferences to avoid ProjectState caching
Storing individual user menus inside of the All-Users project state
object leads to unconstrained server memory growth. As users load
preferences the ProjctState object retains all of their preferences.
The cache is only cleared when refs/meta/config within All-Users is
modified, which is very infrequent.

Instead of abusing the ProjectLevelConfig for user preferences,
build a new type VersionedAccountPreferences from the base helper
VersionedMetaData. Load and store all preferences dynamically from
Git. This is similar to the model change metadata will use in the
future, so flushing out any performance problems now with simpler
models like the user preference store is valuable.

User preferences are not accessed very frequently; only at initial
tab load and if the user modifies their settings. If there are any
current performance problems with this storage model the current
impact will be slight while the issue is worked on.

Change-Id: I74c1aed4119b48557e954cc602eb1cf178d201bb
2014-04-14 12:34:39 -07:00
Dave Borowitz
b9dd0c99e3 Merge changes I1ea2b411,I8bc25d32,I9176c6ff,I061e1eb9,Ib95cf23e, ...
* changes:
  Enable notedb tests for LabelTypeIT
  Copy labels dynamically in ApprovalsUtil.byPatchSet
  Remove unused ApprovalsUtil from ChangeControl
  Extract a non-caching ChangeKindCache implementation for tests
  Persist the ChangeKindCache
  Merge branch 'stable-2.9'
2014-04-14 19:33:41 +00:00
Dave Borowitz
a06b46982b Enable notedb tests for LabelTypeIT
Fix construction of labels in ChangeJson to use
ApprovalsUtil.byPatchSet where appropriate, to get appropriate label
copying and normalization behavior.

For now, keep the existing behavior of showing reviewers in the
detailed label output if they have ever voted on any patch set of the
change, even if they are not currently listed as a reviewer.

Change-Id: I1ea2b4110fb3eca41c9bb406e8ee11e1f60a8e69
2014-04-14 12:12:55 -07:00
Dave Borowitz
8e36bbdcd7 Copy labels dynamically in ApprovalsUtil.byPatchSet
The intent is to use this method from ChangeJson to dynamically copy
labels every time the change detail is loaded, thus not relying on
one-time copying of labels in the notedb read path.

To do so requires a bit of refactoring, since the ChangeControl now
needs to be passed into this method.

Change-Id: I8bc25d32a91218e074517dcacf4bf3a77d4ae957
2014-04-14 12:12:54 -07:00
Dave Borowitz
87c760e29f Remove unused ApprovalsUtil from ChangeControl
Change-Id: I9176c6ff29d5d9d7dc8570086df0b97f20ddee12
2014-04-14 12:12:54 -07:00
Dave Borowitz
8f92cb9b2b Extract a non-caching ChangeKindCache implementation for tests
Change-Id: I061e1eb96d167750af8b7fa533d6f8f5722bfc8f
2014-04-14 12:12:53 -07:00
Dave Borowitz
3fe088561c Persist the ChangeKindCache
What kind a patch set is relative to the previous patch set is
basically immutable, given the project config and merge strategy name.
(It could conceivably change if the underlying JGit merge algorithm
changes, but hopefully we would notice and bump the
serialVersionUID of the Key and recommend people flush their caches.)

Change-Id: Ib95cf23e39a3b43dbb38901b52ef7bd71da87f41
2014-04-14 12:12:53 -07:00
Dave Borowitz
d2c6b664dc Merge branch 'stable-2.9'
* stable-2.9:
  Ensure NrtFutures are notified promptly of new search generation
  Fix deadlocks in SubIndex shutdown

Change-Id: I0dd60f02c6ee37938eb8d36f61c02a7ffe34ca88
2014-04-14 12:11:12 -07:00
Dave Borowitz
d3e10a9724 Merge branch 'stable-2.8' into stable-2.9
* stable-2.8:
  Ensure NrtFutures are notified promptly of new search generation
  Fix deadlocks in SubIndex shutdown

Change-Id: I723fb1cab17e57eb8714f9fa6c2f62b0c2d62a72
2014-04-14 12:10:34 -07:00
Dave Borowitz
953784a50f Ensure NrtFutures are notified promptly of new search generation
The internal waiting generation counter in
ControlledRealTimeReopenThread is only increased when
waitForGeneration is called. This controls whether the min or max
refresh time is used for waiting. Because NrtFuture.get is not called
directly and listeners may be used instead, this was not guaranteed
to happen, leading to long delays. Fix this by doing a dummy wait for
0ms at future construction time.

Change the order of refresh listener initialization so any
removeIfDone calls are made only after the internal listener within
ControlledRealTimeReopenThread updates its searching generation.

Change-Id: I0edf4a3d38a160496afaf0587cf14b6fee2f2aa5
2014-04-14 10:46:30 -07:00
Edwin Kempin
3e72a2f691 Merge "Throw BadRequestException if project input name does not match URL name" 2014-04-14 17:41:38 +00:00
Edwin Kempin
5d8558d18f Merge "Don't swallow exception message when project creation via SSH fails" 2014-04-14 17:40:14 +00:00
Dave Borowitz
8fdf04333a Fix deadlocks in SubIndex shutdown
Because WorkQueue.Module and LuceneIndexModule are in the same
Injector, the ordering of their LifecycleListeners' stop() methods is
not defined. Tasks on the queue, e.g. background mergeability checks,
might try to perform index writes after the SubIndex is shut down.

Shutting down the SubIndex stops the ControlledRealTimeReopenThread,
which immediately sets the generation to Long.MAX_VALUE and notifies
any callers currently waiting on a generation. But the call sites
using NrtFutures in LuceneChangeIndex are not calling NrtFuture.get,
which waits on a generation; they are using Futures.allAsList, which
depends on addListener.

So, we need to check the generation number in the call to addListener
as well as in in get.

This may also improve performance, since futures in some cases will
not need to wait for a reopen thread refresh cycle before notifying
their listeners.

Change-Id: I0ec3e315638a90dd5da3cf7f0d2cc50599a5bb36
2014-04-14 08:40:31 -07:00
David Pursehouse
5a5453579a Throw BadRequestException if project input name does not match URL name
Throwing a RestApiException is inconsistent with all the other cases
where BadRequestException is thrown when input value does not match the
URL value.

Change it to be consistent.

Change-Id: I1fa37910c3fc3693cbdde59778e5e1454d3d2d51
2014-04-15 00:03:29 +09:00
David Pursehouse
2758c69115 Merge "Update GWT version in GWT plugin archetype" 2014-04-14 14:54:13 +00:00
David Pursehouse
c1627f43a0 Merge "Return '#/dashboard/self' as URL for the 'My' -> 'Changes' menu entry" 2014-04-14 14:53:47 +00:00
Edwin Kempin
1de85e794d Update GWT version in GWT plugin archetype
Change-Id: I34a2478bbb2bc1712d9cc7f3370db55735829d51
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-14 14:19:53 +02:00
Edwin Kempin
3c2d4e161f Don't swallow exception message when project creation via SSH fails
Change-Id: Id1d1b3faa76000fd9d7472edd6e732e7213b0030
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-14 12:23:19 +02:00
Edwin Kempin
10ee9f3062 Update plugin archetype version in plugin documentation
Change-Id: I294acff72e0ccae249b6324cba3ad17a819715d3
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-14 09:25:30 +02:00
Edwin Kempin
66fd9ffca2 Merge "Improve info message on 'My Menu' user preference" 2014-04-13 15:03:17 +00:00
Edwin Kempin
035afeef92 Merge "Document WebLinkInfo in REST API documentation" 2014-04-13 15:02:34 +00:00
Edwin Kempin
4c7d47558f Improve info message on 'My Menu' user preference
Mention that the first 'My' menu entry defines the default screen.

Change-Id: I52072f7dcba0cb917980c3fc8a65f0cb30a53b67
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-13 10:22:13 +02:00
Edwin Kempin
bd885ffa8c Document WebLinkInfo in REST API documentation
Change-Id: I05229ef534071255a7b6c7678020e8b6832a0059
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-13 10:19:27 +02:00
Edwin Kempin
2bf5e275d9 Merge "Correct 'web_links' field name in REST API documentation" 2014-04-13 08:17:43 +00:00
Edwin Kempin
1b5c4f3cfc Merge "Remove 'link' prefix from WebLink field names" 2014-04-13 08:16:56 +00:00
Shawn Pearce
2c97d7d5f6 Expose WorkQueue constructor to pass in thread count
This allows me to bind the WorkQueue more explicitly in a vhost setup
like used on gerrit-review or the proposed gerrit-vhost library.

Change-Id: I7eeb38bae4368a03880d797aad131f7fb02a23bb
2014-04-11 12:28:34 -07:00
Edwin Kempin
050bebfd80 Return '#/dashboard/self' as URL for the 'My' -> 'Changes' menu entry
The default 'My' -> 'Changes' menu entry points to '#/'. This only
works if it is the first 'My' menu entry because '#/' is  resolved to
the first menu entry.

Change-Id: I4fa8164377485295705237c1567403a7412ce6bb
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-11 20:11:28 +02:00
Edwin Kempin
4eac964f2d Correct 'web_links' field name in REST API documentation
Change-Id: Id3f861fc074c1dc536294183d5dd9cecf85a94c6
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-11 16:07:27 +02:00
Edwin Kempin
b57d48363c Remove 'link' prefix from WebLink field names
This prefix is unnecessary. Since the entity is called WebLink it's
clear that 'name' is the 'linkName' and 'url' is the 'linkUrl'.

Change-Id: Iae88dd9bb84addfdab3fda18c5bb14d63332b145
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-04-11 15:58:03 +02:00
David Pursehouse
67128e7017 Merge branch 'stable-2.9'
Empty merge because changes are already on master due to
mistake in merging stable-2.8 changes to stable-2.9 with
commit 63992d28234dbdccc4a13dbf01d8f39614d35f02

That commit was made on stable-2.9 but accidentally pushed
to master and merged.

Change-Id: I0a253cfed4819d63ec1d8efbf612ebcc17b62340
2014-04-11 22:17:54 +09:00