4248 Commits

Author SHA1 Message Date
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
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
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
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
Edwin Kempin
6396d6ddc6 Add basic consistency checker for accounts
So far it only checks that preferred emails are backed by
corresponding external IDs. E.g. change I2b3c5c9d assumes that each
preferred email exists as external ID.

Change-Id: I824caa34545b1ba147fb71ede503104ba1d5481c
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-09 16:10:36 +02:00
Alice Kober-Sotzek
2f62486149 Mark hunks which are present due to a rebase when diffing patch sets
The diff between two patch sets contains hunks which weren't
introduced by either patch set if a rebase occurred between those
patch sets. Previous optimizations for this case simply omitted all
files which aren't touched by either of the patch sets.

This change goes one step further: All hunks which can clearly be
identified as being introduced by a rebase are marked. In case of
doubt (e.g. they overlap with a regular hunk), they aren't marked.

To be consistent with the previous behavior, we exclude all files from
the result which only contain hunks due to rebase. In some cases (e.g.
a patch set touches 'fileA' but all identified hunks were introduced
by the rebase), this rule can be stricter than the previously mentioned
(as the previous rule would still show file 'fileA' but we exclude it
now).

Hunks which are introduced by a rebase are identified by computing
the diff between the parents of the two patch sets and transforming
the result to differences in terms of treeA of patch set A and treeB
of patch set B. This follows a suggestion which was posted as a comment
(https://gerrit-review.googlesource.com/c/33091/5//COMMIT_MSG#7) in
change I63d3a21ad4f.

As we always determine which hunks are introduced by a rebase when
two commits are explicitly specified which don't share a common
parent, we will determine those hunks even when we compute the
diff between the parents of the patch sets provided that those
parents fulfill the condition of being separated by a rebase. Those
situations should be rare and hence we refrain from adding
optimizations for this case for the moment.

Bug: Issue 217
Change-Id: If06381d506d360f0e3d24d078dcb54692698e766
2017-06-09 13:38:43 +02:00
David Pursehouse
c93e48099b Merge "Make it configurable whether the first user should become admin" 2017-06-09 10:24:58 +00:00
Edwin Kempin
53d52ba6d6 Make it configurable whether the first user should become admin
By default the first user that logs in to Gerrit automatically becomes
administrator. This is useful to bootstrap the authentication database.
However in automated server setups it should be controlled explicitly
who becomes admin and then it makes sense to disable this functionality.
The default behaviour (make the first user admin) is not changed.

Change-Id: Ic9778824e96ce4f61d974412aaaa6b40e6b465ba
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-06-09 11:26:11 +02:00
Patrick Hiesel
b1bf7594df Document library upgrade process
Change-Id: I8c3baff128beb4c47c8bd95c075917648bcc6ac1
2017-06-07 11:07:27 +02:00
Dave Borowitz
d0c01fd381 Document that *WebLink impls may return null
Change-Id: Ia88e6072a7a22ff3beb982eb212fdcf6f29022dc
2017-06-06 10:47:08 -04:00
David Pursehouse
4d28854369 Merge branch 'stable-2.14'
* stable-2.14:
  Document how to set default UI
  Note on branch-specific labels with custom rules.pl
  GWT UI: Allow to set blocking label range rules
  Extend LFS plugin servlet so that Git LFS 2.0 Lock API is handled
  PolyGerrit: Fix undefined url in gr-dropdown

Change-Id: I01320e404daf1abd052c39321346e2eacff3dd09
2017-06-01 16:54:59 +09:00
Luca Milanesio
9e6bc940f1 Document how to set default UI
Introduce the documentation on how to define the
Gerrit's default UI for users that have no cookies set
or have not clicked the New UI (or OLD UI) on the
bottom link of the page.

Change-Id: If769b85d3ef6947bcb9a7373da8b970d472f700c
2017-06-01 07:25:29 +00:00
Luca Milanesio
4ab75823ce Note on branch-specific labels with custom rules.pl
Clarify in the documentation that when a project has a custom
rules.pl defined or inherited the branch-specific filtering of
a label has no effect.

Change-Id: I3b5a8e2a17b3f3c615bda1290ce3bfa5b58850bc
2017-06-01 16:24:24 +09:00
Luca Milanesio
c728390b58 Note on branch-specific labels with custom rules.pl
Clarify in the documentation that when a project has a custom
rules.pl defined or inherited the branch-specific filtering of
a label has no effect.

Change-Id: I3b5a8e2a17b3f3c615bda1290ce3bfa5b58850bc
2017-06-01 04:52:26 +00:00
David Pursehouse
a6d8c51550 Merge "Fix example result for check consistency endpoint" 2017-05-30 10:44:47 +00:00
Edwin Kempin
dadd303b94 Fix example result for check consistency endpoint
Change-Id: Ibd9f950f7122bbf7d3bdf77cfdcff791c3f1bf7b
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-05-30 09:48:32 +02:00
Patrick Hiesel
4d2dd189b5 Add project~changeNumber as changeId pattern
This change adds support for a new change identifier in the /changes
REST API endpoint. It follows the discussion on
Idac92e61ee1471b074034eef39901b1b8e961706 and the two recent Gerrit
Hackathons.

The new change identifier serves multiple purposes:

1) Since it contains the project name, we can directly construct the
   ChangeApi without a secondary index lookup. This means that we can
   still serve requests to some endpoints, even in case of a complete
   index failure.
   When the project is added in the UI, we will still be able to serve
   change pages in case of an index failure. While the triplet also
   contains the project, it is unfeasible for the UI since it requires a
   branch name (which we don't want to have in the UI URLs) and has the
   changeId instead of the change number.
2) Reducing the number of secondary index lookups is a performance gain.
3) The project name being contained in the URL enables load balancers
   to shard requests based on the project without a need for an index
   lookup (which most load balancers do not support). The sharding
   configuration can then be as easy as a regular expression and a
   static project-to-machine mapping.
