summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Be more consistent about object ids used in ref operation validationv2.13.7David Pursehouse2017-03-223-2/+8
| | | | | | | | | | | | | | | | | | | | | | In CreateBranch, a RefUpdate is created with expectedOldObjectId set but not oldObjectId. In DeleteBranch[es], none of expectedOldObjectId, oldObjectId, and newObjectId is set. As a result, when RefOperationValidators uses oldObjectId and newObjectId to create a ReceiveCommand, they can be null, resulting in NullPointerException when a listener dereferences them. So use expectedOldObjectId instead of oldObjectId in RefOperationValidators. Before a ref update has been performed, only the former is meant to be set. In DeleteBranch[es], set the expectedOldObjectId and the newObjectId (which is zero). This way, in RefOperationValidators we know both values will always be set. Bug: Issue 5817 Helped-By: Jonathan Nieder <jrn@google.com> Change-Id: If1f3a6179fa789077731a16e4b731227a73be7f2
* Set version to 2.13.7David Pursehouse2017-03-2210-10/+10
| | | | Change-Id: Ifefe36b432a69d0f0eeb183735cb21f9679a36b2
* Upgrade JGit to 4.5.1.201703201650-rLuca Milanesio2017-03-225-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | This release includes several bug fixes since 4.5.0.201609210915-r: a9a84b723 JGit v4.5.1.201703201650-r 4c558225d Don't remove pack when FileNotFoundException is transient 4ddd4a3d1 Fix one case of missing object 8f6029786 Use the same variable to check and extract LFS object id a66b4c29a Config: do not add spaces before units 535f0afd1 Unconditionally close repositories in RepositoryCache.clear() 5a1e147ea Fix eviction of repositories with negative usage count 15341ce57 pgm: Fix misspelled key of an externalized string d2312f292 Add missing online help for Ketch server type option in CLI daemon 9cb8192d1 Remove wrong junit dependencies in org.eclipse.jgit.pgm dd585b779 Fix carrying over flags during a RevWalk c10a7e793 Turn off doclint also during Maven site generation cb617e7ff Prepare 4.5.1-SNAPSHOT builds Notably it fixes packfile list consistency in memory due to temporary lack of system resources during read, causing transient file not found errors. Change-Id: I6eac409cc13f940a2b9b22c0285d62fd11047d54 Signed-off-by: David Pursehouse <dpursehouse@collab.net>
* GroupsIT: Remove unused variableDavid Pursehouse2017-03-201-2/+2
| | | | Change-Id: If129658905324400b9dc7a9c0d503a41bfe55dda
* Support for at-sign (@) in usernamesJan Kundrát2017-03-182-1/+13
| | | | | | | | Our SSO system (Shibboleth, a SAML thing) is a federated system which uses login names such as kundrat@cesnet.cz for unique identifiers. Change-Id: Ic2df0f270c178e7a93dde5d0460dd24f10edf321 Bug: Issue 2830
* VersionedMetaData: Fix deletion of last file in branchEdwin Kempin2017-03-172-8/+46
| | | | | | | | | | | | | | | | If the last file of a branch was deleted by VersionedMetaData.saveFile we discarded the new tree and instead kept the tree from the parent commit. Due to this the file was not deleted and its original content was kept. This issue was introduced by change I83f09e08f. E.g. this bug can be hit if all project watches of a user are deleted and the user branch only contained the watch.config file. In this case the project watches were still there after the deletion. Change-Id: I3047ea087fb9981eb484ec6689652a0ed44e1b4b Signed-off-by: Edwin Kempin <ekempin@google.com>
* WatchConfig.Accessor: Add method to delete all watches of an accountEdwin Kempin2017-03-171-0/+13
| | | | | | | | | The new method allows to delete all project watches of an account as an atomic operation. We need this method to finish the migration of the project watches to NoteDb on gerrit-review. Change-Id: I6e4b50dc99913641bc9d39bab60a6bc5b2f2f073 Signed-off-by: Edwin Kempin <ekempin@google.com>
* JettyServer: Enable systemd socket activation for gerritThomas Meyer2017-03-164-1/+35
| | | | | | | | | | | | | | | | | | | Using a "gerrit.socket" unit file like this: [Unit] Description=Gerrit HTTP socket [Socket] ListenStream=80 Accept=no [Install] WantedBy=sockets.target and a corresponding gerrit.service file enables an automatic start of gerrit on the first request on port 80. Change-Id: I1f82fed3c17f231915a5add4d7336a2b88457bc3
* Merge "LfsPluginAuthCommand: Don't spam error log when LFS plugin is ↵David Pursehouse2017-03-161-3/+10
|\ | | | | | | missing" into stable-2.13
| * LfsPluginAuthCommand: Don't spam error log when LFS plugin is missingDavid Pursehouse2017-03-141-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The LfsPluginAuthCommand is only installed when lfs.plugin is set in the gerrit.config file. However, if the corresponding plugin is not actually installed, or it does not provide the command implementation, Failure is thrown which results in a stack trace being emitted to the log on every ssh push operation. Change it to throw UnloggedFailure, and write a less verbose message to the log at warn level. This will still be emitted to the log on every ssh push, but it's less noisy than before. Change-Id: Ie638bda96ddbac173eccd74f9f6a25ed87c778c8
* | Do not append a message on push for already merged changesOrgad Shaneh2017-03-151-1/+5
|/ | | | | | Can happen if a branch is deleted and then restored by push. Change-Id: Ie9ad0195af855327538b1c52ed0e6dc45b0130f8
* OperatingSystemMXBeanProvider: Don't throw IllegalStateExceptionDavid Pursehouse2017-03-091-7/+7
| | | | | | | | | | If the implementation of OperatingSystemMXBeanProvider can't be instantiated, simply return null and thus skip the CPU and file descriptors metrics, rather than throwing IllegalStateException which prevents the site from starting. Bug: Issue 5727 Change-Id: I8c8e155c274e788dbea07c64ae1c95aac09df35b
* Fix link in account REST API documentationEdwin Kempin2017-03-091-1/+1
| | | | | Change-Id: I99f116462b0a59c3f036a55416398bef6e9e7f8e Signed-off-by: Edwin Kempin <ekempin@google.com>
* Allow user with maintain server permissions to find any changeLuca Milanesio2017-03-081-1/+4
| | | | | | | | | | | | | Gerrit users who are delegated to maintain the server may be highly restricted to access projects and branches. There are maintenance operations that can still be allowed on change-ids even on non-visible projects. By allowing users delegated to maintain the server to find non-visible change-ids in the CLI we can enable features such as the ad-hoc change indexing. Change-Id: Ia2ec07517c70f2cc4aed1bee832ea04a45fc6466
* Do not assume DB down if change to index not foundLuca Milanesio2017-03-071-3/+1
| | | | | | | | | | | | | The Gerrit SSH command "index changes" may receive change numbers that cannot be found or refer to repositories that have problems. The assumption of "DB is down" when receiving an OrmException was wrong because the JGit errors were simply wrapped as OrmException and do not necessarily mean that you cannot continue to process the other ones in the list. Change-Id: I1098be16b682dce8d4e63120e7e50f937b19a7b8 (cherry picked from commit 9a52dd1dce8a79b90e8bfad4f718659aafe1a3e8)
* Allow to continue reindex despite failuresLuca Milanesio2017-03-071-1/+1
| | | | | | | | Display a warning when a change is not found but then continue to try to reindex the rest of the changes, consistently with the current behavior of the command. Change-Id: I51b98a8bb28362456ac7a5df5efa74c1fa1de284
* Merge "Fix eviction order when linking new external ids" into stable-2.13David Ostrovsky2017-03-061-1/+1
|\
| * Fix eviction order when linking new external idsLuca Milanesio2017-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an account is linked to another external id at login, the cache invalidation was made too early and the cache and index were reloaded with a stale entry. This would have impacted users linking other external ids that ended up having an inconsistent cache state: - accounts by id were correct, because external ids where loaded from DB - accounts by name were stale, because external ids where loaded from index With this fix, all the caches are consistent and the reindex happens at the right time, when the new external ids has been linked. Bug: Issue 5055 Change-Id: I9ca07d10597db482d8a0d0cb4ce19f99ddc19b10 (cherry picked from commit 96e0d7fd8be23db14520a26cffa93eafed53c3fa)
* | Revert "Always use REVIEW state in ReviewDb"David Ostrovsky2017-03-064-52/+94
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReviewDb persistence layer doesn't provide any means to store internal "reviewer" or "cc" state, like it is possible with NoteDb. Instead, in ReviewDb code path, the voted reviewers were assigned "reviewer" state and non voted reviewers were assigned "cc" state. This is important for implementation of notification channel, that should reach only specific reviewer state and not all reviewers. The most prominent examples for this differentiation is adding reviewer and upload new patch set use cases. Power users and maintainers are often added to very high amount of changes as reviewers. Not for all of them they do really care. Until actually voting on those changes notifications on these events shouldn't be sent to non voted reviewers. To prevent this, in the mentioned use cases only voted reviewers should be notified. NoteDb doesn't provide this feature. In NoteDb code path, the voted reviewer state was never implemented. Instead of promoting any reviewer state in NoteDb code path to voted reviewer state only, to provide the battle proven notification firehouse experience in ReviewDb code path, since Ib9a1f40b69e the internal voted reviewer state was demoted in ReviewDb code path from voted reviewer state to any state: voted or non voted reviewer on a change. This broke all caller sites in ReviewDb code path for: changeData.reviewers().byState(ReviewerStateInternal.REVIEWER) that expected to get a reviewer with non-zero votes. Those caller sites were not adjusted. The comments are still claiming: /** Users who have non-zero approval codes on the change. */ Particularly, this broke "Add Reviewer" and "Upload new patch set" use cases, that started to add all existing reviewers and not only voted users to CC for notification for these use cases. In 2.13 release this change was even not justified, as NoteDb is not ready for production use anyway. It could be done in one or another form in later releases, with announcement or, better, with offering of viable alternative like Work-In-Progress workflow implementation, where users can have fine granular control of whether notifications are sent or not. This reverts commit e8da8bfbc3fb853e4a10a34820e1f60527eab093. Bug: Issue 5190 Change-Id: I1d67e36882b1b4b31d2c2e1a34ce5bbfe5ee733c
* LocalDiskRepositoryManager: Handle failure to visit file/pathDavid Pursehouse2017-03-041-0/+6
| | | | | | | | | | | | If Files.walkFileTree fails due to a directory or file in the git root being inaccessible, it throws an exception and subsequent directories are not processed. Override the visitFileFailed method on the visitor. Log the error and continue. Bug: Issue 5698 Change-Id: I7f4d76b30f3f8907128dacf357b70eea47fb0962
* Update git submodulesEdwin Kempin2017-03-031-0/+0
| | | | | | | | | * Update plugins/reviewnotes from branch 'stable-2.13' - Fix reviewnotes export Bug: Issue 5652 Change-Id: Ib3dfb89ed32c39c449a0e4bfba79c1549a196583 Signed-off-by: Edwin Kempin <ekempin@google.com>
* ProcMetricModule: Use reflection to avoid direct reference to com.sun classesDavid Pursehouse2017-03-022-25/+104
| | | | | | | | | | | | The current metric module is dependent on com.sun internal classes that are not available in the JRE from other providers such as IBM, resulting in ClassNotFound exceptions when initializing the CPU usage metric. Refactor the initialization to dynamically cast to the first available class, either the one from Sun or the one from IBM. Bug: Issue 4637 Change-Id: Ib14f001dfe6a144853032a0c6a3e249b59daf9de
* RebaseIfNecessary: Use submitter's identity on mergeOrgad Shaneh2017-03-011-1/+4
| | | | | | | | | | When a merge commit is not fast-forward, gerrit creates a "merge of merge" commit with its server identity. This is wrong. It should use the submitter's identity, like in "Merge If Necessary" and "Merge Always" strategies. Change-Id: If11d63d81d8ed5352104defc2410585f5e3366ef
* Prevent circular module dependency when running in external containerThomas Meyer2017-02-281-9/+8
| | | | | | | | | | | | | | | | | | Commit 220a3f5 introduced circular dependency between the database module and NotesMigration (impl. class ConfigNotesMigration). Having the site path being stored in the database was broken by above change. The class Daemon solves this by explicitly setting the site path and adds a SitePath module before starting everything. This patch makes it possible again to run the gerrit war in an external Servlet container, but you need to set the System property "-Dgerrit.site_path=/path/to/gerrit" to make it work. The site path stored in the database became practically obsolete with the NotesMigration change mentioned above. Change-Id: Id735fbf928dda186e659792c84d4e675c893a29a
* Update Documentation of Auto Site InitializationReyad Attiyat2017-03-011-24/+4
| | | | | | | | | Since the NotesMigration change, commit 220a3f5, it is no longer possible to configure site_path in the database, with the system_config table, during automatic site initialization. This commit updates the documentation by removing references to this configuration option. Change-Id: I3e4392991fb9d27c5306162353816759d2bbe577
* Fix wrong variable in log message in BatchUpdateZhen Chen2017-02-271-5/+3
| | | | | Change-Id: Ib7ca67d3f0eea1aec09bfca0854cfa5bd1929ca9 (cherry picked from commit c8b58edfd183194bc03ad6fff165be3a41ecb518)
* Change BatchRefUpdate error into a 500 error instead of 409Zhen Chen2017-02-251-2/+2
| | | | | Change-Id: I490408f1d36c5f3b79be503500d3a969bb027866 (cherry picked from commit 5406d7aa80e6cabc98e129a7a2a749c8e2d0dd76)
* Don't require Add Patch Set permission for submit by rebasev2.13.6Edwin Kempin2017-02-215-10/+61
| | | | | | | | | | | | | | | When the submit strategy was Rebase Always or Rebase If Necessary and a rebase was needed for the submit, the submit failed if the user didn't have the Add Patch Set permission. However for submitting a change the Submit permission alone should be sufficient. The behavior is now consistent with the Cherry-Pick submit strategy which also doesn't require the Add Patch Set permission if a cherry-pick is done on submit. Change-Id: Id9c484ff51f9dfa7ea77216fbf9b06a799676412 Signed-off-by: Edwin Kempin <ekempin@google.com> (cherry picked from commit 969a1953cf3889baa663fe59e421ba9cffcbabe3)
* Set version to 2.13.6David Pursehouse2017-02-2110-10/+10
| | | | Change-Id: Iff4e3dd171dbeca604d2eeb854ef162688ae84e4
* Filter Git LFS HTTP requests through auth filterJacek Centkowski2017-02-172-1/+8
| | | | | | | | | | | | | | | | | | Git LFS requests include the authorization as HTTP Basic but this is ignored and the user is treated as anonymous. Filter these requests through the same auth filter as used for git, so that the user can be determined. The filter URL is based on the existing LFS regex [1] but ignores the "/a/" prefix so that it is not called 2 times when LFS request starting with "/a/" is performed. [1] com.google.gerrit.httpd.plugins.LfsPluginServlet.URL_REGEX Change-Id: I7ac47233cb003068722c117760731ae20ec63ace Signed-off-by: Jacek Centkowski <jcentkowski@collab.net> Signed-off-by: David Pursehouse <dpursehouse@collab.net>
* PostReviewers: Add missing @Override tagDavid Pursehouse2017-02-151-0/+1
| | | | Change-Id: Ib7e0c1ff66c66df0f81b1e5a4842fc9c1547403a
* Only send one newchange email from PostReviewerWyatt Allen2017-02-103-31/+48
| | | | | | | | | | | | | | | | | | This is a revision of change If45290b87 with updated tests that no longer need to take NoteDB into account separately. The PostReview REST endpoint translates each new reviewer in the request into invocations of the PostReviewers REST endpoint, which would send a newchange email each time a reviewer is successfully added. Because the PostReview endpoint allows several Reviewers and CC'd users in batch, prevent the PostReviewers sub-calls from sending emails, and send one newchange email at the end. Tests are updated to reflect fewer emails being sent and to reflect CC'd user names no-longer appearing in the email salutation. Bug: Issue 4563 Change-Id: I1cfd56ac1a2d107b9f6aae58ed056a1a458410af
* PostReviewers: Add notify handling for reviewers added emailSven Selberg2017-02-094-13/+32
| | | | Change-Id: I99fa47548e2bd80584260e5f4e7093d246b27539
* ProjectQoSFilter: Remove unnecessarily nested else-blockDavid Pursehouse2017-02-081-2/+2
| | | | Change-Id: Icabeaa9cedf50a84da62ab67d24355928fae8fbb
* Merge branch 'stable-2.12' into stable-2.13David Pursehouse2017-02-081-15/+10
|\ | | | | | | | | | | | | * stable-2.12: Revert "Resolve username lazily in git over http tasks" Change-Id: I574e70a57f4a53487a2bd83b38e321ba13deaa31
| * Revert "Resolve username lazily in git over http tasks"Hugo Arès2017-02-071-15/+9
| | | | | | | | | | | | | | | | | | | | This reverts commit 3fd92a4ac50e5ef49043858ab2576050634a3c2e. The change was supposed to print the username in the queue for git over http operations but the username printed is the one of the person doing show-queue, not the one doing the git operation. Change-Id: I2f45d526b684af9f3aa336879b310a165048382e
* | Merge "Test Change-Ids checks on push with CreateNewChangeForAllNotInTarget" ↵ekempin2017-02-071-3/+52
|\ \ | | | | | | | | | into stable-2.13
| * | Test Change-Ids checks on push with CreateNewChangeForAllNotInTargetEdwin Kempin2017-02-031-3/+52
| | | | | | | | | | | | | | | Change-Id: Ia1a8677c32398801246bc402728df9785789b9e9 Signed-off-by: Edwin Kempin <ekempin@google.com>
* | | DropWizardMetricMaker: Don't fail when same metric name is definedDavid Pursehouse2017-02-071-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since change Id45682c30 it is possible for plugins to define a custom prefix for metric names. In the situation where multiple plugins define metrics with the same name, due to those plugins sharing a common base implementation, this causes an IllegalStateException with the message: metric prefix/metric-name already defined Adjust the check to only throw IllegalStateException when the same metric is defined with a different description. Change-Id: I04602b93ee82c5348cc62ba669c740175e605d39 Signed-off-by: David Pursehouse <dpursehouse@collab.net>
* | | Allow plugins to set a custom metrics prefixDavid Pursehouse2017-02-065-8/+47
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By specifying the prefix in the gerrit.config, i.e. [plugin "my-plugin"] metricsPrefix = "my-root" the metrics emitted by the plugin will be recorded under: /gerrit/my-root/metric-name rather than the default: /gerrit/plugins/my-plugin/metric-name Change-Id: Id45682c30e66e266ff5360f8f3fa4fa636151b1d Signed-off-by: David Pursehouse <dpursehouse@collab.net>
* | MetaDataUpdate: Do not close repository that was passed inDavid Pursehouse2017-02-031-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The repository to be updated by MetaDataUpdate can either be passed in, or created based on other passed parameters. If the repository is passed in, it should not be closed by the MetaDataUpdate's close() method. This is because it is possible that the repository was created in a try-with-resource block and will get automatically closed. Closing it in MetaDataUpdate will then cause the repository to be closed too many times, resulting in a corrupt use count. Update the static factory methods to prevent closing of the repository that was passed in. Also update the Javadoc to explicitly mention that the passed in repository must be closed by the caller. Also rename 'db' member variable and parameters to 'repository' which is more meaningful. Bug: Issue 5404 Change-Id: I7ef68ecba31f1ca2528cf96c698c908c7303bdca
* | BaseInit: Bind DisabledMetricMakerDavid Pursehouse2017-02-032-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases a plugin may have an InitStep that refers to other classes in its implementation, that in turn get a MetricMaker injected. Since the MetricMaker, among other things, is not available to the InitStep, this results in a guice injection error during the plugins init step of site initialization. Bind the DisabledMetricMaker to avoid the injection error. This has the result that the InitStep works, but no metrics can be recorded. Update the metrics documentation to explicitly mention that metrics are not available during plugin init steps. Bug: Issue 5438 Change-Id: Iac9f462eb93a2ae668d5c934e61eda9f23bd3c4d
* | Update git submodulesDavid Pursehouse2017-02-031-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | * Update plugins/hooks from branch 'stable-2.13' - Add metrics for hook execution - Execution latency - Execution count - Error count - Timeout count Change-Id: I7ed95e08608b436ab533929322f951e85a45b7f9
* | InMemoryRepositoryManager: Increment repository use countDavid Pursehouse2017-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | When the same repository is opened more than once its use count should be incremented. If it is not, closing it more than once will result in the warning from JGit: close() called when useCnt is already zero Change-Id: I08ed7b544bef942a595f2a85030e6d4faa90f3f2
* | InMemoryTestingDatabaseModule: Bind InMemoryRepositoryManager as SingletonDavid Pursehouse2017-02-031-1/+2
| | | | | | | | Change-Id: Ica9b2136270f31252c0040f6c8f630a2daff8348
* | Update git submodulesDavid Pursehouse2017-02-031-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update plugins/replication from branch 'stable-2.13' - ReplicationMetrics: Make members private final These members should only be accessed through the public methods: - start(...), to create/start a new timer context - record(...), to record the retry/delay values Mark the members as private final to prevent unintended access. Change-Id: I69a7e3b13ba4c344f3176528306163ebef07653c
* | Merge branch 'stable-2.12' into stable-2.13David Pursehouse2017-02-021-1/+1
|\| | | | | | | | | | | | | * stable-2.12: commit-msg hook: Add Change-Id after Depends-On: footer Change-Id: I3ac5021e784622c9cdbcdd39ac7124a910300d96
| * commit-msg hook: Add Change-Id after Depends-On: footerPaladox none2017-01-171-1/+1
| | | | | | | | | | | | | | Zuul uses Depends-On to test with dependencies. So lets add it to the commit-msg. Change-Id: Iae2bd55d2c4bd6463763b9bfe05837f47e9db598
* | Merge changes I11c3c1a2,I9a177deb into stable-2.13David Pursehouse2017-02-024-8/+99
|\ \ | | | | | | | | | | | | | | | * changes: Make error message for rejecting Egit placeholder Change-Id consistent Add tests for pushing without Change-Id and with invalid Change-Ids
| * | Make error message for rejecting Egit placeholder Change-Id consistentEdwin Kempin2017-02-023-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the commit dialog Egit uses a placeholder for the Change-Id ("I0000000000000000000000000000000000000000") which it replaces later with the real Change-Id. Some users thought that this placeholder also works on the commandline, but of course there the replacement wasn't done. As result of this there were lots of changes with this placeholder Change-Id (as from the format it's a valid Change-Id) and users got confused about updating each other changes. To prevent this Gerrit rejects this placeholder Change-Id as invalid. However the message for this was inconsistent with the message that is used for other invalid Change-Ids. Also all validations should be done in CommitValidators, but the check for the Egit placeholder Change-Id was still done in ReceiveCommits. Move the check to the right place. Change-Id: I11c3c1a2d0023c4852d2fa6ec3a54a1245030377 Signed-off-by: Edwin Kempin <ekempin@google.com>