You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/03/07 15:17:47 UTC

[ignite-teamcity-bot] branch ignite-11491 created (now 6ac8770)

This is an automated email from the ASF dual-hosted git repository.

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


      at 6ac8770  IGNITE-11491: Adapt TC bot to AI CI git proxy: Display actual GitHub Commit

This branch includes the following new commits:

     new 26d1a9a  IGNITE-11491: Adapt TC bot to AI CI git proxy: Build may be started without freshest changes
     new 4db8781  IGNITE-11491: Adapt TC bot to AI CI git proxy: cosmetic
     new 0a13078  IGNITE-11491: Adapt TC bot to AI CI git proxy: cosmetic
     new 98a8750  IGNITE-11491: Adapt TC bot to AI CI git proxy: PR number transferring to triggering code added.
     new 6ac8770  IGNITE-11491: Adapt TC bot to AI CI git proxy: Display actual GitHub Commit

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[ignite-teamcity-bot] 03/05: IGNITE-11491: Adapt TC bot to AI CI git proxy: cosmetic

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0a13078da91adcd5696a27a6e55a4149b2fabaac
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Thu Mar 7 15:01:33 2019 +0300

    IGNITE-11491: Adapt TC bot to AI CI git proxy: cosmetic
---
 ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
index 2249b02..22c4605 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
@@ -89,7 +89,7 @@ function showChainResultsWithSettings(result, settings) {
 }
 
 