4) This change is also a first step in deprecating the other three
   change identifiers and unifying our API access pattern. This will
   happen gradually in upcoming changes. Also the UI will be adapted.

This change also adds extensive testing to both the new parsing logic as
well as all change identifiers in both the Java and the REST API.

Change-Id: I7a904fdd001c065af9897d9c08edce1cfbd43a14
2017-05-30 09:42:34 +02:00
Changcheng Xiao
e04e846873 Support to set cherry-pick notification options
This change adds support to set notification options for the existing
cherry-pick change/commit REST endpoints.

Change-Id: I3b419a4d68ea186092163cddd354b5bf4de0daeb
2017-05-24 17:57:16 +02:00
Brian Bamsch
2f6d714d37 Fix typo in access control documentation
Change-Id: If79c1fccf755e428eddc9b9e46bfa59cf07d3f83
2017-05-23 14:42:21 -07:00
David Pursehouse
22c94af390 Merge "Minor change to introductory paragraph." 2017-05-19 14:36:20 +00:00
David Shevitz
a3fd346779 Minor change to introductory paragraph.
Change-Id: I172ded2b4a10f15236501f1cdc91b06f18f6e8cf
2017-05-18 15:04:18 -07:00
Dave Borowitz
2b87d7f862 RetryHelper: Make time limits configurable
Use an arbitrarily high limit during NoteDbOnlyIT, where we explicitly
want retries to happen, in order to avoid spurious timeouts caused by
scheduling delays on overloaded test machines. For other tests,
LockFailureExceptions generally shouldn't crop up during updates anyway,
and if they do, we would rather the updates time out in finite amount of
time so we can see the resulting stack trace.

Change-Id: I5bad32749b994e6473176cdd45cc80d9d4e195eb
2017-05-17 19:29:08 -04:00
Aaron Gable
440ff1f43f Link to developer mailing list from contributing docs
Change-Id: Ib2cc02812adb3a9098a88294eb9d0775b6756427
2017-05-12 15:16:25 -07:00
Dave Borowitz
d6ee48ebc3 Control auto-publishing comments on push with preference
Change-Id: Ibf6c61d8c34ee790ca7ed29a0fad0b5e81910f09
2017-05-12 11:06:21 -04:00
Dave Borowitz
cb861921a7 Add ReceiveCommits option to publish comments
To keep the options interface simple, the only possibility is
PUBLISH_ALL_REVISIONS.

