From 9c6358829d43f96a145be9832c27257e947a25c9 Mon Sep 17 00:00:00 2001 From: Lucas Bader Date: Mon, 9 Mar 2020 15:06:21 +0100 Subject: [PATCH 01/10] Add prolog predicate to determine number of parents This change introduces a new prolog predicate for the number of parents of a given patch set. This can be used to determine from within the "rules.pl" file whether a change is a merge commit or not. This can be useful in order to evaluate a different set of submit rules for merge commits. Example usage: submit_rule(submit(Parents)) :- Parents = label('Is-Merge', need(_)). submit_rule(submit(Parents)) :- gerrit:commit_parent_count(A), A > 1, Parents = label('Is-Merge', ok(user(ID))). Change-Id: I306163510e201606e936d95caea5ffa0bb957236 --- java/gerrit/PRED_commit_parent_count_1.java | 51 +++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 java/gerrit/PRED_commit_parent_count_1.java diff --git a/java/gerrit/PRED_commit_parent_count_1.java b/java/gerrit/PRED_commit_parent_count_1.java new file mode 100644 index 0000000000..81589dd8eb --- /dev/null +++ b/java/gerrit/PRED_commit_parent_count_1.java @@ -0,0 +1,51 @@ +// Copyright (C) 2020 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gerrit; + +import com.google.gerrit.server.rules.StoredValues; +import com.googlecode.prolog_cafe.exceptions.PrologException; +import com.googlecode.prolog_cafe.lang.IntegerTerm; +import com.googlecode.prolog_cafe.lang.Operation; +import com.googlecode.prolog_cafe.lang.Predicate; +import com.googlecode.prolog_cafe.lang.Prolog; +import com.googlecode.prolog_cafe.lang.Term; +import org.eclipse.jgit.revwalk.RevCommit; + +/** + * Prolog fact for the number of parents of a given commit + * + *
+ *   'commit_parent_count'(-Count)
+ * 
+ */ +public class PRED_commit_parent_count_1 extends Predicate.P1 { + public PRED_commit_parent_count_1(Term a1, Operation n) { + arg1 = a1; + cont = n; + } + + @Override + public Operation exec(Prolog engine) throws PrologException { + engine.setB0(); + Term a1 = arg1.dereference(); + + RevCommit commit = StoredValues.COMMIT.get(engine); + + if (!a1.unify(new IntegerTerm(commit.getParentCount()), engine.trail)) { + return engine.fail(); + } + return cont; + } +} From a1e4c41053dba7dbb1d5330f69d53723fa78abb7 Mon Sep 17 00:00:00 2001 From: Lucas Bader Date: Wed, 11 Mar 2020 07:49:50 +0100 Subject: [PATCH 02/10] Add new prolog fact to documentation Documentation for the prolog fact added with [1]. [1] https://gerrit-review.googlesource.com/c/gerrit/+/258270 Change-Id: Ie0d357eb0d0a11c979ca7dd3fdbad99b6e70b605 (cherry picked from commit 8e6c5a5ab75584c1f566d34d48344a8b9a74ea4b) --- Documentation/prolog-change-facts.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/prolog-change-facts.txt b/Documentation/prolog-change-facts.txt index 2fb13e918a..ac69616c43 100644 --- a/Documentation/prolog-change-facts.txt +++ b/Documentation/prolog-change-facts.txt @@ -48,6 +48,9 @@ of them we must use a qualified name like `gerrit:change_branch(X)`. |`commit_message/1` |`commit_message('Fix bug X').` |Commit message as string atom +|`commit_parent_count/1` |`commit_parent_count(1).` + |Number of parent commits of a commit. Can be used to detect merge commits + |`commit_stats/3` |`commit_stats(5,20,50).` |Number of files modified, number of insertions and the number of deletions. From fda98653f1528a9b4d673bdafec950a2be7f548c Mon Sep 17 00:00:00 2001 From: Marco Miller Date: Mon, 9 Mar 2020 14:13:23 -0400 Subject: [PATCH 03/10] ElasticContainer: Upgrade V6_8 to elasticsearch 6.8.7 Change-Id: Id45df2b9e79a417a0782c1ee9d8b3aa6dfc95cc1 --- javatests/com/google/gerrit/elasticsearch/ElasticContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java b/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java index 96041a14aa..dd3e36478d 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java @@ -53,7 +53,7 @@ public class ElasticContainer extends ElasticsearchContainer { case V6_7: return "blacktop/elasticsearch:6.7.2"; case V6_8: - return "blacktop/elasticsearch:6.8.6"; + return "blacktop/elasticsearch:6.8.7"; case V7_0: return "blacktop/elasticsearch:7.0.1"; case V7_1: From c1cf3fdee538993b5c9ae627b18ac2f971ab7d38 Mon Sep 17 00:00:00 2001 From: Marco Miller Date: Fri, 13 Mar 2020 20:48:05 -0400 Subject: [PATCH 04/10] Update git submodules * Update plugins/replication from branch 'stable-3.0' to 9f08729c294d327ed6ed34f78ca7a6bff5ac4393 - Merge branch 'stable-2.16' into stable-3.0 * stable-2.16: Add method to push changes directly to given replica Adapt the hereby merged UsedAt import addition to the c.g.g.common package, differing from downstream c.g.g.server. Change-Id: Ib630eb2be5a1167fddb949ee464b35bcf3f8db05 - Add method to push changes directly to given replica This makes it possible to push changes directly to given replica instance without sending unnecessary requests to others. The method is intended to be used by other plugins that extend the replication plugin. Change-Id: Ib3e5a6c3afde834855d055b31beb43a560f8d785 Signed-off-by: Dariusz Luksza --- plugins/replication | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/replication b/plugins/replication index 848027a18e..9f08729c29 160000 --- a/plugins/replication +++ b/plugins/replication @@ -1 +1 @@ -Subproject commit 848027a18eb73822584eb658a467715db547574c +Subproject commit 9f08729c294d327ed6ed34f78ca7a6bff5ac4393 From 77e1b0ea679f5218e64dcdf66774fb511dc5fd24 Mon Sep 17 00:00:00 2001 From: Marco Miller Date: Fri, 13 Mar 2020 20:48:27 -0400 Subject: [PATCH 05/10] Update git submodules * Update plugins/webhooks from branch 'stable-3.0' to 8ab0d43b58d1904fa6c9491d040a989692ccf888 - Merge branch 'stable-2.16' into stable-3.0 * stable-2.16: Bump Bazel version to 2.2.0 Bump required Bazel version to 2.1.0 Upgrade bazlets to latest stable-2.16 to build with 2.16.16 API Documentation: Remove bazel issue Documentation: Refactor to match other plugin documentation Documentation: Add missing alternative for plugin in-tree testing Upgrade bazlets to latest stable-2.16 Upgrade bazlets to latest stable-2.16 Upgrade bazlets to latest stable-2.15 Upgrade bazlets to latest stable-2.14 Change-Id: I1458812b7f22229d4dbd2a699d156176a9230fc8 - Bump Bazel version to 2.2.0 Change-Id: I2a2048372aac7faff5a4c4c98439c8fade2ce160 - Bump required Bazel version to 2.1.0 Change-Id: Ida76f406f14466b05533801dc8791c7b31734825 - Upgrade bazlets to latest stable-2.16 to build with 2.16.16 API Change-Id: Id5243ffee55c6999286244af8791615f2458b51f - Documentation: Remove bazel issue Manual testing showed that the issue mention in documentation is no longer present in the current version of bazel. Plugin can be build in tree even after standalone build. The bazel issue was more about running plugin in-tree testing using filter option after building it standalone. Second option of plugin in-tree testing (explicit) doesn't have this issue. So, bazel issue section can be removed as it was addressing plugin build. Change-Id: I4a354a91234f2ab6e9292cd770a693ead5867ed9 - Documentation: Refactor to match other plugin documentation Move in-tree testing section before eclipse-related section for consistency across other plugins and also to match standalone case. Change-Id: I61845b040908ec0938b65f0c3c9d2cc3d51902ba - Documentation: Add missing alternative for plugin in-tree testing Bug: Issue 12096 Change-Id: I30949f8f89f3248384ec6df46f927555dfe70b64 - Upgrade bazlets to latest stable-2.16 As the previously used commit was locally verified but not the one merged in after reviewing. Change-Id: I2e122fe0ee2991509902e4b6e87564baea243bfb - Upgrade bazlets to latest stable-2.16 To use the now mandatory https protocol for MAVEN_CENTRAL. Bug: Issue 12170 Change-Id: I0e76bc33326b2f9acde6e813c0fc2962dc7be822 - Merge branch 'stable-2.15' into stable-2.16 * stable-2.15: Upgrade bazlets to latest stable-2.15 Upgrade bazlets to latest stable-2.14 Change-Id: If3837afa998e66626921a9084dfbcc1630bd6e05 - Upgrade bazlets to latest stable-2.15 To use the now mandatory https protocol for MAVEN_CENTRAL. Bug: Issue 12170 Change-Id: I66937a779741ad9d7f99e766b8c4debf4a904846 - Merge branch 'stable-2.14' into stable-2.15 * stable-2.14: Upgrade bazlets to latest stable-2.14 Change-Id: I118f64d66590bef540cef3cb4376fc1a5242d611 - Upgrade bazlets to latest stable-2.14 To use the now mandatory https protocol for MAVEN_CENTRAL. Bug: Issue 12170 Change-Id: I8334574ebcff093be46b23968055b574364505bb --- plugins/webhooks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/webhooks b/plugins/webhooks index 7d0e904ba6..8ab0d43b58 160000 --- a/plugins/webhooks +++ b/plugins/webhooks @@ -1 +1 @@ -Subproject commit 7d0e904ba6252777e6bc0ece1512da6ad5892461 +Subproject commit 8ab0d43b58d1904fa6c9491d040a989692ccf888 From 7143864bc36ad43a2fb9eba689ec73fc3d6aa75a Mon Sep 17 00:00:00 2001 From: Marco Miller Date: Fri, 13 Mar 2020 20:48:46 -0400 Subject: [PATCH 06/10] Update git submodules * Update plugins/delete-project from branch 'stable-3.0' to e3ce8db351296898f148504e457e919d59275bd6 - Merge branch 'stable-2.16' into stable-3.0 * stable-2.16: Bump Bazel version to 2.2.0 Bump required Bazel version to 2.1.0 Upgrade bazlets to latest stable-2.16 to build with 2.16.16 API Documentation: Refactor to match other plugin documentation Add an empty tools/BUILD file explicitly for Bazel Upgrade bazlets to latest stable-2.16 Upgrade bazlets to latest stable-2.16 Upgrade bazlets to latest stable-2.15 Upgrade bazlets to latest stable-2.14 config.md: Correct formatting of config values Change-Id: I8cc6f59eaf1bc33b9d37b7ec56c74181d9aff4f3 - Bump Bazel version to 2.2.0 Change-Id: I99ff8e092876995f26eafaa9f856b7fb43ab30e9 - Bump required Bazel version to 2.1.0 Change-Id: Ibdf0b58a1681de0eb264a7d1799f2a134c2a83b9 - Upgrade bazlets to latest stable-2.16 to build with 2.16.16 API Change-Id: Ie7cdec72932cf1e1428a7775f9ac4e7e81f60e8a - Documentation: Refactor to match other plugin documentation Replace hard-coded command for plugin in-tree testing. Change-Id: I6b3c561fa1573ac0ab02307abed301a357e1cd2b - Add an empty tools/BUILD file explicitly for Bazel To make sure that all plugins consistently have empty BUILD files within their tools. Change-Id: I0197cbfae340df999cc6aaca826802827fd90e44 - Merge "config.md: Correct formatting of config values" into stable-2.16 - Upgrade bazlets to latest stable-2.16 As the previously used commit was locally verified but not the one merged in after reviewing. Change-Id: I9e8c5233787b539a741b4f529c08674f8707ea74 - Upgrade bazlets to latest stable-2.16 To use the now mandatory https protocol for MAVEN_CENTRAL. Adapt rules_closure consumption. Bug: Issue 12170 Change-Id: Idfdfbf0dc7bc8faa5c1bb562998bdb0b4396fbf7 - Merge branch 'stable-2.15' into stable-2.16 * stable-2.15: Upgrade bazlets to latest stable-2.15 Upgrade bazlets to latest stable-2.14 Change-Id: I72594fb6112f20e89f3f0a159fd9d5f4dbd842ce - Upgrade bazlets to latest stable-2.15 To use the now mandatory https protocol for MAVEN_CENTRAL. Bug: Issue 12170 Change-Id: Id89d93b902c2d056fe675ec1a5db4162ca3bb381 - Merge branch 'stable-2.14' into stable-2.15 * stable-2.14: Upgrade bazlets to latest stable-2.14 Change-Id: I70238ffa74951463a4b99f6806858693125afd46 - Upgrade bazlets to latest stable-2.14 To use the now mandatory https protocol for MAVEN_CENTRAL. Bug: Issue 12170 Change-Id: Ia26b21a828a9d1fa47bef35e6ec82eee41d21357 - config.md: Correct formatting of config values Change-Id: I901be6870c9f995f01711a0ba613f1c95f486721 --- plugins/delete-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/delete-project b/plugins/delete-project index f179a6e0d9..e3ce8db351 160000 --- a/plugins/delete-project +++ b/plugins/delete-project @@ -1 +1 @@ -Subproject commit f179a6e0d9bfdf86ebec2f8e8e25a07f942798b9 +Subproject commit e3ce8db351296898f148504e457e919d59275bd6 From 11f8c479f625c1a726e7a56c4854091783acb275 Mon Sep 17 00:00:00 2001 From: Marco Miller Date: Fri, 13 Mar 2020 20:49:04 -0400 Subject: [PATCH 07/10] Update git submodules * Update plugins/gitiles from branch 'stable-3.0' to 807dc87dfdcd254afc2d0a864a7f543ef8628fcb - Merge branch 'stable-2.16' into stable-3.0 * stable-2.16: Bump Bazel version to 2.2.0 Bump required Bazel version to 2.1.0 Upgrade bazlets to latest stable-2.16 to build with 2.16.16 API Documentation: Add missing footer that links to plugin index page Documentation: Refactor to match other plugin documentation Add an empty tools/BUILD file explicitly for Bazel Upgrade bazlets to latest stable-2.16 Upgrade bazlets to latest stable-2.16 Upgrade bazlets to latest stable-2.15 Upgrade bazlets to latest stable-2.14 Change-Id: Ia85129611b6f4b110e2b298c108d23668b1908a5 - Bump Bazel version to 2.2.0 Change-Id: I409883c778236176cb80368e71c2df0b877b395f - Bump required Bazel version to 2.1.0 Change-Id: I2b85f666c39fc7d6d69022dcd695e07891fe9352 - Upgrade bazlets to latest stable-2.16 to build with 2.16.16 API Change-Id: I204aa0b0784c953ae52f7db62907dda81690af22 - Documentation: Add missing footer that links to plugin index page Change-Id: If5be574b2848ba308227e2019fcf2162693e36cc - Documentation: Refactor to match other plugin documentation Replace hard-coded command for plugin in-tree build. Change-Id: Icd2027015c55d5adfe4bbb2950284d4f8743215e - Add an empty tools/BUILD file explicitly for Bazel To make sure that all plugins consistently have empty BUILD files within their tools. Change-Id: I50809c0235f8de7f86e9ee4bffd32397b393afa3 - Upgrade bazlets to latest stable-2.16 As the previously used commit was locally verified but not the one merged in after reviewing. Change-Id: Ie5318222100ee61efa3b4edda02d66396bc818a8 - Upgrade bazlets to latest stable-2.16 To use the now mandatory https protocol for MAVEN_CENTRAL. Bug: Issue 12170 Change-Id: I4d587f6cb68475408eaddc47be0ccbe48e23b82d - Merge branch 'stable-2.15' into stable-2.16 * stable-2.15: Upgrade bazlets to latest stable-2.15 Upgrade bazlets to latest stable-2.14 Change-Id: Ia796ff684b366d14a5c83c4ffd685990a27b7048 - Upgrade bazlets to latest stable-2.15 To use the now mandatory https protocol for MAVEN_CENTRAL. Bug: Issue 12170 Change-Id: Ib095fee3b86ec63b43bd871845efc6058e1e2c65 - Merge branch 'stable-2.14' into stable-2.15 * stable-2.14: Upgrade bazlets to latest stable-2.14 Change-Id: I38a326f8bea6da058a37e70eedc54ad3a7148e00 - Upgrade bazlets to latest stable-2.14 To use the now mandatory https protocol for MAVEN_CENTRAL. Bug: Issue 12170 Change-Id: I1ee528cb199eb1bf5153a60f1e1adfe09ee1d6a7 --- plugins/gitiles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gitiles b/plugins/gitiles index 4ba2cc4ea8..807dc87dfd 160000 --- a/plugins/gitiles +++ b/plugins/gitiles @@ -1 +1 @@ -Subproject commit 4ba2cc4ea8d46e1e8050b46d62c654b8772b969a +Subproject commit 807dc87dfdcd254afc2d0a864a7f543ef8628fcb From ac57d46e5cca09917a109fe04a80524a40721540 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Sat, 14 Mar 2020 09:45:03 +0100 Subject: [PATCH 08/10] Bazel: Fix plugin api javadoc generation This fixes plugin api javadoc generation by adding overwrite files without prompting option to unzip command. Change-Id: I05a300691b0f4167443145973af63d8ee5517796 --- tools/bzl/javadoc.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bzl/javadoc.bzl b/tools/bzl/javadoc.bzl index b5733bd526..3add0258ce 100644 --- a/tools/bzl/javadoc.bzl +++ b/tools/bzl/javadoc.bzl @@ -32,7 +32,7 @@ def _impl(ctx): "export TZ", "rm -rf %s" % source, "mkdir %s" % source, - " && ".join(["unzip -qud %s %s" % (source, j.path) for j in source_jars.to_list()]), + " && ".join(["unzip -qoud %s %s" % (source, j.path) for j in source_jars.to_list()]), "rm -rf %s" % dir, "mkdir %s" % dir, " ".join([ From a5850c255168879ae3994120f8025ad32f0de803 Mon Sep 17 00:00:00 2001 From: Marco Miller Date: Sun, 15 Mar 2020 04:29:32 -0400 Subject: [PATCH 09/10] Update git submodules * Update plugins/delete-project from branch 'stable-3.0' to 36f243b300fc242f351f456f595720f3125c7408 - Documentation: Fix parentForDeletedProjects in config.md The latest merge I8cc6f59ea did not resolve that conflict properly. Change-Id: I7a9ec7d16f432ff59e932d567b618c08372771f5 --- plugins/delete-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/delete-project b/plugins/delete-project index e3ce8db351..36f243b300 160000 --- a/plugins/delete-project +++ b/plugins/delete-project @@ -1 +1 @@ -Subproject commit e3ce8db351296898f148504e457e919d59275bd6 +Subproject commit 36f243b300fc242f351f456f595720f3125c7408 From 85eace4399c9d8e9d91bbb2de4c8d0ec81dd6c6e Mon Sep 17 00:00:00 2001 From: Paladox none Date: Fri, 6 Mar 2020 14:49:37 +0000 Subject: [PATCH 10/10] Update codemirror-editor Main things we want: * Add support to scroll to line * Add support for fsharp Change-Id: Ife3506ed937164cb38cbee40e9106d33eaa3ea28 --- plugins/codemirror-editor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/codemirror-editor b/plugins/codemirror-editor index 2d3f265ab1..59942b1adf 160000 --- a/plugins/codemirror-editor +++ b/plugins/codemirror-editor @@ -1 +1 @@ -Subproject commit 2d3f265ab1797d4179cbd6855c937989175d5ce5 +Subproject commit 59942b1adf1c949f3633f60ac42f67fae03b3255