From 5409315271b8ab539812cf14ea7163acce030ef5 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Fri, 8 May 2015 10:50:35 +0200 Subject: [PATCH 01/19] Fix description of auth.* parameters Change-Id: I9153d25be6f7abc19aaaf37b2d5d3dd26ced958e Signed-off-by: Edwin Kempin --- Documentation/config-gerrit.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index a4498beb3f..85b4adb2bb 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -337,26 +337,27 @@ If not set, the redirect returns to the list of all open changes. [[auth.registerUrl]]auth.registerUrl:: + Target for the "Register" link in the upper right corner. Used only -when `auth.type` is `LDAP`. +when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`. + If not set, no "Register" link is displayed. [[auth.registerText]]auth.registerText:: + Text for the "Register" link in the upper right corner. Used only -when `auth.type` is `LDAP`. +when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`. + If not set, defaults to "Register". [[auth.editFullNameUrl]]auth.editFullNameUrl:: + Target for the "Edit" button when the user is allowed to edit their -full name. +full name. Used only when `auth.type` is `LDAP`, `LDAP_BIND` or +`CUSTOM_EXTENSION`. [[auth.httpPasswordUrl]]auth.httpPasswordUrl:: + Target for the "Obtain Password" link. Used only when `auth.type` is -`LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`. +`CUSTOM_EXTENSION`. [[auth.switchAccountUrl]]auth.switchAccountUrl:: + From 5e2783db1b620bd8ffc52021f21ab97178cb6ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Engelthaler?= Date: Sat, 9 May 2015 22:47:39 +0200 Subject: [PATCH 02/19] GitWeb config: Delete temporary config on exit GitWeb config file remains undeleted in temporary directory on Gerrit exit. Call deleteOnExit() for this temporary file. Change-Id: Ib62579b36cfe73bca0fa1f44383e6a613609cb45 --- .../main/java/com/google/gerrit/httpd/gitweb/GitWebServlet.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/gitweb/GitWebServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/gitweb/GitWebServlet.java index 39b8249131..573725c9dc 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/gitweb/GitWebServlet.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/gitweb/GitWebServlet.java @@ -160,6 +160,8 @@ class GitWebServlet extends HttpServlet { myconf.setWritable(true, true /* owner only */); myconf.setReadable(true, true /* owner only */); + myconf.deleteOnExit(); + _env.set("GIT_DIR", "."); _env.set("GITWEB_CONFIG", myconf.getAbsolutePath()); From 43a7525769a527281c9e0d215e4b09aae40755a5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 11 May 2015 14:48:36 +0900 Subject: [PATCH 03/19] JarPluginProvider: Add JarScanner on running plugin JAR file The JarScanner is being added on the source JAR file. This causes the file to be held open, which prevents the file from being renamed when the plugin is disabled when running Gerrit on Windows. Add the JarScanner on the copied JAR file from which the plugin is actually being run instead. Bug: Issue 3310 Change-Id: I14abda9bcaaf002e74e728a53f3efd60186df096 --- .../com/google/gerrit/server/plugins/JarPluginProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/JarPluginProvider.java b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/JarPluginProvider.java index 53f39f1cb5..34060805a7 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/JarPluginProvider.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/JarPluginProvider.java @@ -142,7 +142,7 @@ public class JarPluginProvider implements ServerPluginProvider { new URLClassLoader(urls.toArray(new URL[urls.size()]), PluginLoader.parentFor(type)); - JarScanner jarScanner = createJarScanner(srcJar); + JarScanner jarScanner = createJarScanner(tmp); ServerPlugin plugin = new ServerPlugin(name, description.canonicalUrl, description.user, srcJar, snapshot, jarScanner, description.dataDir, From 08c0ac28f79a291aa93223c2f608f525569386b5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 12 May 2015 09:43:13 +0900 Subject: [PATCH 04/19] Update 2.11.1 release notes Change-Id: Ibd09d63bf52c4749933fc3ca353a35590dfdf896 --- ReleaseNotes/ReleaseNotes-2.11.1.txt | 29 +++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/ReleaseNotes/ReleaseNotes-2.11.1.txt b/ReleaseNotes/ReleaseNotes-2.11.1.txt index 6b0b3f2705..f07f91dbcf 100644 --- a/ReleaseNotes/ReleaseNotes-2.11.1.txt +++ b/ReleaseNotes/ReleaseNotes-2.11.1.txt @@ -19,7 +19,7 @@ New Features * link:http://code.google.com/p/gerrit/issues/detail?id=321[Issue 321]: Use in-memory Lucene index for a better reviewer suggestion. + -Instead of a linear full text search through a list of accounts use an +Instead of a linear full text search through a list of accounts, use an in-memory Lucene index. The index is periodically refreshed. The refresh period is configurable via the link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.11.1/config-gerrit.html#suggest.fullTextSearchRefresh[ @@ -29,7 +29,7 @@ suggest.fullTextSearchRefresh] parameter. Bug Fixes --------- -* Fix PatchLineCommentsUtil.draftByChangeAuthor. +* Fix `PatchLineCommentsUtil.draftByChangeAuthor`. + There is not a native index for this, and the ReviewDb case was not properly filtering a result by change. @@ -53,7 +53,7 @@ was not becoming owner of the created project, because only project owners can edit the `project.config` file. * link:http://code.google.com/p/gerrit/issues/detail?id=3342[Issue 3342]: -Log IOExceptions on failure to update project configuration. +Log `IOException` on failure to update project configuration. + Without logging these exceptions it's hard to guess why the update of the project configuration is failing. @@ -61,23 +61,38 @@ project configuration is failing. * Don't show stack trace when failing to build BloomFilter during reindex. * link:http://code.google.com/p/gerrit/issues/detail?id=3337[Issue 3337]: -Reenable revert button when revert is cancelled. +Reenable 'Revert' button when revert is cancelled. * link:http://code.google.com/p/gerrit/issues/detail?id=3325[Issue 3325]: Add missing `--newrev` parameter to the link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.11.1/config-hooks.html#_change_merged[ change-merged hook documentation]. -* Fix gc_log when running in a web container. +* Fix `gc_log` when running in a web container. + -All logs supposed to be in gc_log file were ending up in main log instead when -deploying Gerrit in a web container. +All logs supposed to be in the `gc_log` file were ending up in the main log +instead when deploying Gerrit in a web container. + +* link:http://code.google.com/p/gerrit/issues/detail?id=3310[Issue 3310]: +Fix disabling plugins when Gerrit is running on Windows. ++ +When running Gerrit on Windows it was not possible to disable a plugin due to an +error renaming the plugin's JAR file. + +* Remove temporary GitWeb config on Gerrit exit. ++ +A temporary directory was being created but not removed. * link:http://code.google.com/p/gerrit/issues/detail?id=3346[Issue 3346]: Fix typo in the link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.11.1/config-reverseproxy.html[ Apache 2 configuration documentation]. +* link:http://code.google.com/p/gerrit/issues/detail?id=3346[Issue 3346]: +Fix incorrect documentatation of +link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.11.1/config-gerrit.html#auth.registerUrl[ +auth types]. + Updates ------- From bf2f738f07336e862fedd8f675004997f4998d8d Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Thu, 7 May 2015 11:53:51 -0700 Subject: [PATCH 05/19] Remove StoredValues.PATCH_SET Like the change, this can be inferred from the CHANGE_DATA. This allows for lazy loading when the patch set is not needed by the submit rules. Change-Id: I8ca79803763d3ba6ed3344220f1df1e61758a3e3 --- .../java/com/google/gerrit/rules/StoredValues.java | 14 +++++++++++--- .../gerrit/server/project/SubmitRuleEvaluator.java | 1 - 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/rules/StoredValues.java b/gerrit-server/src/main/java/com/google/gerrit/rules/StoredValues.java index 528fcc632e..6136742a6c 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/rules/StoredValues.java +++ b/gerrit-server/src/main/java/com/google/gerrit/rules/StoredValues.java @@ -50,7 +50,6 @@ import java.util.Map; public final class StoredValues { public static final StoredValue REVIEW_DB = create(ReviewDb.class); public static final StoredValue CHANGE_DATA = create(ChangeData.class); - public static final StoredValue PATCH_SET = create(PatchSet.class); // Note: no guarantees are made about the user passed in the ChangeControl; do // not depend on this directly. Either use .forUser(otherUser) to get a @@ -68,11 +67,20 @@ public final class StoredValues { } } + public static PatchSet getPatchSet(Prolog engine) throws SystemException { + ChangeData cd = CHANGE_DATA.get(engine); + try { + return cd.currentPatchSet(); + } catch (OrmException e) { + throw new SystemException(e.getMessage()); + } + } + public static final StoredValue PATCH_SET_INFO = new StoredValue() { @Override public PatchSetInfo createValue(Prolog engine) { Change change = getChange(engine); - PatchSet ps = StoredValues.PATCH_SET.get(engine); + PatchSet ps = getPatchSet(engine); PrologEnvironment env = (PrologEnvironment) engine.control; PatchSetInfoFactory patchInfoFactory = env.getArgs().getPatchSetInfoFactory(); @@ -88,7 +96,7 @@ public final class StoredValues { @Override public PatchList createValue(Prolog engine) { PrologEnvironment env = (PrologEnvironment) engine.control; - PatchSet ps = StoredValues.PATCH_SET.get(engine); + PatchSet ps = getPatchSet(engine); PatchListCache plCache = env.getArgs().getPatchListCache(); Change change = getChange(engine); Project.NameKey projectKey = change.getProject(); diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/SubmitRuleEvaluator.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/SubmitRuleEvaluator.java index cada996cbf..60e59b5702 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/SubmitRuleEvaluator.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/SubmitRuleEvaluator.java @@ -517,7 +517,6 @@ public class SubmitRuleEvaluator { } env.set(StoredValues.REVIEW_DB, cd.db()); env.set(StoredValues.CHANGE_DATA, cd); - env.set(StoredValues.PATCH_SET, patchSet); env.set(StoredValues.CHANGE_CONTROL, control); if (user != null) { env.set(StoredValues.CURRENT_USER, user); From a031b8063ecd03f10f8b40b84ca7deb41de1d8a8 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Thu, 7 May 2015 11:54:55 -0700 Subject: [PATCH 06/19] ChangeJson: Eliminate patch set loading in search results Normal search results do not require patch sets, since they do not set any REVISIONS or MESSAGES options. (The exception is the My Changes dashboard, which needs messages to determine whether to bold changes.) They do need to evaluate submit rules, but the only thing the SubmitRuleEvaluator needs the patch set object for is to check if it is a draft. If drafts are allowed, which is the case in ChangeJson, it doesn't need the patch set at all. Change-Id: Ia4bb97abb79e7552ac4086b00ede5962d9f1bc6a --- .../gerrit/server/change/ChangeJson.java | 23 ++++++++++-------- .../server/project/SubmitRuleEvaluator.java | 24 ++++++++++--------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java index 828085b3e5..240c9a0305 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java @@ -396,15 +396,22 @@ public class ChangeJson { out.removableReviewers = removableReviewers(ctl, out.labels.values()); } - Map src = loadPatchSets(cd, limitToPsId); - if (has(MESSAGES)) { + boolean needMessages = has(MESSAGES); + boolean needRevisions = has(ALL_REVISIONS) + || has(CURRENT_REVISION) + || limitToPsId.isPresent(); + Map src; + if (needMessages || needRevisions) { + src = loadPatchSets(cd, limitToPsId); + } else { + src = null; + } + if (needMessages) { out.messages = messages(ctl, cd, src); } finish(out); - if (has(ALL_REVISIONS) - || has(CURRENT_REVISION) - || limitToPsId.isPresent()) { + if (needRevisions) { out.revisions = revisions(ctl, cd, src); if (out.revisions != null) { for (Map.Entry entry : out.revisions.entrySet()) { @@ -427,11 +434,7 @@ public class ChangeJson { if (cd.getSubmitRecords() != null) { return cd.getSubmitRecords(); } - PatchSet ps = cd.currentPatchSet(); - if (ps == null) { - return ImmutableList.of(); - } - cd.setSubmitRecords(new SubmitRuleEvaluator(cd).setPatchSet(ps) + cd.setSubmitRecords(new SubmitRuleEvaluator(cd) .setFastEvalLabels(true) .setAllowDraft(true) .evaluate()); diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/SubmitRuleEvaluator.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/SubmitRuleEvaluator.java index 60e59b5702..4df9831434 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/SubmitRuleEvaluator.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/SubmitRuleEvaluator.java @@ -196,21 +196,25 @@ public class SubmitRuleEvaluator { * rules, including any errors. */ public List evaluate() { - try { - initPatchSet(); - } catch (OrmException e) { - return ruleError("Error looking up patch set " - + control.getChange().currentPatchSetId()); - } Change c = control.getChange(); if (!allowClosed && c.getStatus().isClosed()) { SubmitRecord rec = new SubmitRecord(); rec.status = SubmitRecord.Status.CLOSED; return Collections.singletonList(rec); } - if ((c.getStatus() == Change.Status.DRAFT || patchSet.isDraft()) - && !allowDraft) { - return cannotSubmitDraft(); + if (!allowDraft) { + if (c.getStatus() == Change.Status.DRAFT) { + return cannotSubmitDraft(); + } + try { + initPatchSet(); + } catch (OrmException e) { + return ruleError("Error looking up patch set " + + control.getChange().currentPatchSetId()); + } + if (patchSet.isDraft()) { + return cannotSubmitDraft(); + } } List results; @@ -500,8 +504,6 @@ public class SubmitRuleEvaluator { private PrologEnvironment getPrologEnvironment(CurrentUser user) throws RuleEvalException { - checkState(patchSet != null, - "getPrologEnvironment() called before initPatchSet()"); ProjectState projectState = control.getProjectControl().getProjectState(); PrologEnvironment env; try { From 92c3fd88aaba6851e4599083cb1b1a9c634cbbe9 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Thu, 7 May 2015 11:26:09 -0700 Subject: [PATCH 07/19] ChangeJson: Less eager loading of patch sets Normal search results do not include the MESSAGES or any REVISION options, so they should not need to load the current revision from the PatchSets table (assuming mergeability cache hits). This was just wasted DB access, accounting for up to 20% of query traffic. Change-Id: I641d4af1a71391bcd18ded838224d7a3ee3f57d7 --- .../main/java/com/google/gerrit/server/change/ChangeJson.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java index 240c9a0305..181742f5b4 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java @@ -264,7 +264,7 @@ public class ChangeJson { ChangeData.ensureChangeLoaded(all); if (has(ALL_REVISIONS)) { ChangeData.ensureAllPatchSetsLoaded(all); - } else { + } else if (has(CURRENT_REVISION) || has(MESSAGES)) { ChangeData.ensureCurrentPatchSetLoaded(all); } Set reviewed = Sets.newHashSet(); From 735f899c6b1a87387271959c46dfea6bbafcc196 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Thu, 7 May 2015 12:33:47 -0700 Subject: [PATCH 08/19] ChangeJson: Don't load all approvals on closed changes Only current approvals come from the index, so loading all approvals requires an additional database lookup. In the case of search results, we don't need DETAILED_LABELS, so we don't need to look up all reviewers. Change-Id: Id249ee8b0fb8d900c616ad87d28cda49f84a109a --- .../com/google/gerrit/server/change/ChangeJson.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java index 181742f5b4..4bcc82e2d4 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ChangeJson.java @@ -595,8 +595,14 @@ public class ChangeJson { LabelTypes labelTypes, boolean standard, boolean detailed) throws OrmException { Set allUsers = Sets.newHashSet(); - for (PatchSetApproval psa : cd.approvals().values()) { - allUsers.add(psa.getAccountId()); + if (detailed) { + // Users expect to see all reviewers on closed changes, even if they + // didn't vote on the latest patch set. If we don't need detailed labels, + // we aren't including 0 votes for all users below, so we can just look at + // the latest patch set (in the next loop). + for (PatchSetApproval psa : cd.approvals().values()) { + allUsers.add(psa.getAccountId()); + } } // We can only approximately reconstruct what the submit rule evaluator @@ -604,6 +610,7 @@ public class ChangeJson { Set labelNames = Sets.newHashSet(); Multimap current = HashMultimap.create(); for (PatchSetApproval a : cd.currentApprovals()) { + allUsers.add(a.getAccountId()); LabelType type = labelTypes.byLabel(a.getLabelId()); if (type != null) { labelNames.add(type.getName()); From 34f784afb78251cb229a4d4050d767a24ae5b8fc Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 12 May 2015 14:02:41 +0900 Subject: [PATCH 09/19] Fix minor typo in set-account command documentation Change-Id: Ie9eea20385f96dc53e4435e4b33d882f23ba5ae4 --- Documentation/cmd-set-account.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/cmd-set-account.txt b/Documentation/cmd-set-account.txt index f31f61b169..8fb8e0d6ab 100644 --- a/Documentation/cmd-set-account.txt +++ b/Documentation/cmd-set-account.txt @@ -65,7 +65,7 @@ This most likely requires double quoting the value, for example Delete an email from this user's account if it exists. If the email provided is 'ALL', all associated emails are deleted from this account. - Maybe supplied more than once to remove multiple emails + May be supplied more than once to remove multiple emails from an account in a single command execution. --preferred-email:: From 1c0c980c4dd9376be018881b87fdb308c009bd50 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Wed, 13 May 2015 06:51:55 +0200 Subject: [PATCH 10/19] Batch index executor: Don't fall back to interactive executor Since I88ae7f4a background mergeability checks were replaced with reindexing. To determine the executor for the batch reindexing, a number of valid and deprecated configuration options are used. When none of these options are set batch reindexing is falling back to use the interactive executor. This logic leads to severe performance degradation during git push operation because ref-update listener is reindexing all open changes on the target branch interactively. This degradation increases linearly with number of open changes on the target branch. Instead of falling back performing the batch reindexing operation interactively, use batch thread pool with logical number of CPU cores. Bug: issue 3363 Change-Id: I6890c4285a13683c050e7500bea5deb2dc50b6e0 --- Documentation/config-gerrit.txt | 4 ++-- .../main/java/com/google/gerrit/server/index/IndexModule.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index 85b4adb2bb..da93ea4c31 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -2152,8 +2152,8 @@ is iset). Number of threads to use for indexing in background operations, such as online schema upgrades. + -If not set or set to a negative value, defaults to using the same -thread pool as interactive operations (unless +If not set or set to a negative value, defaults to logical number of CPU +cores as returned by the JVM (unless link:#changeMerge.threadPoolSize[changeMerge.threadPoolSize] is set). ==== Lucene configuration diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/index/IndexModule.java b/gerrit-server/src/main/java/com/google/gerrit/server/index/IndexModule.java index 41df287e9f..0cfc6599e3 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/index/IndexModule.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/index/IndexModule.java @@ -114,7 +114,6 @@ public class IndexModule extends LifecycleModule { @Singleton @IndexExecutor(BATCH) ListeningExecutorService getBatchIndexExecutor( - @IndexExecutor(INTERACTIVE) ListeningExecutorService interactive, @GerritServerConfig Config config, WorkQueue workQueue) { if (batchExecutor != null) { @@ -125,7 +124,7 @@ public class IndexModule extends LifecycleModule { threads = config.getInt("changeMerge", null, "threadPoolSize", 0); } if (threads <= 0) { - return interactive; + threads = Runtime.getRuntime().availableProcessors(); } return MoreExecutors.listeningDecorator( workQueue.createQueue(threads, "Index-Batch")); From c3bc589e29861c00e6c7da63d108de7a9f52eb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Ar=C3=A8s?= Date: Wed, 13 May 2015 14:47:10 -0400 Subject: [PATCH 11/19] Always add SecureStore module in WebAppInitializer SecureStore module was only added when gerrit_site is found in the database, not when it's specified as a system property. This was causing Gerrit initialization error[1] when deploying in a web container and configuring the site using gerrit.site_path property. [1] https://groups.google.com/forum/#!topic/repo-discuss/oW7i93mZhRo Change-Id: Ib723f1c37071142048f30585ab8e7a298c37664e --- .../main/java/com/google/gerrit/httpd/WebAppInitializer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java b/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java index 4e2365cb87..b365e76ff6 100644 --- a/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java +++ b/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java @@ -210,6 +210,7 @@ public class WebAppInitializer extends GuiceServletContextListener private Injector createDbInjector() { final List modules = new ArrayList<>(); AbstractModule secureStore = createSecureStoreModule(); + modules.add(secureStore); if (sitePath != null) { Module sitePathModule = new AbstractModule() { @Override @@ -243,7 +244,6 @@ public class WebAppInitializer extends GuiceServletContextListener }); } else { - modules.add(secureStore); modules.add(new LifecycleModule() { @Override protected void configure() { From bb3dd490cde7a4daae021b36aadfc40550be70fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Ar=C3=A8s?= Date: Fri, 15 May 2015 08:56:46 -0400 Subject: [PATCH 12/19] Upgrade replication plugin * Fix creation of missing repositories Change-Id: Id60455437b5ed75deafe284f2fb0ceaa381af116 --- plugins/replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/replication b/plugins/replication index 1fc7654ab8..604b3396a7 160000 --- a/plugins/replication +++ b/plugins/replication @@ -1 +1 @@ -Subproject commit 1fc7654ab88d138454afbb1f6a11790394f9154d +Subproject commit 604b3396a72461c4554248999b3dadcf620e82a9 From 3f91890e934923b397d63a356a6e30718a7046b2 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 19 May 2015 09:41:02 +0900 Subject: [PATCH 13/19] Prolog-Cookbook: tidy up rule status descriptions Change-Id: I3fef34f837381b046180c04b726add68c865569a --- Documentation/prolog-cookbook.txt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Documentation/prolog-cookbook.txt b/Documentation/prolog-cookbook.txt index 5bff6bfe03..2fedb9ec87 100644 --- a/Documentation/prolog-cookbook.txt +++ b/Documentation/prolog-cookbook.txt @@ -139,15 +139,14 @@ be any other string (see examples below). The `status` is one of: * `ok(user(ID))` or just `ok(_)` if user info is not important. This status is used to tell that this label/category has been met. -* `need(_)` is used to tell that this label/category is needed for change to - become submittable -* `reject(user(ID))` or just `reject(_)`. This status is used to tell that label/category - is blocking change submission -* `impossible(_)` is used when the logic knows that the change cannot be submitted as-is. - Administrative intervention is probably required. This is meant for cases - where the logic requires members of "FooEng" to score "Code-Review +2" on a - change, but nobody is in group "FooEng". It is to hint at permissions - misconfigurations. +* `need(_)` is used to tell that this label/category is needed for the change to + become submittable. +* `reject(user(ID))` or just `reject(_)`. This status is used to tell that this + label/category is blocking submission of the change. +* `impossible(_)` is used when the logic knows that the change cannot be submitted + as-is. This is meant for cases where the logic requires members of a specific + group to apply a specific label on a change, but no users are in that group. + This is usually caused by misconfiguration of permissions. * `may(_)` allows expression of approval categories that are optional, i.e. could either be set or unset without ever influencing whether the change could be submitted. From 1ff91c0d8213472aa8ff6e8db80f18043c7f86df Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 19 May 2015 15:05:26 +0900 Subject: [PATCH 14/19] Fix various spelling mistakes Change-Id: I5fb811eab02d48a649990c6418977915c7dd7430 --- Documentation/access-control.txt | 2 +- Documentation/config-gerrit.txt | 2 +- Documentation/dev-inspector.txt | 2 +- ReleaseNotes/ReleaseNotes-2.10.1.txt | 2 +- ReleaseNotes/ReleaseNotes-2.10.3.txt | 2 +- ReleaseNotes/ReleaseNotes-2.10.4.txt | 2 +- ReleaseNotes/ReleaseNotes-2.5.txt | 4 ++-- ReleaseNotes/ReleaseNotes-2.8.txt | 2 +- .../java/com/google/gerrit/client/ui/OnEditEnabler.java | 2 +- .../main/java/com/google/gerrit/pgm/shell/JythonShell.java | 6 +++--- .../java/com/google/gerrit/server/project/ProjectCache.java | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Documentation/access-control.txt b/Documentation/access-control.txt index fce3f763f0..909f972ecd 100644 --- a/Documentation/access-control.txt +++ b/Documentation/access-control.txt @@ -864,7 +864,7 @@ Suggested access rights to grant: If it's desired to have the possibility to upload temporarily hidden changes there's a specific permission for that. This enables someone to add specific reviewers for early feedback before making the change -publically visible. If you want to allow others than the owners to +publicly visible. If you want to allow others than the owners to publish a draft you also need to grant them `Publish Drafts`. Optional access rights to grant: diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt index 5b1817a843..632965fd63 100644 --- a/Documentation/config-gerrit.txt +++ b/Documentation/config-gerrit.txt @@ -1113,7 +1113,7 @@ much more predictable behavior. Size of the buffer to store logging events for asynchronous logging. Putting a larger value can protect threads from stalling when the AsyncAppender threads are not fast enough to consume the logging events -from the buffer. It also protects from loosing log entries in this case. +from the buffer. It also protects from losing log entries in this case. + Default is 64 entries. diff --git a/Documentation/dev-inspector.txt b/Documentation/dev-inspector.txt index 2d56283c19..7c13a7defd 100644 --- a/Documentation/dev-inspector.txt +++ b/Documentation/dev-inspector.txt @@ -240,7 +240,7 @@ to the error log: ---- [2012-04-17 14:20:30,558] INFO com.google.gerrit.pgm.shell.JythonShell : Jython shell instance created. -[2012-04-17 14:20:38,005] ERROR com.google.gerrit.pgm.shell.JythonShell : Exception occured while loading file Startup.py : +[2012-04-17 14:20:38,005] ERROR com.google.gerrit.pgm.shell.JythonShell : Exception occurred while loading file Startup.py : java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) diff --git a/ReleaseNotes/ReleaseNotes-2.10.1.txt b/ReleaseNotes/ReleaseNotes-2.10.1.txt index 6ef90737c1..df70b64e43 100644 --- a/ReleaseNotes/ReleaseNotes-2.10.1.txt +++ b/ReleaseNotes/ReleaseNotes-2.10.1.txt @@ -23,7 +23,7 @@ LDAP ---- * Several performance improvements when using LDAP, both in the number of LDAP -requests and in the amount of data transfered. +requests and in the amount of data transferred. * Sites using LDAP for authentication but otherwise rely on local Gerrit groups should set the new `ldap.fetchMemberOfEagerly` option to `false`. diff --git a/ReleaseNotes/ReleaseNotes-2.10.3.txt b/ReleaseNotes/ReleaseNotes-2.10.3.txt index 578a1ae5eb..052840d6ad 100644 --- a/ReleaseNotes/ReleaseNotes-2.10.3.txt +++ b/ReleaseNotes/ReleaseNotes-2.10.3.txt @@ -33,7 +33,7 @@ New Features + OpenID auth scheme is aware of optional OAuth2 plugin-based authentication. This feature is considered to be experimental and hasn't reached full feature set yet. -Particularly, linking of user identities accross protocol boundaries and even from +Particularly, linking of user identities across protocol boundaries and even from one OAuth2 identity to another OAuth2 identity wasn't implemented yet. Configuration diff --git a/ReleaseNotes/ReleaseNotes-2.10.4.txt b/ReleaseNotes/ReleaseNotes-2.10.4.txt index 7de3f418ae..e221549c31 100644 --- a/ReleaseNotes/ReleaseNotes-2.10.4.txt +++ b/ReleaseNotes/ReleaseNotes-2.10.4.txt @@ -12,7 +12,7 @@ New Features * Support identity linking in hybrid OpenID and OAuth2 authentication. + -Linking of user identities accross protocol boundaries and from one OAuth2 +Linking of user identities across protocol boundaries and from one OAuth2 identity to another OAuth2 identity is supported. * Support identity linking in OAuth2 extension point. diff --git a/ReleaseNotes/ReleaseNotes-2.5.txt b/ReleaseNotes/ReleaseNotes-2.5.txt index cdef554dd9..4abed47f3f 100644 --- a/ReleaseNotes/ReleaseNotes-2.5.txt +++ b/ReleaseNotes/ReleaseNotes-2.5.txt @@ -923,11 +923,11 @@ Eclipse 3 writes a timestamp at the top of these files making the Git working tree dirty. Eclipse 4 (Juno) still overwrites these files but doesn't write the timestamp. This should help to keep the working tree clean. However, since the timestamp is currently present in these -files, Eclispe 4 would still make them dirty by overwriting and +files, Eclipse 4 would still make them dirty by overwriting and effectively removing the timestamp. + This change removes the timestamp from these files. This helps those -using Eclipse 4 and doesn't make it worse for those still using Eclispe +using Eclipse 4 and doesn't make it worse for those still using Eclipse 3. * Add Maven profile to skip build of plugin modules diff --git a/ReleaseNotes/ReleaseNotes-2.8.txt b/ReleaseNotes/ReleaseNotes-2.8.txt index bc854a2ba6..92cdda2a0e 100644 --- a/ReleaseNotes/ReleaseNotes-2.8.txt +++ b/ReleaseNotes/ReleaseNotes-2.8.txt @@ -625,7 +625,7 @@ Configuration * Do not persist default project state in `project.config`. -* Honor the `gerrit.cannonicalWebUrl` setting when opening the browser after init. +* Honor the `gerrit.canonicalWebUrl` setting when opening the browser after init. * Fix 'query disabled' error when Query Limit is set. diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/OnEditEnabler.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/OnEditEnabler.java index a2155d4ef4..819a11ff99 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/OnEditEnabler.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/OnEditEnabler.java @@ -87,7 +87,7 @@ public class OnEditEnabler implements KeyPressHandler, KeyDownHandler, // Resetting the "original text" on focus ensures that we are // up to date with non-user updates of the text (calls to // setText()...) and also up to date with user changes which - // occured after enabling "widget". + // occurred after enabling "widget". tb.addFocusHandler(new FocusHandler() { @Override public void onFocus(FocusEvent event) { diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/shell/JythonShell.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/shell/JythonShell.java index 5b537ae297..6efda29b2d 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/shell/JythonShell.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/shell/JythonShell.java @@ -191,9 +191,9 @@ public class JythonShell { + " is not found or not executable"); } } catch (InvocationTargetException e) { - log.error("Exception occured while loading file " + p + " : ", e); + log.error("Exception occurred while loading file " + p + " : ", e); } catch (SecurityException e) { - log.error("SecurityException occured while loading file " + p + " : ", e); + log.error("SecurityException occurred while loading file " + p + " : ", e); } } @@ -204,7 +204,7 @@ public class JythonShell { new Object[] { in, p } ); } catch (InvocationTargetException e) { - log.error("Exception occured while loading " + p + " : ", e); + log.error("Exception occurred while loading " + p + " : ", e); } } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectCache.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectCache.java index fdff1e71a3..d451b46030 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectCache.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/ProjectCache.java @@ -32,7 +32,7 @@ public interface ProjectCache { * Get the cached data for a project by its unique name. * * @param projectName name of the project. - * @return the cached data; null if no such project exists or a error occured. + * @return the cached data; null if no such project exists or a error occurred. * @see #checkedGet(com.google.gerrit.reviewdb.client.Project.NameKey) */ public ProjectState get(Project.NameKey projectName); From 56fbc0845b581beafbb247ca86a477421aca60a2 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 19 May 2015 16:33:03 +0900 Subject: [PATCH 15/19] rest-api-changes.txt: fix minor spelling mistake Change-Id: Ibccf496050b5561196fe2f7ca51028fe0099b682 --- Documentation/rest-api-changes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/rest-api-changes.txt b/Documentation/rest-api-changes.txt index 8c10bc7bbc..1b9a705886 100644 --- a/Documentation/rest-api-changes.txt +++ b/Documentation/rest-api-changes.txt @@ -1577,7 +1577,7 @@ Rebases change edit on top of latest patch set. ---- When change was rebased on top of latest patch set, response -"`204 No Content`" is returned. When change edit is aready +"`204 No Content`" is returned. When change edit is already based on top of the latest patch set, the response "`409 Conflict`" is returned. From 0b4b54bde073da303ff7b7c90d5741f9c86562a5 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 19 May 2015 16:49:46 +0900 Subject: [PATCH 16/19] Update replication plugin * Emit replication status events after initial full sync Change-Id: I85cc92eda035fb7dedc84cb23240b747e02c85c3 --- plugins/replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/replication b/plugins/replication index 604b3396a7..53ee1b8ec4 160000 --- a/plugins/replication +++ b/plugins/replication @@ -1 +1 @@ -Subproject commit 604b3396a72461c4554248999b3dadcf620e82a9 +Subproject commit 53ee1b8ec4de5de4d710233eda2230b5380f1390 From 37bdd2e7230e328573b5bc01563bc37605ce7709 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 15 May 2015 11:34:03 +0900 Subject: [PATCH 17/19] Update 2.11.1 release notes Change-Id: Ib1b8e76cf27855f0dd923c8ff64cfc208d6fee2d --- ReleaseNotes/ReleaseNotes-2.11.1.txt | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ReleaseNotes/ReleaseNotes-2.11.1.txt b/ReleaseNotes/ReleaseNotes-2.11.1.txt index f07f91dbcf..eab6d601b5 100644 --- a/ReleaseNotes/ReleaseNotes-2.11.1.txt +++ b/ReleaseNotes/ReleaseNotes-2.11.1.txt @@ -29,6 +29,26 @@ suggest.fullTextSearchRefresh] parameter. Bug Fixes --------- +* link:http://code.google.com/p/gerrit/issues/detail?id=3363[Issue 3363]: +Fix performance degrade in background mergeability checks. ++ +When neither `index.batchThreads` nor `changeMerge.threadPoolSize` was defined, +the background mergeability check fell back to using an interactive executor. ++ +This led to a severe performance degradation during git push operations because +the `ref-update` listener was reindexing all open changes on the target branch +interactively. The degradation increased linearly with number of open changes on +the target branch. ++ +Now, instead of indexing interactively, it falls back to a batch thread pool +with the logical number of available CPUs. + +* Reduce unnecessary database access when queryng changes. ++ +Searching for changes was retrieving more information than necessary from the +database. This has been optimized to reduce database access and make better use +of the secondary index. + * Fix `PatchLineCommentsUtil.draftByChangeAuthor`. + There is not a native index for this, and the ReviewDb case was not properly @@ -73,6 +93,12 @@ change-merged hook documentation]. All logs supposed to be in the `gc_log` file were ending up in the main log instead when deploying Gerrit in a web container. +* Fix binding of SecureStore modules. ++ +The SecureStore modules were not correctly added when Gerrit was deployed in a +web container with the site path configured using the `gerrit.site_path` +property. + * link:http://code.google.com/p/gerrit/issues/detail?id=3310[Issue 3310]: Fix disabling plugins when Gerrit is running on Windows. + @@ -93,6 +119,17 @@ Fix incorrect documentatation of link:https://gerrit-documentation.storage.googleapis.com/Documentation/2.11.1/config-gerrit.html#auth.registerUrl[ auth types]. +* Replication plugin + +** Fix creation of missing repositories. ++ +Missing projects were not being created on the destination. + +** Emit replication status events after initial full sync. ++ +When `replicateOnStartup` is enabled, the plugin was not emitting the status +events after the initial sync. + Updates ------- From dd47950027c006a9d92cf8d5e9db81b5ed4f3c5d Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 19 May 2015 07:43:50 +0200 Subject: [PATCH 18/19] Restore default Codemirror cursor style Some users found current cursor form underscore confusing. Restore the default cursor form vertical bar from codemirror.css style but make it thicker: 2px instead of 1px. fat-cursor style seems to be unused in overloaded vim_ro key map, delete it entirely. It worth noting that this and other parts of the UI should be configurable. Current Gerrit approach for UI configuration doesn't scale well, as it's stored in the database with column per configuration option. After converting of persistence of user configuration backend to All-Users git repository we may reconsider to make this and other parts of the UI configurable. Bug: issue 3378 Change-Id: I0dadeb87f35cb64c178917aa56bcdda3defb8c57 --- .../google/gerrit/client/diff/DiffTable.ui.xml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/DiffTable.ui.xml b/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/DiffTable.ui.xml index 60e8e0d383..504d9c077f 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/DiffTable.ui.xml +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/DiffTable.ui.xml @@ -22,7 +22,7 @@ limitations under the License. @external .CodeMirror-linenumber; @external .CodeMirror-overlayscroll-vertical, .CodeMirror-scroll; @external .CodeMirror-dialog-bottom; - @external .cm-animate-fat-cursor, .CodeMirror-cursor; + @external .CodeMirror-cursor; .fullscreen { background-color: #f7f7f7; @@ -116,18 +116,7 @@ limitations under the License. cursor: pointer; } .difftable .CodeMirror div.CodeMirror-cursor { - background: transparent; - text-decoration: underline; - border: none; - z-index: 2; - } - .difftable .cm-animate-fat-cursor { - text-decoration: underline; - border: none; - animation: none; - -webkit-animation: none; - -moz-animation: none; - -o-animation: none; + border-left: 2px solid black; } .difftable .CodeMirror-dialog-bottom { border-top: 0; From 5ac80fd93799ac8a95dd90bbf972ce07b699804f Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 19 May 2015 08:09:21 +0200 Subject: [PATCH 19/19] Position cursor on first column on diff chunk navigation Navigation by clicking on the scroll bar still positions the cursor on the last column. Only initial position and navigation per keys 'p' and 'n' is changed. Change-Id: I968171ed1293d722c07f816e3c4a154d23cdac7a --- .../main/java/com/google/gerrit/client/diff/ChunkManager.java | 2 +- gerrit-gwtui/src/main/java/net/codemirror/lib/CodeMirror.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/ChunkManager.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/ChunkManager.java index 4420940b17..fed8f9186c 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/ChunkManager.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/diff/ChunkManager.java @@ -317,7 +317,7 @@ class ChunkManager { DiffChunkInfo target = chunks.get(res); CodeMirror targetCm = host.getCmFromSide(target.getSide()); - targetCm.setCursor(Pos.create(target.getStart())); + targetCm.setCursor(Pos.create(target.getStart(), 0)); targetCm.focus(); targetCm.scrollToY( targetCm.heightAtLine(target.getStart(), "local") - diff --git a/gerrit-gwtui/src/main/java/net/codemirror/lib/CodeMirror.java b/gerrit-gwtui/src/main/java/net/codemirror/lib/CodeMirror.java index fc215324e7..1c9ad3c72f 100644 --- a/gerrit-gwtui/src/main/java/net/codemirror/lib/CodeMirror.java +++ b/gerrit-gwtui/src/main/java/net/codemirror/lib/CodeMirror.java @@ -204,7 +204,7 @@ public class CodeMirror extends JavaScriptObject { if (lineAtHeight(height - 20) < line) { scrollToY(heightAtLine(line, "local") - 0.5 * height); } - setCursor(Pos.create(line)); + setCursor(Pos.create(line, 0)); } public final native ScrollInfo getScrollInfo() /*-{