Change-Id: Ia95974ef485c8c57ceae5b8bd4d9784bfee14e1f
2017-05-12 11:06:21 -04:00
Dave Borowitz
0328589365 Merge "Support to delete a comment with 'NoteDbRewriter' in BatchUpdate" 2017-05-11 13:19:59 +00:00
David Pursehouse
fc22415409 Merge branch 'stable-2.14'
* stable-2.14:
  Allow setting Jetty HTTPD socket timeout

Change-Id: Ib8b38749997640dc21cef4f91a7d129dd579a1e9
2017-05-11 11:37:01 +09:00
David Pursehouse
c22f0fbbf3 Merge branch 'stable-2.13' into stable-2.14
* stable-2.13:
  Allow setting Jetty HTTPD socket timeout

Change-Id: Ic37eb4993a88980cf18f0c9de5732b9060a4b75b
2017-05-11 10:49:09 +09:00
Luca Milanesio
dca95d5bde Allow setting Jetty HTTPD socket timeout
Make the Jetty HTTPD socket timeout (by default 30s) configurable
so to tailor the socket and thread consumption to the needs of setups
with different latencies and bandwidth.

Change-Id: Idaf2a69e44b221f9d422afe56060a4300229c47c
2017-05-11 09:57:57 +09:00
David Pursehouse
540c84296d PostPrivate: Allow administrators to set other users' changes private
In the current implementation, a change may only be set to private by
its owner. In cases where a user has uploaded a change that should be
private (i.e. they have accidentally included sensitive information),
but the user is not available or not responding to requests to set it
private, the site administrator should be able to set it.

In future we may also want to allow project owners to set other users'
changes to private. This is not done in this commit as it is not yet
clear if the project owner related permission checks are going to be
migrated to the new permission backend.

Change-Id: I48da68e823c4e3fc5f58f21acb4e26d193606978
2017-05-10 18:00:14 +09:00
ekempin
7cd6a74556 Merge "Allow to specify a message when the private flag on a change is set/unset" 2017-05-10 06:46:38 +00:00
Changcheng Xiao
e5b14cebd5 Support to delete a comment with 'NoteDbRewriter' in BatchUpdate
This change adds a new interface 'NoteDbRewriter', which can be used to
rewrite the NoteDb commit history in BatchUpdate.

By implementing the new interface, this change allows users with
administrate server capability to delete a comment by replacing the
comment's message.

To delete a whole comment, the rewritter is required to update the
commit message, which contains the number of the comments put in by the
original commit. This can be done in later changes when necessary.

Bug: Issue 4445
Change-Id: Icaeb3c24f5dc88f6b44b1297366a692a32676910
2017-05-09 21:56:26 +02:00
David Pursehouse
c9a593cc72 Merge branch 'stable-2.14'
* stable-2.14:
  Add %draft push option to documentation

Change-Id: Ic29c6ae65414bf6d5cfd02414abb21e4aeb5de47
2017-05-10 00:00:39 +09:00
Sven Selberg
fb2f355de3 Add %draft push option to documentation
Change-Id: I7834154bba2f353d7eefb1931b31809b284232b6
2017-05-09 14:01:20 +00:00
Edwin Kempin
364a86bafa Allow to specify a message when the private flag on a change is set/unset
This allows users to explain why the private flag on a change was
set/unset.

Since the requests to set/unset the private flags can have a request
body now, POST is more appropriate than PUT. Changing this is okay,
since the support for private flags was not released yet.

Since some proxies prohibit request bodies for DELETE requests offer
deletion of the private flag also as POST request on
/changes/<id>/private.delete.

The setPrivate method in ChangeApi is changed, which is okay since it
wasn't included into any release yet.

The UI doesn't offer to specify a message yet when the private flag is
set/unset but this may be implemented in a follow-up change.

Change-Id: Ib201114ffa397a313bca565d7fb52767b4c9197c
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-05-09 11:14:12 +02:00
David Pursehouse
2935175117 Merge branch 'stable-2.14'
* stable-2.14:
  Create group-indexed extension point
  Always use SSL implicitly for POP3 and IMAP
  InitSshd: Check if the ssh_host file exists with the other keys

