24238 Commits

Author SHA1 Message Date
David Pursehouse
787b1036b3 Update git submodules
* Update plugins/hooks from branch 'stable-2.14'
  to 1955d81e0ce4909a491a8340a2365fe9971eed81
  - Add README
    
    Add a README.md file in the repository root with the same content as
    the "About" page.
    
    Gitiles will render the README by default when the project is viewed
    on the googlesource site [1] and this will make the configuration
    documentation and list of supported hooks more easily accessible for
    users who have not installed the plugin yet in their Gerrit site.
    
    [1] https://gerrit.googlesource.com/plugins/hooks
    
    Change-Id: Ib2ecf818cbabaca8bfddf58e12cce99842a4f038
    
  - Reword introduction in configuration documentation
    
    Change-Id: I428167c7929a077386e281f4898e8f4693c315f2
    
  - Fix formatting in configuration documentation
    
    Change-Id: I7414451eea210df7cc3e4d865de5cc1286c7a4ef
    
  - Improve the "about" page
    
    Add a link to the git hooks documentation which gives more context
    about what is "not supported". Add links to the configuration and
    list of supported hooks.
    
    Change-Id: Ica629c70334951124bce439a4672fa28b40a2d61
2018-02-02 01:15:39 +00:00
David Pursehouse
fb6eba1211 config-sso: Reword section about Google OpenID shutdown
Google already shut down their OpenID service nearly 2 years ago.

Rewrite the documentation related to this in past tense.

Change-Id: I6691f42a198b014afb32ee718c3e88e300655c54
2018-02-02 10:21:17 +09:00
David Pursehouse
7845019dbf Replace links to code.google.com/p/gerrit
Google Code was shut down nearly 2 years ago [1] and the links
don't work any more. Replace them with the new locations.

[1] https://opensource.googleblog.com/2015/03/farewell-to-google-code.html

Change-Id: I53e791d04eb243483d69254a296c30e59a7de479
2018-02-02 10:13:45 +09:00
David Pursehouse
66795408db intro-quick: replace http:// with ssh:// in fetch example
All the other example commands use ssh, so using ssh in this command
makes it consistent. Also, the http command was using the `/p/` URL
infix which is no longer needed.

Change-Id: Ie9ffb50fc5f565f1d7f293dcae106fb285d6553d
2018-02-02 08:21:06 +09:00
David Pursehouse
c1dfaa86ea Update git submodules
* Update plugins/replication from branch 'stable-2.14'
  to 43d055591174640527f5dec3fc7df00a4aa55f02
  - Document how to exclude projects from replication
    
    Change-Id: I8a12011e28be44d600a3ed63eebe596560d73e5f
2018-02-01 00:01:38 +00:00
Paladox
22ae8161a0 Merge branch 'stable-2.13' into stable-2.14
* stable-2.13:
  Fix build for bazel 0.9.0

Change-Id: I1b73abfc1bb4817162570520ffa46766a075b1f1
2018-01-31 20:19:34 +00:00
Hugo Arès
5fcf53d752 Remove circular dependency between diff_summary and diff caches
In order to migrate to Caffeine, the circular dependency between
diff_summary and diff caches needs to be removed. Guava is ok with this
circular dependency but Caffeine is not and goes into an infinite loop.

1.diff_summary.get(id=1234)
2.diff_summary_loader.get(id=1234)
3.diff.get(id=1234)
4.diff_loader.get(id=1234)
5.diff_summary.put(id=1234)->blocked because cache is waiting for step 2 to complete.

This circular dependency is not mandatory, values will be populated in
the diff_summary when explicitly requested.

Change-Id: I059741bd3f7229a8cf86ed13e5ce2fabfa54c6c8
2018-01-31 13:16:00 -05:00
Han-Wen Nienhuys
e486718005 Fix build for bazel 0.9.0
Change-Id: Ib2ce3e2c197824984fb332f93ff38a3570949084
2018-01-31 13:38:23 +01:00
David Ostrovsky
ed482e1fbe Merge "polygerrit: Add note in README about npm install" into stable-2.14 2018-01-30 19:38:08 +00:00
Hugo Arès
bf5cfebda8 Fix error dialog not honoring line breaks
Creating ErrorDialog from Throwable was already formatting error message
nicely because it is setting the css attribute 'whiteSpace' to 'pre'.
Creating ErrorDialog from an error message string was not setting this
css attribute resulting in line break being removed.

