summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Set version to 2.14.11v2.14.11David Pursehouse2018-07-276-6/+6
| | | | Change-Id: Icc99ca45b13414d5f7af8ff2c9b994a57caa6e7b
* Upgrade elasticsearch-rest-client to 6.3.2David Pursehouse2018-07-272-3/+3
| | | | | | | | | | | | | | This version includes several bug fixes, but most are related to the server rather than the client. This upgrade is only to make sure we're using the latest version. Refer to the release notes [1] for details. Also update the test container to test against version 6.3.2. [1] https://www.elastic.co/guide/en/elasticsearch/reference/current/release-notes-6.3.2.html Change-Id: I80e65f4fe267cf487fddb759b3914e54e31164f3
* StalenessChecker: URLDecode project name before checking stalenessLuca Milanesio2018-07-271-1/+3
| | | | | | | | | | | | When change is retrieved from the Lucene index, the project name is URLEncoded and needs to be decoded before checking if the refs are stale or not. Failing to decode the project name would result in an infinite loop trying to check for project staleness. Bug: Issue 9482 Change-Id: I422d3ecde1fa12d38ed508bed6982aef71c2330e
* AbstractQueryChangesTest: Add a test with project name that requires URL ↵David Pursehouse2018-07-271-0/+7
| | | | | | | | | | | | encoding This test is passing on both Lucene and Elasticsearch, but exposes the problem in the staleness checker as reported in issue 9482. When running the test, the RepositoryNotFoundException can be seen in the logs. Bug: Issue 9482 Change-Id: I3dfe66e0f2051a6743963c1660ba435b1f8694d3
* Upgrade Dropwizard Metrics to 4.0.3David Pursehouse2018-07-271-2/+2
| | | | | | | | There are no specific fixes that we need in this version - in fact most of the changes are related to tests - so this upgrade is only to align to the latest version. Change-Id: I6e01398a05859b411fdbcd7db388e3061f866f53
* Upgrade JGit to 4.7.2.201807261330-rDavid Pursehouse2018-07-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This release contains several fixes since 4.7.1.201706071930-r. The ones we're particularly interested in are: - ResolveMerger: Fix encoding with string; use bytes which fixes issue 9153, and: - Delete all loose refs empty directories - Use java.nio to delete path to get detailed errors - GC: Remove empty references folders - Do not ignore path deletion errors which fix issues with cleanup of ref directories after running GC. The release also includes: - Honor trustFolderStats also when reading packed-refs Users should note that for repositories with a high number of references (for example in excess of 300K refs) and in a server with high traffic, this solution may not scale well and should be tested carefully. Bug: Issue 9153 Change-Id: I4a229589dd1a3a14844538df0556fa1b62731029
* Fix typos in documentation of 'List Files' REST API elementMakson Lee2018-07-271-2/+2
| | | | | Change-Id: If7021f46e1df96d923371a91fba92e45a105126c (cherry picked from commit faf05c292bb2e4d307fcac02ddfb4c9c938eefb2)
* DeleteRef: add missing permission checkChangcheng Xiao2018-07-252-3/+28
| | | | | | | | | | | | | This commit adds the missing permission check when delete a single branch through the "Delete Branches" endpoint. The permission check is forgotten because DeleteRef#deleteSingleRef assumes the caller has done it before. But "Delete Branches" didn't do that. It's created just for this stable branch. For "master", it's fixed by I6a7f48e4a9. Cherry-pick is hard because these classes have been refactored to other packages. Change-Id: I6431ffe5d2625c54dab23516680c7a9a81019108
* Merge "RestSession: Remove unnecessary utility methods" into stable-2.14Edwin Kempin2018-07-242-32/+22
|\
| * RestSession: Remove unnecessary utility methodsDavid Pursehouse2018-07-242-32/+22
| | | | | | | | | | | | | | | | | | | | Remove the postOK and getOK methods, and corresponding get/post methods that take an 'expectedStatus' argument. They are only used by the CacheOperationsIT tests, and can be easily replaced with calls to RestResponse.assertOK(). Change-Id: I403bf2076b8a93efc63596d837ac25d971ca3fa9 Signed-off-by: David Pursehouse <dpursehouse@collab.net>
* | PutConfig: add cause to ResourceConflictExceptionEryk Szymanski2018-07-241-1/+1
|/ | | | | | | | When update of project config fails there is no way to know what is the cause. Change-Id: I9bfd398c6e69865d332dd9849a0cb66a297473b4 Signed-off-by: Eryk Szymanski <eryksz@gmail.com>
* GerritServer: save gerrit.config before site initMarco Miller2018-07-202-8/+16
| | | | | | | | | | | | | | Do so as already done in 2.15 and master versions. Fix ElasticReindexIT so it passes also with this change. Contrary to Lucene, configuring the Elasticsearch index type currently assumes uninitialized indices -in Elasticsearch. Thus fix the test so it first asserts that assumption, then reindexes or initializes indices offline. The test then keeps testing as currently the case also for ReindexIT, i.e., through their common parent test class methods. Bug: Issue 8799 Change-Id: Ie52ea03a781c89fb3caf0f965f6fca1fb6c6a478
* ReindexIT: remove unnecessary method throws clauseMarco Miller2018-07-201-1/+1
| | | | | | Fix the corresponding IDEA warning. Change-Id: I00ea3c69ffa7f813b4f7929c8ce0f88f4ffb42cc
* Merge "Bump guice version to 4.2.0" into stable-2.14David Pursehouse2018-07-194-20/+4
|\
| * Bump guice version to 4.2.0David Ostrovsky2018-07-194-20/+4
| | | | | | | | | | | | | | | | | | | | | | The new version provides better support for Java 9 and improves performance. Multibindings artifact is now included in the guice core artifact. The full release notes is here: [1]. [1] https://github.com/google/guice/wiki/Guice42 Change-Id: I208d53ce1cf9b99ed8f03ae34470e95c3b8f71ce (cherry picked from commit 1fa7774d237d0ea864b9f03b6551fd1ebef0c619)
* | RestSession#postWithHeader: Make parameter order consistent with #putWithHeaderDavid Pursehouse2018-07-193-6/+6
|/ | | | Change-Id: I7243f1ce175eabaaad54905e55c2c5e512ce2175
* Follow up to: "Add new "Delete Changes" permission"Jacek Centkowski2018-07-181-0/+2
| | | | | | | | Add "Delete Changes" permission to constants so that it is displayed properly in GWT UI. Change-Id: I8b71afa8ed1507b3ca6f8ae1a5c48575c2477281 Signed-off-by: Jacek Centkowski <jcentkowski@collab.net>
* DeleteDraftPatchSetIT: Only 1 statement should come after ↵David Pursehouse2018-07-181-2/+2
| | | | | | ExpectedException#expect Change-Id: I33f3a67134175d76ec7933b1b3ca54e22ea25904
* RevisionIT: Only 1 statement should come after ExpectedException#expectEdwin Kempin2018-07-181-1/+1
| | | | | Change-Id: I5af2c5e9dfa4392baa824faf9c30f2c6b5e33c23 Signed-off-by: Edwin Kempin <ekempin@google.com>
* NotPredicateTest: Fix misuse of ExpectedExceptionDavid Pursehouse2018-07-181-9/+18
| | | | | | | | | | | Any additional statements after the statement that is expected to throw will never be executed in a passing test. This can lead to inappropriately passing tests where later incorrect assertions are skipped by the thrown exception [1]. [1] http://errorprone.info/bugpattern/ExpectedExceptionChecker Change-Id: I06a08ddd15e32decf5c18289ba228c2c78b31065
* Merge "Elasticsearch tests: remove password duplication" into stable-2.14David Pursehouse2018-07-176-8/+11
|\
| * Elasticsearch tests: remove password duplicationMarco Miller2018-07-136-8/+11
| | | | | | | | | | | | | | | | | | | | Only define the password once; default one for the stock 'elastic' user. The potential merge-up of this commit to master should consider the other change I290c8af2. If the latter gets merged, then that merge-up should also include amending master-only ElasticV5QueryProjectsTest. Change-Id: I99b4e328be1f1b761edb0abe8e55e4115ce3365a
* | ElasticIndexIT: replace member with local variableMarco Miller2018-07-131-2/+1
|/ | | | | | | As that (static) 'container' member was not read elsewhere than in this static method. Thus fix the corresponding IDEA warning. Change-Id: Ie38e14ed13354aa91e313e141e1959a6752f24cf
* Fix call to the fail skylark global in junit.bzlJiri Danek2018-07-121-5/+1
| | | | | | | | | | | | | The fail function takes an already formatted message, it does not provide for formatting arguments, the way Python's logger.log does, for example. I did not find any other improperly made call to fail in the rest of the bazlets project. C.f. https://docs.bazel.build/versions/master/skylark/lib/globals.html#fail Change-Id: If187b4d1f97ef331ead8a34f499c97cd8d5728f9
* Set version to 2.14.11-SNAPSHOTDavid Pursehouse2018-07-126-6/+6
| | | | Change-Id: I73ac5e27a8bf9b96efb4551752c7536660fed7c9
* Set version to 2.14.10v2.14.10David Pursehouse2018-07-126-6/+6
| | | | Change-Id: I4010235c44fecd27f0286eb17e0e132a4bd4f220
* AbstractQueryChangesTest: Add byMessageSubstring testDavid Pursehouse2018-07-121-0/+8
| | | | | Bug: Issue 9146 Change-Id: I11d8f4da87a0e27e9117e2c0087cbaff5d185338
* AbstractQueryChangesTest: Expand byTopic with more 'intopic' testsDavid Pursehouse2018-07-121-3/+11
| | | | | Bug: Issue 9147 Change-Id: Id33c105351b47c38a1f87258cde83d4c8fb4e8de
* Elasticsearch: Add char analyzer to ensure consistency of query resultsBorui Tao2018-07-123-4/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Elasticsearch, doing a query that involved the characters "." and "_", from full text fields, did not include results with keywords as a substring. This behavior was different from Lucene, where these two characters are mapped to the space character (" ") so that the query returns keywords separated by them. This change adds character mappings for Elasticsearch in order to ensure that the full-text queries return same results as when using Lucene. At index creation time, this change creates a new elasticsearch setting where an analyzer with character mappings is configured. This analyzer is then added to the elasticsearch mappings to be used by the full-text field queries. Because the elasticsearch mappings and settings can only be configured at index creation time, one should take the following steps to apply this change: 1. delete the index (changes, accounts, groups). 2. initialize an Elasticsearch site with this change. 3. reindex the documents (changes, accounts, groups). 4. start the site. This change applies to all the currently supported Elasticsearch versions. Bug: Issue 9146 Bug: Issue 9147 Change-Id: I6da7a98d35d912b5bee7cc510d02db4433f25538
* Elasticsearch: remove overridden build assignmentMarco Miller2018-07-111-6/+0
| | | | | | As the latter has been refactored through the one following it straight. Change-Id: Iabeced6beae5e937d9c667b75981819de9511f86
* Elasticsearch: run no other test at the same timeMarco Miller2018-07-113-1/+4
| | | | | | | | | | | | | | As per Bazel test documentation [1] that is: run all the Elasticsearch docker tests with the 'exclusive' tag set in. Do so to minimize the slower execution speed factor, thus running them tests in a more natural fashion. Doing so should then minimize flakiness or only leave true failures to be fixed. -Actual test execution speeds depending on the running host resources, of course. [1] https://docs.bazel.build/versions/master/test-encyclopedia.html Bug: Issue 9407 Change-Id: Ic9b57b84d06921abab91de57ecd4b86bcfb4272a
* ElasticVersionTest: run it through bazel as wellMarco Miller2018-07-111-0/+19
| | | | | | | | Make this test rule generic enough, so that other potential new test classes get executed with no change required. Exclude test classes that are already picked up by sibling test rules. Change-Id: I2814885b364d8b50017b728ea6fc6301516c45cd
* Elasticsearch: cover V5 and flaky V6 tests -for CIMarco Miller2018-07-111-13/+47
| | | | | | | | | | | | | | | | | | | | Add execution of the V5 and V6 tests to the already included V2 default. Include flaky tag support for the V6 tests though, as their accounts and groups subset currently fails (cf. Issue 9252). Adding such a tag here allows to exclude the V6 tests in a CI context. The V5 tests still pass (just like V2's) thus require no such flaky tag for passing CI coverage. Before this change, it was not possible to benefit from V5/V6 elastic tests feedback. Thus the previous risk of elastic support regressions. Once a fix for Issue 9252 becomes available, one will be able to get such feedback for V6, on top of V5 added herein and default V2. Until then, excluding the hereby flaky V6 tests allows for V5 and V2 checks: bazel test //... --test_tag_filters=elastic,-flaky (e.g.). Change-Id: I62fef6dca20a73065df6b3dd4b21deb1ac7653fd
* Split Elasticsearch query tests into separate rulesDave Borowitz2018-07-111-4/+10
| | | | | | | | | | | | | | | | | | $ bazel test -t- //gerrit-elasticsearch/... INFO: Build options have changed, discarding analysis cache. INFO: Analysed 3 targets (2 packages loaded). INFO: Found 3 test targets... INFO: Elapsed time: 126.687s, Critical Path: 124.80s INFO: 9 processes: 2 remote cache hit, 4 darwin-sandbox, 3 worker. INFO: Build completed successfully, 24 total actions //gerrit-elasticsearch:elasticsearch_query_accounts_test PASSED in 65.0s //gerrit-elasticsearch:elasticsearch_query_changes_test PASSED in 122.5s //gerrit-elasticsearch:elasticsearch_query_groups_test PASSED in 53.5s Executed 3 out of 3 tests: 3 tests pass. INFO: Build completed successfully, 24 total actions Change-Id: I1bc530879ae69d74d39750a173d5458b2fb72bd9
* dev-contributing: Document that we format .bzl files with buildifierDavid Pursehouse2018-07-111-1/+1
| | | | Change-Id: I7556af36c770d1af8822c3d5bd36abc043f19092
* Apply buildifier to .bzl files.Han-Wen Nienhuys2018-07-1021-1598/+1721
| | | | | | | | Buildifier is now also used for formatting .bzl files. This change was created by running buildifier 0.12 over our source tree. Change-Id: I9f15112d4fe23e5cec0700cfe47f1ca649f61d2a
* Merge branch 'stable-2.13' into stable-2.14David Pursehouse2018-07-100-0/+0
|\ | | | | | | | | | | | | * stable-2.13: Update Bower to 1.8.2 Change-Id: I690bc00105d4987bec0aa14bc7936a85256b3f3b
| * Update Bower to 1.8.2Viktar Donich2018-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | See https://twitter.com/bower/status/918073147789889536 bower moved their mirror to in house so they can put it behind a cdn. This also resulted in a domain change. Change-Id: Ie26d464687fe10a46c1fd83b9445c5fcf3cbbca9
* | Bump commons-io version to 2.2David Ostrovsky2018-07-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This dependency is not used in gerrit core. The only reason it's included in WORKSPACE is because core replication plugin depends on it and there is no way in Bazel to consume external dependency in core plugin without defining this dependency in WORKSPACE file. It turns out, that gitblit-plugin also depends on commons-io, but on the newer version. Sync the versions to the same version used by gitblit. Change-Id: Iae3545df95b23439d3c7fd385bfeae482d6d60ac (cherry picked from commit 6488535f737cdce5feeca2550ce402d803d4d5a9)
* | Elasticsearch: remove unnecessary test build depsMarco Miller2018-07-101-6/+0
| | | | | | | | Change-Id: I9d8e186e5836e83ea8bb3d4917b349ff75e4374b
* | Add documentation for the change report formatter interfaceDavid Pursehouse2018-07-061-0/+10
| | | | | | | | Change-Id: I2d85bbade228d89caabad334742641ecccbe4af7
* | CommitValidators: Fix repeated "Change-Id" in error messageDavid Pursehouse2018-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If a change is pushed without a Change-Id footer, but with a potential Change-Id line somewhere else in the body of the commit message, the error message says: Hint: A potential Change-IdChange-Id was found, but it was not in the footer (last paragraph) of the commit message. i.e. with repeated "Change-Id" in the first line. Change-Id: I035e20b72b0b48b090a9183310f3460f97755d00
* | ChangeReportFormatter: Convert Input to use AutoValue.BuilderDavid Pursehouse2018-07-063-39/+53
| | | | | | | | | | | | Change-Id: I5e1a4550701a9eaad2bbfdb9e7183a21dfda7cec Signed-off-by: David Pursehouse <dpursehouse@collab.net> Helped-by: Patrick Hiesel <hiesel@google.com>
* | Introduce Change Report formatter extension pointJacek Centkowski2018-07-065-38/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When change is pushed for review typical response looks like: remote: New Changes: remote: http://[server]/gerrit/[change-id] [change subject] It is not sufficient for sites that serve Gerrit as a service that is integrated under unified UI (with unified Code Browser). In such environment links to Gerrit are no longer valid and it should be possible to alter them with desired format. This patch introduces ChangeReportFormatter that can be replaced with instance loaded from plugin (DynamicItem pattern) with default implementation that preserves current behavior. Change-Id: Ia2de44c121b6a73fcf93e1aaf11690697adb9abf Signed-off-by: Jacek Centkowski <jcentkowski@collab.net> Signed-off-by: David Pursehouse <dpursehouse@collab.net>
* | Update elasticsearch-rest-client to 6.3.1David Pursehouse2018-07-062-3/+3
| | | | | | | | | | | | Also update the test container to use version 6.3.1. Change-Id: I78d24ba8ba1a8612276a78ab3549b37cd53708d2
* | user-review-ui: Fix typoDavid Pursehouse2018-07-061-1/+1
| | | | | | | | Change-Id: I4f7b4da57c29f95218c2e75beb256182d7f69f54
* | Add new "Delete Changes" permissionDavid Pursehouse2018-07-056-6/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes can only be deleted by Administrators, or by the change owner when they are granted the "Delete Own Changes" permission either on the "Change Owners" virtual group or an internal group they are a member of. This means that it is not possible to allow users to delete other users' changes other than by granting the "Administrate Server" permission, which also gives them all the other administrative capabilities. This is also inconsistent with how the "Delete Drafts" permission works. An example of where it would be better to have more flexible permissions is allowing changes to be deleted by Project Owners on a per-project basis, or by a group of users who are trusted (but not enough to grant them Administrator capabilities). Add a new permission "Delete Changes" which allows these use cases, thus a change can now also be deleted by users who are: - Member of a group that is explicitly granted "Delete Changes" on the change's destination branch. - Member of a group that is given the "Owner" permission on the project, when the virtual group "Project Owners" is granted "Delete Changes" on the change's destination branch. Bug: Issue 9354 Change-Id: I9d5d779eb0a6ce18faca02b9fc90904ec5da91d9
* | ChangeIT: Refactor tests for deletion of new changesDavid Pursehouse2018-07-051-25/+14
| | | | | | | | | | | | | | | | | | Instead of cloning the repo as "user" and then using git push to create the change, use the change API to create the change. This avoids the unnecessary cloning of the repository, and makes it more explicitly clear which user is supposed to be the owner of the created change. Change-Id: Id4a3ff77a6128d4500eeaba37d01d69b8253b165
* | ElasticTestUtils: Set index.maxLimit as integer rather than stringDavid Pursehouse2018-07-041-1/+1
| | | | | | | | Change-Id: Ib23c6bdc18212aba8b8e35ab56c25e6dc3fd8429
* | ElasticConfigurationTest: Add tests for elasticsearch.maxRetryTimeoutDavid Pursehouse2018-07-041-0/+22
| | | | | | | | Change-Id: I3100fac2c3e00d50a52d78c0eed58c376c102019