Change-Id: I1ad22d5566314865c0c03bcf31f7802b653e82fa
2017-05-09 11:14:41 +09:00
Hugo Arès
ee788ddba6 Create group-indexed extension point
Change-Id: I79fb7404e10e619d87b4983346c90ca79c83ddff
2017-05-09 01:47:19 +00:00
David Pursehouse
af96e69b1f Document ignored and muted changes in intro-user
Bug: Issue 6120
Change-Id: I8f191402522ec3a97e98a0893bd676dbf43a0a34
2017-05-08 13:24:09 +09:00
David Pursehouse
1fc7804c26 Merge branch 'stable-2.14'
* stable-2.14:
  Use 'Merge list' as display name for /MERGE_LIST
  DatabasePubKeyAuth: Also look for ecdsa keys and ed25519 keys
  SshDaemon: Also look for ecdsa keys and ed25519 keys
  InitSshd: Generate ecdsa and ed25519 keys if the host supports them
  Speed up reviewer suggestion
  Relocate setting page base to app initialization
  Allow multiple Servlet filters on Jetty HTTPD

Change-Id: I22fa3777ea8150a89e4c66d5d32535caee1b5a76
2017-05-08 11:16:59 +09:00
Patrick Hiesel
38667d4f51 Add parent parameter to GetContent
PolyGerrit has a hard time showing the diff view for binary files like
images. To get the base, it has to request it separately using the
parent commit SHA1, which is expensive.

This commit adds a 'parent' parameter to GetContent in the same way that
it is done for DownloadContent. This way, PolyGerrit can use the same
endpoint and avoid expensive permission checks since users who can see a
change are also allowed to see the base commit.

Change-Id: Id6b4d0ea994282d9b4942f9ec1a8f4071a1064b1
2017-05-05 15:43:44 +02:00
Luca Milanesio
dcb4bd544c Allow multiple Servlet filters on Jetty HTTPD
Enable the ability to specify httpd.filterClass more than
once to have mutiple Servlet filters installed at startup.

Change-Id: I460bb5e56640f55ff7b380072dce6d44353ed3e7
2017-05-03 22:20:51 +01:00
Edwin Kempin
14d50ed949 Allow to create private/wip changes via CreateChange REST endpoint
Change-Id: I01029fcde99b57681cda8056efd00182e2227621
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-05-03 13:33:12 +02:00
David Pursehouse
a7c4fe82e4 Merge branch 'stable-2.14'
* stable-2.14:
  ChangeScreen: Expect that current revision can be null
  Update docs for accountPatchReviewDb

Change-Id: I908b92c6d41e01fe5287c42a389888bc6a3de108
2017-04-30 20:03:34 +04:00
David Pursehouse
a96afbeae0 Merge branch 'stable-2.13' into stable-2.14
* stable-2.13:
  ChangeScreen: Expect that current revision can be null
  Update docs for accountPatchReviewDb

Change-Id: I2ec42e90430b895ee205fe99a1fbd4e2ec21af8e
2017-04-30 14:00:06 +04:00
Paladox none
1a4c01f154 Update docs for accountPatchReviewDb
This updates the doc for accountPatchReviewDb to mention you have to
use a different db name instead of gerrit's db

Change-Id: I2742bfd6d53c80644e6fdee41c07a28c30d087c9
2017-04-29 22:27:56 +00:00
David Pursehouse
a837a05bd7 Merge "Remove Result inner class from AccessCheckInfo" 2017-04-28 21:20:33 +00:00
Han-Wen Nienhuys
bc0cdbc88d Remove Result inner class from AccessCheckInfo
Before:

   {
     "result": {
       "message": "user Kristen Burns \u003cKristen.Burns@gerritcodereview.com\u03e (1000098) cannot see ref refs/heads/secret/master in project medium",
       "status": 403
     }
   }

After:

   {
    "message": "user Kristen Burns \u003cKristen.Burns@gerritcodereview.com\u003e (1000098) cannot see ref refs/heads/secret/master in project medium",
    "status": 403
   }

Change-Id: Idd846c3bd1d14b40bd601b34f0682e017cc50f0c
2017-04-28 17:56:06 +02:00
David Pursehouse
6dc8b5af4e Merge changes from topic 'wip-workflow'
* changes:
  Block submission if work in progress
  Add tag for patchsets uploaded with %wip
  Ignore notifications for work in progress workflow
  Document new endpoints for work in progress workflow
  Add API for work in progress workflow
  Add REST endpoints for work in progress workflow
  Support work in progress and ready options in git push
  Add field for wip changes to index and QueryBuilder
  Add work in progress property to change
2017-04-28 14:18:45 +00:00