* 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
* 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
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
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
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
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
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
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
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>
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
The virtual hosting cache behind gerrit-review needs to have direct
read access to the members of persisted cache keys.
Change-Id: I6ad9f09cbdb575dd3d4f267ed5ff361bcc9e415d
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
* 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'
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
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
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
* stable-2.9:
Ensure NrtFutures are notified promptly of new search generation
Fix deadlocks in SubIndex shutdown
Change-Id: I0dd60f02c6ee37938eb8d36f61c02a7ffe34ca88
* stable-2.8:
Ensure NrtFutures are notified promptly of new search generation
Fix deadlocks in SubIndex shutdown
Change-Id: I723fb1cab17e57eb8714f9fa6c2f62b0c2d62a72
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
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
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
Mention that the first 'My' menu entry defines the default screen.
Change-Id: I52072f7dcba0cb917980c3fc8a65f0cb30a53b67
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
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
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>
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>
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