ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpav...@apache.org
Subject [ignite-teamcity-bot] 01/02: IGNITE-10095: Support Build Parameters specifying in triggering builds
Date Mon, 06 May 2019 17:29:50 GMT
This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch ignite-10095
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 86570e65d83e239c4c525eecc379f9a370867532
Author: Dmitriy Pavlov <dpavlov@apache.org>
AuthorDate: Mon May 6 17:14:22 2019 +0300

    IGNITE-10095: Support Build Parameters specifying in triggering builds
---
 conf/branches.json                                 | 22 +++++++++++++++++-----
 .../apache/ignite/ci/IgniteTeamcityConnection.java |  2 +-
 .../ignite/ci/tcbot/conf/BuildParameter.java       | 16 +++++++++++++++-
 .../ignite/ci/tcbot/conf/ChainAtServerTracked.java | 14 +++++---------
 4 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/conf/branches.json b/conf/branches.json
index 90d93cb..3039641 100644
--- a/conf/branches.json
+++ b/conf/branches.json
@@ -79,28 +79,40 @@
           "suiteId": "IgniteTests24Java8_RunAllNightly",
           "branchForRest": "\u003cdefault\u003e",
           "triggerBuild": true,
-          "triggerBuildQuietPeriod": 30 //triggering quiet period in minutes
+          /* Triggering quiet period in minutes. Protects from too-often triggering in case
build is too fast, e.g. compilation failure. */
+          "triggerBuildQuietPeriod": 30,
+          "triggerParameters": [
+            {
+              name: "reverse.dep.*.env.JAVA_HOME",
+              randomValues: [
+                "%env.JDK_ORA_18%",
+                "%env.JDK_ORA_9%",
+                "%env.JDK_ORA_10%",
+                "%env.JDK_OPEN_11%"
+              ]
+            }
+          ]
         }
       ]
     },
     {
-      "id": "ignite-2.7",
+      "id": "ignite-2.7.5",
       "chains": [
         {
           "serverId": "apache",
           "suiteId": "IgniteTests24Java8_RunAll",
-          "branchForRest": "ignite-2.7",
+          "branchForRest": "ignite-2.7.5",
           "baseBranchForTc": "\u003cdefault\u003e"
         }
       ]
     },
     {
-      "id": "ignite-2.7-nightly",
+      "id": "ignite-2.7.5-nightly",
       "chains": [
         {
           "serverId": "apache",
           "suiteId": "IgniteTests24Java8_RunAllNightly",
-          "branchForRest": "ignite-2.7",
+          "branchForRest": "ignite-2.7.5",
           "baseBranchForTc": "\u003cdefault\u003e",
           "triggerBuild": true,
           "triggerBuildQuietPeriod": 30 //triggering quiet period in minutes
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
index efafbf1..766e30d 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
@@ -223,7 +223,7 @@ public class IgniteTeamcityConnection implements ITeamcity {
                 " cleanSources=\"" + cleanRebuild + "\"" +
                 " rebuildAllDependencies=\"" + cleanRebuild + "\"" +
                 " queueAtTop=\"" + queueAtTop + "\"" +
-                "/>";
+                "/>\n";
 
         String comments = " <comment><text>Build triggered from Ignite TC Bot"
+
             " [cleanRebuild=" + cleanRebuild + ", top=" + queueAtTop + "]</text></comment>\n";
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/BuildParameter.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/BuildParameter.java
index c4709b1..b7fbb6c 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/BuildParameter.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/BuildParameter.java
@@ -17,13 +17,19 @@
 
 package org.apache.ignite.ci.tcbot.conf;
 
+import com.google.common.base.Strings;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Objects;
 
 public class BuildParameter {
+    /** Name. */
     private String name;
+
+    /** Value. */
     private String value;
+
+    /** Random values. Ignored if exact values were specified */
     private List<String> randomValues = new LinkedList<>();
 
     /** {@inheritDoc} */
@@ -48,6 +54,14 @@ public class BuildParameter {
     }
 
     public Object generateValue() {
-        return value;
+        if (!Strings.isNullOrEmpty(value))
+            return value;
+
+        if (randomValues.isEmpty())
+            return null;
+
+        int idx = (int)(Math.random() * randomValues.size());
+
+        return randomValues.get(idx);
     }
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ChainAtServerTracked.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ChainAtServerTracked.java
index 0892445..92088b3 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ChainAtServerTracked.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ChainAtServerTracked.java
@@ -75,29 +75,25 @@ public class ChainAtServerTracked extends ChainAtServer {
         return Optional.ofNullable(baseBranchForTc);
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    /** {@inheritDoc} */
     @Override public boolean equals(Object o) {
         if (this == o)
             return true;
-
         if (o == null || getClass() != o.getClass())
             return false;
-
         if (!super.equals(o))
             return false;
-
         ChainAtServerTracked tracked = (ChainAtServerTracked)o;
-
         return Objects.equals(branchForRest, tracked.branchForRest) &&
+            Objects.equals(baseBranchForTc, tracked.baseBranchForTc) &&
             Objects.equals(triggerBuild, tracked.triggerBuild) &&
-            Objects.equals(triggerBuildQuietPeriod, tracked.triggerBuildQuietPeriod);
+            Objects.equals(triggerBuildQuietPeriod, tracked.triggerBuildQuietPeriod) &&
+            Objects.equals(triggerParameters, tracked.triggerParameters);
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return Objects.hash(super.hashCode(), branchForRest, triggerBuild, triggerBuildQuietPeriod);
+        return Objects.hash(super.hashCode(), branchForRest, baseBranchForTc, triggerBuild,
triggerBuildQuietPeriod, triggerParameters);
     }
 
     /**


Mime
View raw message