* 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
* 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/*.
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
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
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
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
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
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
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>
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
Having this method allows us to implement loading all accounts from
NoteDb later.
Change-Id: Ifc1d1113f0687ae599a7cbad56cd50ae1c9a3608
Signed-off-by: Edwin Kempin <ekempin@google.com>
We use ScheduledThreadPoolExecutor#terminated to manage cleanup of
WorkQueue. Callers of unregisterWorkQueue should just delete the call.
Change-Id: I0208c8643bd71eb287ff553f80e7ffe547f3ffbe
* 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
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
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
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