Fix this by making both use a private method to create error message
label. Also change the attribute from 'whiteSpace' to 'white-space'
which is the real name.

Change-Id: I5932c3d547b8ab232de2f866d0ad20d968804ee8
2018-01-30 01:09:52 +00:00
Ardo Septama
dfa74b835f Protect against null pointer for BaseCommand
Subclasses of BaseCommand may not initialize argv field (e.g.
ScpCommand).
Recent change [1] uses argv field which may result in NPE.

This change will guard the code from such error.

[1]: https://gerrit-review.googlesource.com/c/gerrit/+/146191

Change-Id: I6dd3afa08fd696d25741b5bdec8530deac422261
Signed-off-by: Ardo Septama <aseptama@gmail.com>
2018-01-29 15:16:16 +01:00
David Pursehouse
5adfe0610f Merge "Hide sensitive data from audit and gerrit logs" into stable-2.14 2018-01-29 05:58:07 +00:00
David Pursehouse
a35fa9012f polygerrit: Add note in README about npm install
When installing web-component-tester fails with the error:

  "EACCES: permission denied, mkdir"

it can be fixed by adding the `--unsafe-perm=true --allow-root` options
as described in [1].

[1] https://github.com/npm/npm/issues/17268#issuecomment-310167614

Change-Id: I397d31209c019ebbe52bf24bd9e359d71863ffd7
2018-01-29 10:20:09 +09:00
Paladox none
e0dd240c58 web-component-tester: Support headless mode
This adds support for running chrome in headless mode.

Support for running firefox in headless mode should work but currently
doesn't.

Moreover, i've added browser option handling to wct [1].

[1] b8388d1a8d

Bug: Issue 8023
Change-Id: I47cd9cd69fc78739219223c74d7b2edf2f97d6c7
(cherry picked from commit f633e0dcacd5f6307ef77b3a40d642310e7e60ee)
2018-01-28 12:35:22 +00:00
Dave Borowitz
41afd4beae Merge "ReplaceOp: Don't fire ref-updated event" into stable-2.14 2018-01-26 16:19:18 +00:00
David Pursehouse
905cb4e79f Clarify documentation of "no new changes" error message
Update the documentation to clarify that it is necessary to
replace the Change-Id when re-pushing a commit to the same
destination branch. Previously the documentation also implied
that this was necessary when pushing to a different branch.

Bug: Issue 8222
Change-Id: I4a7f87322c7117f34d2ea3a8be8eec4b38fa406a
2018-01-26 08:49:52 +09:00
Edwin Kempin
7ebead3137 Fix badly formatted licence headers
Change-Id: I8e8c579e07863822fa7b4c4fb5c660a83e3c58e9
Signed-off-by: Edwin Kempin <ekempin@google.com>
(cherry picked from commit 83eed743773db2926d73c7457c1fc31c1f9cc6e9)
2018-01-26 08:28:16 +09:00
David Pursehouse
1f900501af ReplaceOp: Don't fire ref-updated event
The ref-updated event is fired by ReceiveCommits, so firing it in
ReplaceOp results in the same event being fired twice when a new
patch set is added to an existing change.

Bug: Issue 8053
Change-Id: I9b87f9b9ac039856868b98a5d6f1682def4611a3
2018-01-25 10:51:32 +09:00
Paladox none
e8fdd58aed Add missing configuations in EditPreferencesInfo doc
Change-Id: I6d14398bbeab4ca3a6a3b52f39037b02a78d4478
(cherry picked from commit a22c508e57c3ad794170a71614a4db16b72bf655)
2018-01-23 23:58:17 +00:00
Ardo Septama
a8a7a84ae5 Hide sensitive data from audit and gerrit logs
If there is password in ssh command parameters, it will be logged by
Gerrit.
This patch introduce @SensitiveData annotation to mark parameters that
contain sensitive data and hide them from logger and audit.

Audit masking must be enabled at gerrit.config:
audit.maskSensitiveData=true

