25424 Commits

Author SHA1 Message Date
Edwin Kempin
0cca74b78a Merge "Format Java files with google-java-format" 2017-06-14 07:27:25 +00:00
Han-Wen Nienhuys
b0fb0a7a96 Remove 'final' from method signatures across gerrit.
Change-Id: I986a5507aa26ceb28305a7b08991e85238bde0e3
2017-06-14 09:18:42 +02:00
David Pursehouse
5770973c3b Format Java files with google-java-format
Change-Id: I8ca4179befdb4ef83d5c660873bdcb862306d0a8
2017-06-14 16:02:57 +09:00
David Pursehouse
64e43c24ef Merge changes from topic 'permission-backend'
* changes:
  Replace canUpload with CREATE_CHANGE
  Convert GetAccess and canAddRefs to PermissionBackend
  Convert forge author, committer, server to PermissionBackend
  Push option bypass-review disables validation
2017-06-14 06:55:26 +00:00
Edwin Kempin
22d4074dec Merge changes I3d83aa5d,Ifa9d80d2,I65222959,I7f576ea0,I2edaf059
* changes:
  Remove superfluous final in gerrit/server/patch/
  Remove superfluous final from server/query/change
  Remove superfluous final from server/query/
  Remove superfluous final from gerrit/httpd/
  Remove unneeded final modifiers from gerrit-server/src/main/java/com/google/gerrit/server/git/*.
2017-06-14 06:42:54 +00:00
Shawn Pearce
ca1113e5bd Replace canUpload with CREATE_CHANGE
Check RefPermission.CREATE_CHANGE before creating a change, instead of
relying on the legacy RefControl.canUpload(). This delegates creation
decisions through the PermissionBackend.

Change-Id: Ic76e96ca6079a179ae65fa2de436fb6df929b6d9
2017-06-14 13:59:39 +09:00
Shawn Pearce
10aae18ff1 Convert GetAccess and canAddRefs to PermissionBackend
Introduce a new ProjectPermission CREATE_REF which supports hinting if
the user may be permitted to create references within the project.

This is similar to RefPermission CREATE_CHANGE where the parent scope
may be needed to test support for creation of a child.

Unlike CREATE_CHANGE, application code does still check RefPermission
CREATE during operations on the actual proposed reference name.

Change-Id: I02204500265cb97c4fb92f40f01b6c738c06b5b1
2017-06-14 13:53:34 +09:00
Shawn Pearce
e2923f43ab Convert forge author, committer, server to PermissionBackend
Change-Id: I081392237957d3dc4afc703ca2256e27954d3774
2017-06-14 13:53:34 +09:00
Shawn Pearce
1e964ead8b Push option bypass-review disables validation
Add RefPermission BYPASS_REVIEW which can be selectively requested
with a push option, for example:

  git push -o bypass-review origin master

When set this option skips validating the new commits if the user has
BYPASS_REVIEW permission in the PermissionBackend. For the default
backend this is a set of permissions that must all be present in order
to use this option.

Gerrit still ignores the bypass-review option on refs/meta/config (as
it must validate the configuration parses), and on the refs/for/ magic
branch, where it needs to update code reviews.

Change-Id: I80ad4785226de7113f0bf6812c7709ba2c6ec73c
2017-06-14 13:53:34 +09:00
Han-Wen Nienhuys
f39fa5406c Update git submodules
* Update plugins/replication from branch 'master'
  - Remove 'final' from function signatures
    
    Change-Id: I98f1ef7d4622bd0394437355e5f6d896d035d0a8
2017-06-14 01:23:25 +00:00
Han-Wen Nienhuys
745cfe1af3 Update git submodules
* Update plugins/singleusergroup from branch 'master'
  - Remove 'final' from method signatures.
    
    Change-Id: I126d651edd6bf83cb9d5e96409d021970530486a
2017-06-14 01:23:25 +00:00
Han-Wen Nienhuys
0748967210 Update git submodules
* Update plugins/reviewnotes from branch 'master'
  - Remove final from function signatures 
    
    Change-Id: I47a1ae6b89643b3e9bc715fa5707ab597ba26503
2017-06-14 01:23:25 +00:00
David Pursehouse
419ed573b9 BranchApi: Add method to get the branch's reflog
GetReflog uses Repository#getReflogReader, but this is not implemented
by DfsRepository which is used in the test framework. As a result, calls
to this API method from tests results in UnsupportedOperationException.

Modify GetReflog to catch the UOE and rethrow as MethodNotAllowed, so
we get a graceful failure rather than "internal server error".

In the tests, expect MethodNotAllowed, with a TODO to rework when/if
the implementation of getReflogReader is done in DfsRepository.

Change-Id: I0d0d718ca4e4ecf2c544ea6e912397c20e2fd7e3
2017-06-14 12:56:20 +09:00
David Pursehouse
f0d37e4f80 GetReflog: Move ReflogEntryInfo to a separate class in extension API
Change-Id: Ib9ab9b16cacaed88c5e1d901af37be086b635d0b
2017-06-14 12:53:42 +09:00
Wyatt Allen
ba258bcd74 Merge "Move table content styling into separate element from list view" 2017-06-13 23:18:25 +00:00
Becky Siegel
0dedeaddf5 Move table content styling into separate element from list view
Some admin tables (for example plugins) don't have APIs that support
filtering and pagination. It is still advantageous to share styles,
so pull that out into a separate element.

Change-Id: Iad2b40d9af3cc53351973c7c456f1110424a14df
2017-06-13 23:13:33 +00:00
Wyatt Allen
146cbf59ad Merge "Add ability to not pass in the server config to the gr-change-view" 2017-06-13 22:53:34 +00:00
Thomas Shafer
08407e32a2 Add ability to not pass in the server config to the gr-change-view
This allows gr-change-view to be included with minimal config.

Change-Id: I5f538208dd0d7ca3fb0b23a699143c36964795c1
2017-06-13 14:10:33 -07:00
Kasper Nilsson
aa4e317675 Merge "Implement list-view-behavior" 2017-06-13 19:13:49 +00:00
Becky Siegel
e00d1eeede Implement list-view-behavior
Even though a gr-list-view element has been established for many of the
common list view functions, The tables themselves are still
generated by the parent element and passed as <content>.  There were
many common functions used in the table generation itself.

Break out those common functions into a behavior, and implement in
gr-admin-group-list and gr-admin-project list. This will be used in
further admin pages as well.

Change-Id: I60227b8c30ac18176bbf923ee1fb02bdd985e5c3
2017-06-13 11:10:18 -07:00
Han-Wen Nienhuys
45351acfd6 Remove superfluous final in gerrit/server/patch/
Change-Id: I3d83aa5d8a32a35157afacf8387e5b082719817f
2017-06-13 17:59:40 +02:00
Han-Wen Nienhuys
cc15dd2970 Remove superfluous final from server/query/change
Change-Id: Ifa9d80d26083dfe34eded8a960f9da92eab2aba9
2017-06-13 17:59:40 +02:00
Han-Wen Nienhuys
307eb1ed96 Remove superfluous final from server/query/
Change-Id: I65222959ecf27a3b1441d1badd8a68a1b735ebe1
2017-06-13 17:59:40 +02:00
Han-Wen Nienhuys
4d7645378e Remove superfluous final from gerrit/httpd/
Change-Id: I7f576ea09824944d33d6f422324d2337cc9bf4e5
2017-06-13 17:59:40 +02:00
Han-Wen Nienhuys
1a2f731637 Remove unneeded final modifiers from gerrit-server/src/main/java/com/google/gerrit/server/git/*.
Change-Id: I2edaf0599918c48f021abacaed198af67611773a
2017-06-13 17:59:40 +02:00
Han-Wen Nienhuys
61f6565591 Add a success and attempt metric for cross-project topic submissions.
Change-Id: Ice704290224064bca9f3389bec7419c21054baa0
2017-06-13 15:50:13 +02:00
Edwin Kempin
18962aa2b5 Merge "Make AccountCache available to Prolog predicates" 2017-06-13 13:27:59 +00:00
Edwin Kempin
f33e810d90 Merge "Accounts: Add method to get several accounts at once" 2017-06-13 12:40:46 +00:00
Edwin Kempin
c056334599 Make AccountCache available to Prolog predicates
Some plugins implement Prolog predicates that need to get accounts.
E.g. the find-owners plugin has a Prolog predicate that loads the
accounts for all approvals on a change.

SubmitRuleEvaluator sets ReviewDb as a stored value in the Prolog
environment and hence Prolog predicates in plugins have access to it.
When accounts are moved to NoteDb accounts are no longer accessible
through ReviewDb. Hence the Prolog predicates need a different way to
get accounts. For this we make the AccountCache available by setting it
as a stored value in the Prolog environment.

Using the account cache instead of accessing the database should also
improve performance of Prolog predicates that need to access accounts.

Change-Id: I363a8ee0400622b4cc25d44f1d6fc876c951d412
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-13 14:35:18 +02:00
Edwin Kempin
8c36cc8805 Merge "Accounts: Add method to get all accounts" 2017-06-13 11:52:40 +00:00
Edwin Kempin
5bd2a6d12a Accounts: Add method to get several accounts at once
Change-Id: I688c854dfdf5261f0b80d2c5a9dee7f0c6a37852
2017-06-13 13:48:52 +02:00
Alice Kober-Sotzek
03c48fc727 Merge "Add support for specifying the cherry-pick base commit" 2017-06-13 11:48:33 +00:00
Changcheng Xiao
e333258b94 Add support for specifying the cherry-pick base commit
This change extends the existing cherry-pick endpoints to allow
users to specify the base commit of the cherry-pick destination.

If the base commit represents a visible change revision on the
destination branch, the change status must be either 'New' or
'Merged'.

Alternatively, the base commit can be a merged commit on the
destination branch with no change associated with it.

Change-Id: I6721a2d88f4b73058dc1abf3e85c4184e46088c5
2017-06-13 12:57:15 +02:00
Edwin Kempin
75bd447d4c Accounts: Add method to get all accounts
Having this method allows us to implement loading all accounts from
NoteDb later.

Change-Id: Ifc1d1113f0687ae599a7cbad56cd50ae1c9a3608
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-13 11:47:32 +02:00
Wyatt Allen
6b9ffd5190 Merge "gr-change-view: A "patch set" is not a "patch"" 2017-06-13 00:13:55 +00:00
David Pursehouse
aad1bce8bc Merge "Reorder failing dependency test output" 2017-06-12 23:46:37 +00:00
Gerrit Code Review
af0002c1cc Update git submodules
* Update plugins/hooks from branch 'master'
  - Stop referring to WorkQueue.Executor.
    
    Change-Id: I65db402e8fdc32dff829385e542b4cfab9f441d9
    * Update plugins/replication from branch 'master'
  - Stop referring to WorkQueue.Executor
    
    Change-Id: Ic4b4003a78205f4e34d656f5462a529e536f0b5a
2017-06-12 23:25:57 +00:00
Thomas Shafer
f37887e21d Reorder failing dependency test output
NPM is required for wct, so put it first. Add links for install
instructions.

Change-Id: I7a75980f986124ebf25cf692eb742f13a5f795ef
2017-06-12 16:25:13 -07:00
Wyatt Allen
c1373ecd66 Adjust email diff colors
Bug: Issue 6471
Change-Id: I8b2a60837350b741f0a77fe04acc90f42893c563
2017-06-12 15:02:03 -07:00
Dave Borowitz
5aab74ded6 gr-change-view: A "patch set" is not a "patch"
Change-Id: I3502763af37d18059f1a141f9e647879b11e13f1
2017-06-12 17:34:48 -04:00
Dave Borowitz
bd947d4ae5 Merge "Remove Executor#unregisterWorkQueue"
* submodules:
* Update plugins/replication from branch 'master'
  - Merge "Stop using WorkQueue#unregisterWorkQueue."
  - PushOne: Remove redundant string concatenation
    
    Change-Id: Idfe060d260eb0343d0766f4c6d6cea6cfbf733bb
2017-06-12 17:05:45 +00:00
Kasper Nilsson
3fce43cd9d Merge "Add topic to branch column in dashboard" 2017-06-12 17:18:26 +00:00
Han-Wen Nienhuys
bb798b00bb Remove Executor#unregisterWorkQueue
We use ScheduledThreadPoolExecutor#terminated to manage cleanup of
WorkQueue. Callers of unregisterWorkQueue should just delete the call.

Change-Id: I0208c8643bd71eb287ff553f80e7ffe547f3ffbe
2017-06-12 15:51:04 +02:00
Alice Kober-Sotzek
d1a2e07e4f Merge changes from topic 'improve-diff-for-rebase'
* changes:
  Highlight hunks which are due to rebase on PolyGerrit
  Copy due_to_rebase to subgroups in gr-diff-processor
  Move diff tests from RevisionIT to RevisionDiffIT
  Mark hunks which are present due to a rebase when diffing patch sets
2017-06-12 13:20:22 +00:00
David Pursehouse
f05ee3fc73 Merge branch 'stable-2.14'
* stable-2.14:
  Fix documentation of the review command
  Fix online reindexing for plugins-dependent rules
  De-couple PluginModule and PluginRestApiModule registration

Change-Id: Ic6dd1c019e7a451f325d378b071f2347f82c2e44
2017-06-12 20:03:04 +09:00
David Pursehouse
94ca426130 Merge "Fix documentation of the review command" into stable-2.14 2017-06-12 11:02:30 +00:00
Saša Živkov
031e4bacea Fix documentation of the review command
The documentation was wrong and not in sync with the output of:

  $ ssh ... gerrit review --help

The --json is a boolean, it doesn't accept file name as its value.

Change-Id: Ie0cc1f498dbe31c215f260c80c8e53215f3b1627
2017-06-12 12:47:12 +02:00
Luca Milanesio
86a1dd735c Fix online reindexing for plugins-dependent rules
Online reindex recalculates the status of all the changes
by invoking the Prolog rules associated.
That is good in general but breaks systematically when the
rules depend on plugins for their accurate evaluation.

Noteworthy example is the use of singleusergroup plugin in
conjunction with user-specific ACLs for labels.
Another even more severe example is the use of custom
Prolog predicates in rules.pl provided by the owners' plugin.

By swapping the order of registration of the Plugins module
and the Lucene Index module, the lifecycle listener will then
load first the plugins and only afterward activate the online
reindexer.

Bug: Issue 6472
Change-Id: I87da6ac632d08aa915a57a01435cfa415b7de2f9
2017-06-12 11:46:20 +01:00
David Pursehouse
0099e9ff09 Merge branch 'stable-2.14'
* stable-2.14:
  Fix columns in project tables

Change-Id: If85a070198a96ebe347076b4491ec69932f09307
2017-06-12 19:35:37 +09:00
Luca Milanesio
c0ac1ba9c7 De-couple PluginModule and PluginRestApiModule registration
The registration of PluginModule and PluginRestApiModule needs to be
decoupled because they are conceptually separate, even if one (PluginModule)
needs to happen before the other (PluginRestApiModule).

This is a pre-requisite for the next change I87da6ac6 where the PluginModule
registration needs to be moved around without necessarily having an impact
on the PluginRestApiModule.

Change-Id: I80fee34e5bda5afb480c8d103e6e83b8ae11c8eb
2017-06-12 10:25:03 +01:00