Build Gerrit and validate changes on stable-3.4

Adapt the Gerrit checkers definition and select also all
incoming changes on the stable-3.4 branch.

Also activate RBE build mode on stable-3.4 branch.

Change-Id: I4a4c5fa0efefccb3978a1a4f3486ff33227bedc7
diff --git a/jenkins/checker_definitions.txt b/jenkins/checker_definitions.txt
index d313cc7..5c93027 100644
--- a/jenkins/checker_definitions.txt
+++ b/jenkins/checker_definitions.txt
@@ -5,7 +5,7 @@
     "name": "RBE Build/Tests",
     "description": "Builds the code base and executes unit/integration tests on RBE",
     "repository": "gerrit",
-    "query": "(not dir:polygerrit-ui) AND (branch:master)",
+    "query": "(not dir:polygerrit-ui) AND (branch:stable-3.4 OR branch:master)",
     "blocking": []
   }
 
@@ -16,7 +16,7 @@
     "name": "Build/Tests",
     "description": "Builds the code base and executes unit/integration tests",
     "repository": "gerrit",
-    "query": "(not dir:polygerrit-ui) AND (branch:stable-2.16 OR branch:stable-3.1 OR branch:stable-3.2 OR branch:stable-3.3 OR branch:master)",
+    "query": "(not dir:polygerrit-ui) AND (branch:stable-2.16 OR branch:stable-3.1 OR branch:stable-3.2 OR branch:stable-3.3 OR branch:stable-3.4 OR branch:master)",
     "blocking": []
   }
 
@@ -38,7 +38,7 @@
     "name": "PolyGerrit UI Tests",
     "description": "Executes unit/integration tests for PolyGerrit UI",
     "repository": "gerrit",
-    "query": "(dir:polygerrit-ui OR file:WORKSPACE) AND (branch:stable-2.16 OR branch:stable-3.1 OR branch:stable-3.2 OR branch:stable-3.3 OR branch:master)",
+    "query": "(dir:polygerrit-ui OR file:WORKSPACE) AND (branch:stable-2.16 OR branch:stable-3.1 OR branch:stable-3.2 OR branch:stable-3.3 OR branch:stable-3.4 OR branch:master)",
     "blocking": []
   }
 
@@ -49,6 +49,6 @@
     "name": "Code Style",
     "description": "Executes Code Style tests",
     "repository": "gerrit",
-    "query": "branch:stable-2.16 OR branch:stable-3.1 OR branch:stable-3.2 OR branch:stable-3.3 OR branch:master",
+    "query": "branch:stable-2.16 OR branch:stable-3.1 OR branch:stable-3.2 OR branch:stable-3.3 OR branch:stable-3.4 OR branch:master",
     "blocking": []
   }
diff --git a/jenkins/gerrit-bazel-template.yaml b/jenkins/gerrit-bazel-template.yaml
index 2a7c5f4..e481216 100644
--- a/jenkins/gerrit-bazel-template.yaml
+++ b/jenkins/gerrit-bazel-template.yaml
@@ -106,6 +106,7 @@
     name: Gerrit-bazel-java11
     branch:
       - master
+      - stable-3.4
       - stable-3.3
     jobs:
       - 'Gerrit-bazel-java11-{branch}'
diff --git a/jenkins/gerrit-bazel-verifier-test.sh b/jenkins/gerrit-bazel-verifier-test.sh
index 53db60d..cfe496a 100755
--- a/jenkins/gerrit-bazel-verifier-test.sh
+++ b/jenkins/gerrit-bazel-verifier-test.sh
@@ -8,11 +8,11 @@
 echo '----------------------------------------------'
 
 case $TARGET_BRANCH$MODE in
-  masterrbe)
+  masterrbe|stable-3.4rbe)
     TEST_TAG_FILTER="-flaky,-elastic,-git-protocol-v2"
     BAZEL_OPTS="--config=remote --remote_instance_name=projects/api-project-164060093628/instances/default_instance"
     ;;
-  masternotedb)
+  masternotedb|stable-3.4notedb)
     TEST_TAG_FILTER="-flaky,elastic,git-protocol-v2"
     ;;
   stable-2.*)
diff --git a/jenkins/gerrit-codestyle-polygerrit-lint.sh b/jenkins/gerrit-codestyle-polygerrit-lint.sh
index aa033a1..ebd5e2d 100644
--- a/jenkins/gerrit-codestyle-polygerrit-lint.sh
+++ b/jenkins/gerrit-codestyle-polygerrit-lint.sh
@@ -10,6 +10,7 @@
 cd gerrit
 bazelisk version
 if ([ "$TARGET_BRANCH" == "master" ] || \
+    [ "$TARGET_BRANCH" == "stable-3.4" ] || \
     [ "$TARGET_BRANCH" == "stable-3.3" ] || \
     [ "$TARGET_BRANCH" == "stable-3.2" ]) && \
    ((git show --diff-filter=AM --name-only --pretty="" HEAD | grep -q polygerrit-ui) || \
diff --git a/vars/gerritPipeline.groovy b/vars/gerritPipeline.groovy
index b5711e8..11090fc 100644
--- a/vars/gerritPipeline.groovy
+++ b/vars/gerritPipeline.groovy
@@ -130,9 +130,9 @@
 
 def collectBuildModes() {
     Builds.modes = []
-    if (env.GERRIT_BRANCH == "master") {
+    if (env.GERRIT_BRANCH == "master" || env.GERRIT_BRANCH == "stable-3.4") {
         Builds.modes = ["notedb", "rbe"]
-    } else if (env.GERRIT_BRANCH ==~ /stable-3.*/) {
+    } else if (env.GERRIT_BRANCH ==~ /stable-3.[0-3]/) {
         Builds.modes = ["notedb"]
     } else if (env.GERRIT_BRANCH == "stable-2.16") {
         Builds.modes = ["notedb", "reviewdb"]