Change-Id: I1f0e8e91bf971ed58b2362f89ce9f02cd8fb2ec7
Signed-off-by: Ardo Septama <aseptama@gmail.com>
2018-01-15 17:11:15 +01:00
Edwin Kempin
0632858ec1 Merge "Set version to 2.14.7" into stable-2.14 2018-01-15 07:13:38 +00:00
Saša Živkov
bbdaf41167 Add ProjectCache.remove(Project.NameKey name) method
Until now we only had ProjectCache.remove(Project p) which requires a
project instance. This could be a problem when running Gerrit HA in
active/active mode and a project name has to be removed from the
project-list cache on the other node. The project may not exist at that
point in time (because it was just deleted) and trying to load a Project
instance would lead to an error which would prevent removing this
project's name from the project_list cache.

Change-Id: Ida124ea95bb2cb776adbf8bd4d2bb77c0bdbbeaa
2018-01-15 12:25:04 +09:00
David Pursehouse
3d75016858 Set version to 2.14.7
Change-Id: If887ca9b333c816ab7c5dfd121721b122291c526
2018-01-15 11:07:26 +09:00
David Pursehouse
5adebf57b4 Merge "Documentation: Remove references to optional BouncyCastle libraries" into stable-2.14 2018-01-12 12:14:07 +00:00
Gert van Dijk
47b0ed3ff7 Documentation: Remove references to optional BouncyCastle libraries
BouncyCastle is bundled with Gerrit since 2.14:
https://www.gerritcodereview.com/releases/2.14.md#Bouncy-Castle-Libraries

Documentation/install-j2ee.txt still needs an update to this.

Change-Id: I461d5d5f7da5bd25f99941fcc525113d5ac09bea
2018-01-12 10:03:52 +01:00
Sven Selberg
9dd0e0855a SSH commands: Set task name for ReviewCommand
Task name is otherwise set to the command line which in ReviewCommands
case can be a multi line string which leads to  pretty unreadable and
bordering on unparseable "loglines" like:

[2018-01-10 09:59:17,619] [SSH gerrit review 12345,4 --message 'Build:

http://jenkins.company.com/job/JOB_NAME/job/identifier/182/ : UNSTABLE

http://jenkins.company.com/job/JOB_NAME/job/other/13677/ : SUCCESS'\
--verified -1 --code-review 0 (jenkins)] WARN <class> : <message>

Change-Id: I74a0ff062b38a1980c4781e8e79a368bf028c549
2018-01-11 12:51:56 +01:00
Sven Selberg
939e8714f0 [SSH] Extract task name creation to method in BaseCommand
Command line is not the best task description for all commands. The
"review" command command line are f.i. more often than not multiline.
This allows sub command to override task description.

Change-Id: I2bc42010fa91e94ea079f0e759c8ab049a61f462
2018-01-11 12:51:20 +01:00
Vladimir Moskva
a10e967160 Remove the + operator on dicts from .bzl files
The + operator on dicts is deprecated and will be removed from future
version of Bazel.

Change-Id: I9f3db02f13c1c56c3afc4cc94b142513f0ae3908
(cherry picked from commit 4c8be85fcfc83582fad77684cff6044e828d4cb6)
2018-01-05 20:34:33 +00:00
Hugo Arès
66a0c4a343 Prevent concurrent login by disabling form submission
Double-clickers are logging in twice because the form is submitted twice
and the server will handle both requests concurrently. This is not a big
issue but it becomes one when a user login in for the first time is a
double-clicker. Server will handle both requests concurrently resulting
in creating 2 accounts for the same user.

This change disables the form submission after the first submit.

Change-Id: Ida55e632618c72ab11e536854c654ed423a0f195
2018-01-05 13:43:11 +00:00
Hugo Arès
b046129965 Fix merging change by direct push
When a commit is pushed, Gerrit will auto close the corresponding change
if there is one. To do so, it will query all the open changes on the
same branch, iterate through them to find a change with same change-id
as the one in the pushed commit. During the iteration, the changes are
loaded from DB. If any of the open changes is deleted between the time
the query is executed and the time the change is loaded from DB, a
NoSuchChangeException was thrown preventing the auto close operation
from completing. The net result was commit merged in the repository but
its corresponding change status not transitioned to merged.