-//@param server - see ChainAtServerCurrentStatus
+//@param server - see org.apache.ignite.ci.web.model.current.ChainAtServerCurrentStatus
 function showChainCurrentStatusData(server, settings) {
     if(!isDefinedAndFilled(server))
         return;
@@ -232,12 +232,12 @@ function showChainCurrentStatusData(server, settings) {
 
         var blockersList = "";
 
-        for (var k = 0; k < server.suites.length; k++) {
-            var suite = server.suites[k];
+        for (var l = 0; l < server.suites.length; l++) {
+            var suite0 = server.suites[l];
 
-            suite = suiteWithCriticalFailuresOnly(suite);
+            var suiteOrNull = suiteWithCriticalFailuresOnly(suite0);
 
-            if (suite != null) {
+            if (suiteOrNull != null) {
                 if (blockersList.length !== 0)
                     blockersList += ",";
 
@@ -268,10 +268,10 @@ function showChainCurrentStatusData(server, settings) {
 
     res += addBlockersData(server, settings);
 
-    for (var l = 0; l < server.suites.length; l++) {
-        var suite = server.suites[l];
+    for (var m = 0; m < server.suites.length; m++) {
+        var suite1 = server.suites[m];
 
-        res += showSuiteData(suite, settings);
+        res += showSuiteData(suite1, settings);
     }
 
     res += "<tr><td colspan='4'>&nbsp;</td></tr>";


[ignite-teamcity-bot] 01/05: IGNITE-11491: Adapt TC bot to AI CI git proxy: Build may be started without freshest changes

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 26d1a9a1f9079eaea22595a3b9f3cb37d4614e9a
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Wed Mar 6 15:28:53 2019 +0300

    IGNITE-11491: Adapt TC bot to AI CI git proxy: Build may be started without freshest changes
---
 .../org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java   | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 75f682e..7221970 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -257,6 +257,7 @@ public class TcBotTriggerAndSignOffService {
 
         String[] suiteIds = Objects.requireNonNull(suiteIdList).split(",");
 
+        //todo consult if there are change differences here https://ci.ignite.apache.org/app/rest/changes?locator=buildType:(id:IgniteTests24Java8_Cache7),pending:true,branch:pull%2F6224%2Fhead
         Build[] builds = new Build[suiteIds.length];
 
         for (int i = 0; i < suiteIds.length; i++)


[ignite-teamcity-bot] 04/05: IGNITE-11491: Adapt TC bot to AI CI git proxy: PR number transferring to triggering code added.

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 98a875066a57d4ce1c921bda7abf97fc0fbed142
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Thu Mar 7 15:28:54 2019 +0300

    IGNITE-11491: Adapt TC bot to AI CI git proxy: PR number transferring to triggering code added.
---
 .../src/main/webapp/js/testfails-2.1.js            | 38 ++++++++++++++--------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
index 22c4605..93539c5 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
@@ -89,7 +89,10 @@ function showChainResultsWithSettings(result, settings) {
 }
 
 
-//@param server - see org.apache.ignite.ci.web.model.current.ChainAtServerCurrentStatus
+/**
+ * @param server - see org.apache.ignite.ci.web.model.current.ChainAtServerCurrentStatus Java Class.
+ * @param settings - see Settings JavaScript class.
+ */
 function showChainCurrentStatusData(server, settings) {
     if(!isDefinedAndFilled(server))
         return;
@@ -179,12 +182,12 @@ function showChainCurrentStatusData(server, settings) {
         mInfo += "Trigger failed " + cntFailed + " builds";
         mInfo += " <a href='javascript:void(0);' ";
         mInfo += " onClick='triggerBuilds(\"" + server.serverId + "\", \"" + parentSuitId + "\", " +
-            "\"" + suitesFailedList + "\", \"" + server.branchName + "\", false, false)' ";
+            "\"" + suitesFailedList + "\", \"" + server.branchName + "\", false, false, null, \"" + server.prNum + "\")' ";
         mInfo += " title='trigger builds'>in queue</a> ";
 
         mInfo += " <a href='javascript:void(0);' ";
         mInfo += " onClick='triggerBuilds(\"" + server.serverId + "\", \"" + parentSuitId + "\", " +
-            "\"" + suitesFailedList + "\", \"" + server.branchName + "\", true, false)' ";
+            "\"" + suitesFailedList + "\", \"" + server.branchName + "\", true, false, null, \"" + server.prNum + "\")' ";
         mInfo += " title='trigger builds'>on top</a><br>";
     }
 
@@ -246,10 +249,11 @@ function showChainCurrentStatusData(server, settings) {
         }
 
         res += "<button onclick='triggerBuilds(\"" + server.serverId + "\", \"" + parentSuitId + "\", \"" +
-            blockersList + "\", \"" + server.branchName + "\", false, false)'> Re-run possible blockers</button><br>";
+            blockersList + "\", \"" + server.branchName + "\", false, false, null,  \"" + + server.prNum + "\")'> " +
+            "Re-run possible blockers</button><br>";
 
         res += "<button onclick='triggerBuilds(\"" + server.serverId + "\", \"" + parentSuitId + "\", \"" +
-            blockersList + "\", \"" + server.branchName + "\", false, true)'> " +
+            blockersList + "\", \"" + server.branchName + "\", false, true, null, \"" + + server.prNum +"\")'> " +
             "Re-run possible blockers & Comment JIRA</button><br>";
     }
 
@@ -269,9 +273,9 @@ function showChainCurrentStatusData(server, settings) {
     res += addBlockersData(server, settings);
 
     for (var m = 0; m < server.suites.length; m++) {
-        var suite1 = server.suites[m];
+        var subSuite = server.suites[m];
 
-        res += showSuiteData(suite1, settings);
+        res += showSuiteData(subSuite, settings, server.prNum);
     }
 
     res += "<tr><td colspan='4'>&nbsp;</td></tr>";
@@ -300,7 +304,7 @@ function addBlockersData(server, settings) {
         suite = suiteWithCriticalFailuresOnly(suite);
 
         if (suite != null)
-            blockers += showSuiteData(suite, settings);
+            blockers += showSuiteData(suite, settings, server.prNum);
     }
 
     if (blockers === "") {
@@ -400,13 +404,14 @@ function notifyGit() {
     });
 }
 
-function triggerBuilds(serverId, parentSuiteId, suiteIdList, branchName, top, observe, ticketId) {
+function triggerBuilds(serverId, parentSuiteId, suiteIdList, branchName, top, observe, ticketId, prNum) {
     var queueAtTop = isDefinedAndFilled(top) && top;
     var observeJira = isDefinedAndFilled(observe) && observe;
     var suiteIdsNotExists = !isDefinedAndFilled(suiteIdList) || suiteIdList.length === 0;
     var branchNotExists = !isDefinedAndFilled(branchName) || branchName.length === 0;
     branchName = branchNotExists ? null : branchForTc(branchName);
     ticketId = (isDefinedAndFilled(ticketId) && ticketId.length > 0) ? ticketId : null;
+    prNum = (isDefinedAndFilled(prNum) && prNum.length > 0) ? prNum : null;
 
     var triggerConfirm = $("#triggerConfirm");
 
@@ -449,6 +454,9 @@ function triggerBuilds(serverId, parentSuiteId, suiteIdList, branchName, top, ob
     } else
         sendGetRequest();
 
+    /**
+     * See org.apache.ignite.ci.web.rest.TriggerBuilds#triggerBuilds
+     */
     function sendGetRequest() {
         $.ajax({
             url: 'rest/build/trigger',
@@ -459,7 +467,8 @@ function triggerBuilds(serverId, parentSuiteId, suiteIdList, branchName, top, ob
                 "suiteIdList": suiteIdList,
                 "top": queueAtTop,
                 "observe": observeJira,
-                "ticketId": ticketId
+                "ticketId": ticketId,
+                "prNum": prNum
             },
             success: successDialog,
             error: showErrInLoadStatus
@@ -581,11 +590,12 @@ function commentJira(serverId, branchName, parentSuiteId, ticketId) {
 /**
  * Create html string with table rows, containing suite data.
  *
- * @param suite - see SuiteCurrentStatus Java class.
+ * @param suite - see org.apache.ignite.ci.web.model.current.SuiteCurrentStatus Java class.
  * @param settings - see Settings JavaScript class.
+ * @param prNum - PR shown, used by triggering.
  * @returns {string} Table rows with suite data.
  */
-function showSuiteData(suite, settings) {
+function showSuiteData(suite, settings, prNum) {
     var moreInfoTxt = "";
 
     if (isDefinedAndFilled(suite.userCommits) && suite.userCommits !== "") {
@@ -651,12 +661,12 @@ function showSuiteData(suite, settings) {
         mInfo += " Trigger build: ";
         mInfo += "<a href='javascript:void(0);' ";
         mInfo += " onClick='triggerBuilds(\"" + suite.serverId + "\", null, \"" +
-            suite.suiteId + "\", \"" + suite.branchName + "\", false, false)' ";
+            suite.suiteId + "\", \"" + suite.branchName + "\", false, false, null, \"" + prNum + "\")' ";
         mInfo += " title='trigger build' >queue</a> ";
 
         mInfo += "<a href='javascript:void(0);' ";
         mInfo += " onClick='triggerBuilds(\"" + suite.serverId + "\", null, \"" +
-            suite.suiteId + "\", \"" + suite.branchName + "\", true, false)' ";
+            suite.suiteId + "\", \"" + suite.branchName + "\", true, false, null, \"" + prNum + "\")' ";
         mInfo += " title='trigger build at top of queue'>top</a><br>";
     }
 


[ignite-teamcity-bot] 02/05: IGNITE-11491: Adapt TC bot to AI CI git proxy: cosmetic

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4db8781037e1857ef5184d102556946e546dc726
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Thu Mar 7 14:12:47 2019 +0300

    IGNITE-11491: Adapt TC bot to AI CI git proxy: cosmetic
---
 ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
index 969b2c2..2249b02 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
@@ -232,8 +232,8 @@ function showChainCurrentStatusData(server, settings) {
 
         var blockersList = "";
 
-        for (var i = 0; i < server.suites.length; i++) {
-            var suite = server.suites[i];
+        for (var k = 0; k < server.suites.length; k++) {
+            var suite = server.suites[k];
 
             suite = suiteWithCriticalFailuresOnly(suite);
 
@@ -268,8 +268,8 @@ function showChainCurrentStatusData(server, settings) {
 
     res += addBlockersData(server, settings);
 
-    for (var i = 0; i < server.suites.length; i++) {
-        var suite = server.suites[i];
+    for (var l = 0; l < server.suites.length; l++) {
+        var suite = server.suites[l];
 
         res += showSuiteData(suite, settings);
     }


[ignite-teamcity-bot] 05/05: IGNITE-11491: Adapt TC bot to AI CI git proxy: Display actual GitHub Commit

Posted by dp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6ac87707f16d592f611e4ba63aaa0e4a5f476c1e
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Thu Mar 7 15:58:22 2019 +0300

    IGNITE-11491: Adapt TC bot to AI CI git proxy: Display actual GitHub Commit
---
 .../org/apache/ignite/ci/github/GitHubBranch.java  |  4 ++++
 .../ci/github/ignited/IGitHubConnIgnited.java      |  5 ++++-
 .../ci/github/pure/GitHubConnectionImpl.java       |  3 +--
 .../tcbot/visa/TcBotTriggerAndSignOffService.java  | 26 +++++++++++++++++++---
 .../apache/ignite/ci/web/rest/TriggerBuilds.java   |  5 +++--
 .../src/main/webapp/js/testfails-2.1.js            |  2 +-
 ignite-tc-helper-web/src/main/webapp/prs.html      |  3 ++-
 7 files changed, 38 insertions(+), 10 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/GitHubBranch.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/GitHubBranch.java
index 92d4475..0b4e332 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/GitHubBranch.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/GitHubBranch.java
@@ -43,4 +43,8 @@ public class GitHubBranch {
     public String ref() {
         return ref;
     }
+
+    public String sha() {
+        return sha;
+    }
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/ignited/IGitHubConnIgnited.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/ignited/IGitHubConnIgnited.java
index 1170c7a..10d14aa 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/ignited/IGitHubConnIgnited.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/ignited/IGitHubConnIgnited.java
@@ -25,7 +25,10 @@ import org.apache.ignite.ci.tcbot.conf.IJiraServerConfig;
  *
  */
 public interface IGitHubConnIgnited {
-    IGitHubConfig config();
+    /**
+     * @return Config of GH project.
+     */
+    public IGitHubConfig config();
 
     /**
      * @return list of open pull requests
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/pure/GitHubConnectionImpl.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/pure/GitHubConnectionImpl.java
index 522421d..a7ff550 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/pure/GitHubConnectionImpl.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/github/pure/GitHubConnectionImpl.java
@@ -89,8 +89,7 @@ class GitHubConnectionImpl implements IGitHubConnection {
     }
 
     /** {@inheritDoc} */
-    @Override
-    public void init(String srvCode) {
+    @Override public void init(String srvCode) {
         this.srvCode = srvCode;
         final File workDir = HelperConfig.resolveWorkDir();
 
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 7221970..705fe0f 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -250,10 +250,30 @@ public class TcBotTriggerAndSignOffService {
         @Nullable Boolean top,
         @Nullable Boolean observe,
         @Nullable String ticketId,
-        ICredentialsProv prov) {
+        @Nullable String prNum,
+        @Nullable ICredentialsProv prov) {
         String jiraRes = "";
 
-        final ITeamcityIgnited teamcity = tcIgnitedProv.server(srvId, prov);
+        ITeamcityIgnited teamcity = tcIgnitedProv.server(srvId, prov);
+
+        IGitHubConnIgnited ghIgn = gitHubConnIgnitedProvider.server(srvId);
+
+        if(!Strings.isNullOrEmpty(prNum)) {
+            try {
+                PullRequest pr = ghIgn.getPullRequest(Integer.parseInt(prNum));
+
+                String sha = pr.head().sha();
+
+                if(!Strings.isNullOrEmpty(sha)) {
+                    String shaShort = sha.substring(0, 7);
+
+                    jiraRes = "Actual commit: " + shaShort + ". ";
+                }
+            }
+            catch (NumberFormatException e) {
+                logger.error("PR & TC state checking failed" , e);
+            }
+        }
 
         String[] suiteIds = Objects.requireNonNull(suiteIdList).split(",");
 
@@ -264,7 +284,7 @@ public class TcBotTriggerAndSignOffService {
             builds[i] = teamcity.triggerBuild(suiteIds[i], branchForTc, false, top != null && top);
 
         if (observe != null && observe)
-            jiraRes = observeJira(srvId, branchForTc, ticketId, prov, parentSuiteId, builds);
+            jiraRes += observeJira(srvId, branchForTc, ticketId, prov, parentSuiteId, builds);
 
         return jiraRes;
     }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
index bd953d7..01764e4 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuilds.java
@@ -69,7 +69,8 @@ public class TriggerBuilds {
         @Nonnull @QueryParam("suiteIdList") String suiteIdList,
         @Nullable @QueryParam("top") Boolean top,
         @Nullable @QueryParam("observe") Boolean observe,
-        @Nullable @QueryParam("ticketId") String ticketId
+        @Nullable @QueryParam("ticketId") String ticketId,
+        @Nullable @QueryParam("prNum") String prNum
     ) {
         ICredentialsProv prov = ICredentialsProv.get(req);
         Injector injector = CtxListener.getInjector(ctx);
@@ -81,7 +82,7 @@ public class TriggerBuilds {
 
         String jiraRes = injector
             .getInstance(TcBotTriggerAndSignOffService.class)
-            .triggerBuildsAndObserve(srvCode, branchForTc, parentSuiteId, suiteIdList, top, observe, ticketId, prov);
+            .triggerBuildsAndObserve(srvCode, branchForTc, parentSuiteId, suiteIdList, top, observe, ticketId, prNum, prov);
 
         return new SimpleResult("Tests started." + (!jiraRes.isEmpty() ? "<br>" + jiraRes : ""));
     }
diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
index 93539c5..a45f850 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
@@ -244,7 +244,7 @@ function showChainCurrentStatusData(server, settings) {
                 if (blockersList.length !== 0)
                     blockersList += ",";
 
-                blockersList += suite.suiteId;
+                blockersList += suite0.suiteId;
             }
         }
 
diff --git a/ignite-tc-helper-web/src/main/webapp/prs.html b/ignite-tc-helper-web/src/main/webapp/prs.html
index 6989a00..cd736b4 100644
--- a/ignite-tc-helper-web/src/main/webapp/prs.html
+++ b/ignite-tc-helper-web/src/main/webapp/prs.html
@@ -180,7 +180,8 @@
             var branchName = fields.namedItem("branchForTc").value;
             var ticketId = fields.namedItem("ticketId").value;
 
-            triggerBuilds(srvId, suiteId, branchName, false, trigCase !== "tests", ticketId)
+            //todo prNum
+            triggerBuilds(srvId, suiteId, branchName, false, trigCase !== "tests", ticketId);
         }
 
         /**