Change-Id: I2735686455eae3575fdeea74143a6cdd5ccff91e
2017-12-21 13:55:38 +00:00
Nigel Babu
46bb5c7a2c Fix docs to say labels are laid out alphabetically
The labels have been always laid out alphabetically due to the fact that
they're passed as a dict, which does not guarantee order across
different labels. For more details, please see the code change[1].

[1]: https://gerrit-review.googlesource.com/#/c/gerrit/+/60246/

Change-Id: I6726ff28dd8830499747296c112048b4892dca3e
2017-12-19 06:34:54 +00:00
Hugo Arès
0c4dabf699 Fix invalid json example in POST access endpoint
Change-Id: I8032c066ec29b4ac24a6ba108c62f2f3d8d3353d
2017-12-18 15:00:40 -05:00
David Pursehouse
9dafc7a9db Merge "gerrit_plugin: Don't add Implementation-Vendor manifest entry" into stable-2.14 2017-12-15 12:34:36 +00:00
Hector Oswaldo Caballero
92a34d0b6c gerrit_plugin: Don't add Implementation-Vendor manifest entry
If a plugin specifies Implementation-Vendor, adding it again in the
gerrit_plugin rule results in a duplicate entry and the following
warning at build time:

  WARNING: Duplicate name in Manifest: Implementation-Vendor.
  Ensure that the manifest does not have duplicate entries, and
  that blank lines separate individual sections in both your
  manifest and in the META-INF/MANIFEST.MF entry in the jar file.

This change is the same as done in bazlets project by David Ostrovsky.

Change-Id: Iac72c1d1dbe11877e4e2042d2e11c8966147d7a9
2017-12-15 06:25:11 -05:00
David Pursehouse
524890d8a1 ListMailFilter: Static import from Collectors
Change-Id: I21ce35dbe41d6bbacf2a7a8c759d70fc094faa4e
2017-12-15 16:20:52 +09:00
Hugo Arès
7e065fc845 Fix plugin IT test for plugins using @PluginData annotation
Null was passed as PluginData directory causing a NullPointerException
when loading the plugin.

Change-Id: I0124aa97debf2ff2258cb6313c2279512b3743e3
2017-12-13 21:14:18 -05:00
Hugo Arès
ef1a749f9f Merge "Fix submit on push for same commit on multiple branches" into stable-2.14 2017-12-12 13:29:35 +00:00
David Pursehouse
40ad7ba34e Update git submodules
* Update plugins/hooks from branch 'stable-2.14'
  to 5df9a9dfdf4b4028393208d4412cc2c1a95fef39
  - Add documentation to help with debugging hook problems
    
    A common problem for users of the plugin is that they are not sure
    if their hooks are actually being executed, and what their output
    is.
    
    Such information is logged by the plugin, but only at debug level.
    
    Add a section in the documentation showing how to enable the logging.
    
    Change-Id: I6e040f958ce4503f5cc0468ebe09466914d4a7eb
    
  - Document behavior of plugin regarding configuration changes
    
    Change-Id: I6509349994fce8405086982ee0d58bd38292ad29
2017-12-11 23:49:20 +00:00
Sven Selberg
602a7798d7 Fix submit on push for same commit on multiple branches
If createNewCommitForAllInTarget = true is configured a commit might
identify more than one change. When trying to close changes on push
in ReceiveCommits this is not taken under consideration, instead it
tries to close the change of the first patch set that matches the
revision.
This could result in not closing changes even though patch sets
of the changes have been pushed into target.

Bug: Issue 7827
Change-Id: I085cc7129291194ffcf3b465b4db3111105c0efe
2017-12-11 13:28:18 +00:00
Saša Živkov
4b67f886ea Fix usage of maxTerms vs maxLimit in ChangeQueryBuilder
Change [1] first introduced confusion with this code, assigning maxLimit
to maxTerms:

  int maxTerms = args.indexConfig.maxLimit();

Change [2] then "fixed" the issue by renaming maxTerms local variable to
maxLimit. However, my understanding is that the intention in [1] was really to use
indexConfig.maxTerms() as it is about limiting the number of query
terms, not about limiting the number of results.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/72470/8/gerrit-server/src/main/java/com/google/gerrit/server/query/change/ChangeQueryBuilder.java#575
[2] https://gerrit-review.googlesource.com/c/gerrit/+/74533/1/gerrit-server/src/main/java/com/google/gerrit/server/query/change/ChangeQueryBuilder.java#626

Change-Id: If411d819e11e059b554c0e497dbbf9b067884692
2017-12-08 14:07:25 +01:00
Jacek Centkowski
b04decf8b5 Extend MigrateAccountPatchReviewDb summary with stats
Add the following information:
1. how many rows were migrated
2. how much time it took
3. what was migration speed (rows per/sec)

So that it is more consistent with Reindex operation output.

Change-Id: If49da15ed9806f2b0dd2e63911445a55785a5cfb
2017-12-05 14:01:59 +01:00
Saša Živkov
69678200e8 Print progress info from the MigrateAccountPatchReviewDb program
Change-Id: I54b26eebd530d7f5e6ac63c9570fcf5de1534ff1
2017-12-05 11:56:00 +01:00
Edwin Kempin
1cf8629107 CreateEmail: Trim new email
This removes leading and trailing whitespace from the email.

Change-Id: Ia2e70925572a07d7d5ed170a774894f2a5bf4543
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-11-27 13:23:35 +01:00
Edwin Kempin
8cede05fef CreateEmail: Move input validation into the second apply method
Since change I51a22a933e CreateEmail has 2 apply methods, one that is
used by Gerrit and another one that can be used by plugins that want to
create emails without permission checks. The input validation should
always be done. By moving it into the apply method that is also used by
plugins it is now always executed.

The check that rejects the email creation when the realm doesn't allow
to edit emails should stay in the first apply method (see change
Ic25f07e553).

Change-Id: I47307a9d133b78d4bb0ab67b7ce889c4f95abb54
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-11-27 13:22:33 +01:00
Edwin Kempin
b432a2abbd CreateEmail: Do null check for input before input is used
Change-Id: Iefff3a6d30f06ef9e5f76b1bedbe42ae0f0c398b
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-11-27 13:21:07 +01:00
David Pursehouse
62359b22ec Set version to 2.14.7-SNAPSHOT
Change-Id: If93dca26d3479403f0c23beb3173132eca4218cb
2017-11-27 09:40:03 +09:00
David Pursehouse
c1268be6e6 Set version to 2.14.6
Change-Id: I36e3f2688904c3ab6f5cfa77dabb13f58271cc13
v2.14.6
2017-11-26 19:24:23 +09:00
Sven Selberg
6614d1614b Populate ChangeAttribute.createdOn by default
This allows for aggregating review-time if defined as the timespan
between when a change is created and when it is merged.
    event.eventCreatedOn - event.change.createdOn

This metric is valuable to get some sense of how effective your
code-review strategy/practice is, which in turn allows you to get a
sense for how effective actions to improve review-time is.

Change-Id: I7344ea07dad70bac871dcca0051164af20b80682
2017-11-23 09:08:10 +01:00
Sven Selberg
75615b4fa2 config: sslCrl, use same case as documented
According to documentation it is camelcase:
- Documentation/config-gerrit.txt

Change-Id: If9c7df14dd3f4439b64bed87e626528be8051d89
2017-11-22 08:32:20 +01:00
Jacek Centkowski
c081b01c42 Add CORS to default plugin requests handling
Allow to request static or Documentation content with respect to CORS.
This change was inspired by [1] and [2]. It sets
Access-Control-Allow-Origin header to origin of the client if the
client's domain matches a regular expression defined in
'site.allowOriginRegex' or when 'site.allowOriginRegex' is empty
(assumption is that access to documentation is not restricted).

[1] https://gerrit-review.googlesource.com/c/gerrit/+/84191
[2] https://gerrit-review.googlesource.com/c/gitiles/+/84151

Change-Id: I0343ac1cdce9da10fea9bc207a4114e1596fbfab
Signed-off-by: Jacek Centkowski <jcentkowski@collab.net>
2017-11-21 23:30:12 +00:00