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

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


The following commit(s) were added to refs/heads/ignite-9800 by this push:
     new 5015810  IGNITE-9800: keep a history of changes using file rename
5015810 is described below

commit 501581046dc53c1a5f1786a2c2da225c6109f869
Author: Dmitriy Pavlov <[email protected]>
AuthorDate: Fri Oct 5 15:32:51 2018 +0300

    IGNITE-9800: keep a history of changes using file rename
---
 ignite-tc-helper-web/src/main/webapp/index.html    | 110 +------
 .../src/main/webapp/{index.html => index0.html}    |   0
 ignite-tc-helper-web/src/main/webapp/index2.html   |  56 ----
 .../src/main/webapp/js/common-1.6.js               |   2 +-
 ignite-tc-helper-web/src/main/webapp/prs.html      | 330 ++++++++++-----------
 ignite-tc-helper-web/src/main/webapp/services.html | 222 +-------------
 6 files changed, 175 insertions(+), 545 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/webapp/index.html 
b/ignite-tc-helper-web/src/main/webapp/index.html
index 3e2cfff..d49a69a 100644
--- a/ignite-tc-helper-web/src/main/webapp/index.html
+++ b/ignite-tc-helper-web/src/main/webapp/index.html
@@ -17,137 +17,39 @@ $(document).ready(function() {
 
     $( document ).tooltip();
     loadData();
-     //todo fix setInterval(loadData, 90000);
 });
 
 function loadData() {
     $("#loadStatus").html("<img 
src='https://www.wallies.com/filebin/images/loading_apple.gif' width=20px 
height=20px> Please wait");
 
+    $("#version").html(" " + "<a href=\"monitoring.html\">TC Bot Moniroting 
Page</a> <br>");
     $.ajax({
         url: "rest/branches/version",
         success: showVersionInfo,
         error: showErrInLoadStatus
     });
 
-    $.ajax({
-        url: "rest/branches/getIds",
-        success: function(result) {
-            $("#loadStatus").html("");
-            showCurrentBranchesData(result);
-        },
-        error: showErrInLoadStatus
-    });
-
-    $.ajax({
-        url: "rest/branches/suites",
-        success: function(result) {
-            $("#loadStatus").html("");
-            showFormAndSuitesForPrCheck(result);
-            tryToFillAutocompleteLists();
-        },
-        error: showErrInLoadStatus
-    });
 
     $.ajax({
         url: "rest/branches/getServerIds",
         success: function(result) {
             $("#loadStatus").html("");
-            setupAutocompleteList(result);
-            showBuildsOnServers(result);
         },
         error: showErrInLoadStatus
     });
 }
 
-function showCurrentBranchesData(result) {
-    var res = "";
-    for (var i = 0; i < result.length; i++) {
-        var id = result[i];
-       //  res += "<div class='formgroup'>";
-        res += id + ":";
-        res += "<a href='current.html?branch=" + id + "'><button>Latest (" + 
id + ")</button></a>";
-        res += " &nbsp;&nbsp;<a href='current.html?branch=" + id + 
"&checkAllLogs=true' title='With logs processing'><button>Latest (" + id + " + 
logs)</button></a>";
-        res += " &nbsp;&nbsp;<a href='all.html?branch=" + id + "'><button 
title='Failures from last 10 runs merged'>History (" + id + ")</button></a>";
-        //  res += "</div>";
-        res += "<br>";
-    }
-
-    res += "</table>";
-
 
-    $("#branchesStatus").html(res);
-}
-
-function showFormAndSuitesForPrCheck(result) {
-    var res = "";
-
-    for (var i = 0; i < result.length; i++) {
-        var chainAtServer = result[i];
-
-        res += "<form action='pr.html'>";
-        res += "Server: <input type='text' name='serverId' value=" + 
chainAtServer.serverId + " readonly>";
-        res += "Chain: <input type='text' name='suiteId' value=" + 
chainAtServer.suiteId + ">";
-        res += "Base branch: <input class='branchForTc" + 
chainAtServer.serverId +
-            "' type='text' name='baseBranchForTc'  title='Etalon branch, e.g 
refs/heads/master'> ";
-        res += "<b>Branch:</b> <input class='branchForTc" + 
chainAtServer.serverId +
-            "' type='text' name='branchForTc' title='Tested branch, e.g. 
pull/4790/head or ignite-9349' required> ";
-        res += "<input type='submit' name='action' value='Latest' title='Show 
latest runs'>";
-        // res+="<input type='submit' name='action' value='Chain'>";
-        res += "<input type='submit' name='action' value='History' title='Show 
last 10 runs merged'>";
-        res += "</form>";
-    }
-
-    $("#suitesForPrCheck").html(res);
-}
-
-function showBuildsOnServers(result) {
-    var res = "";
-    for (var i = 0; i < result.length; i++) {
-        var serverId = result[i];
-        //res+="<a 
href='pr.html?serverId=private&branchForTc=ignite-gg-12790-1&suiteId=id8xIgniteGridGainTests_RunAll="+id+"'>Check
 PR</a><br>";
-
-        res+="<form action='build.html'>";
-        res+="Server: <input type='text' name='serverId' value=" + serverId +" 
readonly>" ;
-        res+="Check Logs: <input type='text' name='checkAllLogs' style='width: 
20%;' value='true' readonly>" ;
-        res+="Build Id: <input type='text' name='buildId' required> ";
-        res+="<input type='submit' name='action' value='Check'>";
-        res+="</form>";
-    }
-    $("#buildsCheck").html(res);
-}
 </script>
 </head>
 <body>
-<div class="formgroup">
-    Monitoring. Current Failed Tests: <br>
-    <div id="branchesStatus"></div>
-</div>
-<br>
-
-<div class="formgroup">
-    Contribution. Check branch/PR:
-    <div id="suitesForPrCheck"></div>
+<div class="formgroup" style="text-align: center">
+    <div style="text-align: center">I Want to</div>
+    <a href="prs.html"><button class="idxpgbutton">&#128269;<br>Inspect 
Contribution</button></a>
+    <a href="guard.html"><button class="idxpgbutton">&#128737;<br>Monitor TC 
state</button></a>
+    <a href="index0.html"><button class="idxpgbutton">&#128737;<br>See 
obsolete index page</button></a>
 </div>
-<br>
-
-<div class="formgroup">
-    Check build: <br>
-    <div id="buildsCheck"></div>
-</div>
-<br>
-
-Statistics: <br>
-<!--<a href="chart.html">Build metrics daily history</a><br>
-<a href="restpretty.html?url=top/failing">Top failing tests</a> (JSON) <br>
-<a href="restpretty.html?url=top/longRunning">Top long running tests</a> 
(JSON) <br>
-<a href="restpretty.html?url=top/failingSuite">Top failing suites</a> (JSON) 
<br>
-<a href="./status">Current Build Status (obsolete)</a><br>
-<br>-->
-<a href="comparison.html">Comparison master's branch in the date 
interval</a><br>
 
-Other: <br>
-<a href="ignval.html">Ignite Log Values pretty-print</a> &nbsp;
-<a href="monitoring.html">Bot moniroting page</a> <br>
 <div id="loadStatus"></div>
 <div id="version"></div>
 
diff --git a/ignite-tc-helper-web/src/main/webapp/index.html 
b/ignite-tc-helper-web/src/main/webapp/index0.html
similarity index 100%
copy from ignite-tc-helper-web/src/main/webapp/index.html
copy to ignite-tc-helper-web/src/main/webapp/index0.html
diff --git a/ignite-tc-helper-web/src/main/webapp/index2.html 
b/ignite-tc-helper-web/src/main/webapp/index2.html
deleted file mode 100644
index dfbc168..0000000
--- a/ignite-tc-helper-web/src/main/webapp/index2.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<html>
-<head>
-    <title>Ignite Teamcity Helper</title>
-    <link rel="icon" href="img/leaf-icon-png-7066.png">
-
-    <link rel="stylesheet" 
href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css";>
-
-    <link rel="stylesheet" href="css/style-1.5.css">
-
-    <script src="https://code.jquery.com/jquery-1.12.4.js";></script>
-    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js";></script>
-
-    <script src="js/common-1.6.js"></script>
-    <script>
-$(document).ready(function() {
-    $.getScript("js/common-1.6.js", function(data, textStatus, jqxhr){ });
-
-    $( document ).tooltip();
-    loadData();
-});
-
-function loadData() {
-    $("#loadStatus").html("<img 
src='https://www.wallies.com/filebin/images/loading_apple.gif' width=20px 
height=20px> Please wait");
-
-    $("#version").html(" " + "<a href=\"monitoring.html\">TC Bot Moniroting 
Page</a> <br>");
-    $.ajax({
-        url: "rest/branches/version",
-        success: showVersionInfo,
-        error: showErrInLoadStatus
-    });
-
-
-    $.ajax({
-        url: "rest/branches/getServerIds",
-        success: function(result) {
-            $("#loadStatus").html("");
-        },
-        error: showErrInLoadStatus
-    });
-}
-
-
-</script>
-</head>
-<body>
-<div class="formgroup" style="text-align: center">
-    <div style="text-align: center">I Want to</div>
-    <a href="prs.html"><button class="idxpgbutton">&#128269;<br>Inspect 
Contribution</button></a>
-    <a href="guard.html"><button class="idxpgbutton">&#128737;<br>Monitor TC 
state</button></a>
-</div>
-
-<div id="loadStatus"></div>
-<div id="version"></div>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/ignite-tc-helper-web/src/main/webapp/js/common-1.6.js 
b/ignite-tc-helper-web/src/main/webapp/js/common-1.6.js
index 3a4688d..b1a925c 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/common-1.6.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/common-1.6.js
@@ -128,7 +128,7 @@ function showMenu(menuData) {
         res += "<div class=\"navbar\">";
         res += "<a href=\"/\">Home</a>";
         res += "<a href=\"/compare.html\">Compare builds</a>";
-        res += "<a href=\"/services.html\">PR/Branch check</a>";
+        res += "<a href=\"/prs.html\">PR/Branch check</a>";
         res += "<a href=\"/comparison.html\">Master Trends</a>";
 
 
diff --git a/ignite-tc-helper-web/src/main/webapp/prs.html 
b/ignite-tc-helper-web/src/main/webapp/prs.html
index 327296c..be80561 100644
--- a/ignite-tc-helper-web/src/main/webapp/prs.html
+++ b/ignite-tc-helper-web/src/main/webapp/prs.html
@@ -22,171 +22,171 @@
 
     </style>
     <script>
-$(document).ready(function() {
-    $.getScript("js/common-1.6.js", function(data, textStatus, jqxhr){ });
-
-    $( document ).tooltip();
-    $( "#accordion" ).accordion({
-        heightStyle: "fill"
-    });
-    loadData();
-});
-
-function loadData() {
-    $("#loadStatus").html("<img 
src='https://www.wallies.com/filebin/images/loading_apple.gif' width=20px 
height=20px> Please wait");
-
-    $.ajax({
-        url: "rest/branches/version",
-        success: showVersionInfo,
-        error: showErrInLoadStatus
-    });
-
-    $.ajax({
-        url: "rest/branches/suites",
-        success: function(result) {
-            $("#loadStatus").html("");
-            showSuitesForTeamCityRunData(result);
-            showFormAndSuitesForPrCheck(result);
-            tryToFillAutocompleteLists();
-            showCommentJiraForm(result);
-        },
-        error: showErrInLoadStatus
-    });
-
-    $.ajax({
-        url: "rest/branches/getServerIds",
-        success: setupAutocompleteList
-    });
-}
-
-function showSuitesForTeamCityRunData(result) {
-    var res = "";
-
-    for (var i = 0; i < result.length; i++) {
-        var chainAtServer = result[i];
-
-        // TODO multiple servers
-        if (chainAtServer.serverId != "apache")
-            continue;
-
-        res += "Server: <input type='text' name='serverId' value='" + 
chainAtServer.serverId + "' readonly>";
-        res += "Chain: <input type='text' name='suiteId' value='" + 
chainAtServer.suiteId + "' readonly>";
-        res += "Branch: <input type='text' name='branchForTc' 
class='branchForTc" + chainAtServer.serverId +
-            "' required> ";
-        res += "Ticket: <input type='text' name='ticketId'>";
-        res += "<button name='jira' type='button' 
onclick='trigBuild(\"tests\")'>Start tests</button>";
-        res += "<button name='jira' onclick='trigBuild(\"tests+jira\")'>Start 
tests and comment JIRA ticket on ready</button>";
-        //res += "<button name='git' onclick='trigBuild(\"tests+jira\")'>Start 
tests and comment GitHub PR on ready</button>";
-        /*
-        res+="Server: <input type='text' name='serverId' value=" + serverId +" 
readonly>" ;
-        res+="Pull Request #<input type='text' name='prId' onkeypress='return 
trigBuild(event)'> ";
-        res+="<button onclick='trigBuild()'>Run All</button><br>";
-        */
-    }
-
-    $("#suitesForRunAll").html(res);
-}
-
-/**
- * This form allows user to startIgnite TeamCity Run All build.
- */
-function showCommentJiraForm(result) {
-    var res = "";
-
-    for (var i = 0; i < result.length; i++) {
-        var chainAtServer = result[i];
-
-        // TODO multiple servers
-        if (chainAtServer.serverId != "apache")
-            continue;
-
-        res += "Server: <input type='text' name='serverId' value=" + 
chainAtServer.serverId +" readonly>" ;
-        res += "Chain: <input type='text' name='suiteId' value='" + 
chainAtServer.suiteId + "' readonly>";
-        res += "Branch: <input type='text' name='branchForTc' 
class='branchForTc" + chainAtServer.serverId +
-            "' required> ";
-        res += "Ticket: <input type='text' name='ticketId'> ";
-        res += "<button name='action' onclick='notifyJira()'>Notify</button>";
-    }
-
-    $("#notifyJira").html(res);
-}
-
-/**
- * Start Run All build on TeamCity and comment in JIRA ticket when build will 
be finished.
- */
-function trigBuild(trigCase) {
-    var fields = document.getElementById("suitesForRunAll").children;
-
-    var srvId = fields.namedItem("serverId").value;
-    var suiteId = fields.namedItem("suiteId").value;
-    var branchName = branchForTc(fields.namedItem("branchForTc").value);
-    var ticketId = jiraTicketNumber(fields.namedItem("ticketId").value);
-
-    triggerBuild(srvId, suiteId, branchName, false, trigCase !== "tests", 
ticketId)
-}
-
-/**
- * Comment in JIRA ticket with results for the given PR.
- */
-function notifyJira() {
-    var fields = document.getElementById("notifyJira").children;
-
-    var srvId = fields.namedItem("serverId").value;
-    var suiteId = fields.namedItem("suiteId").value;
-    var branchName = branchForTc(fields.namedItem("branchForTc").value);
-    var ticketId = jiraTicketNumber(fields.namedItem("ticketId").value);
-
-    commentJira(srvId, suiteId, branchName, ticketId)
-}
-
-/**
- * Converts PR number to branch for TeamCity.
- *
- * @param pr - Pull Request number.
- * @returns {String} Branch for TeamCity.
- */
-function branchForTc(pr) {
-    var regExpr = /(\d*)/i;
-
-    if (regExpr.exec(pr)[0] === pr)
-        return "pull/" + regExpr.exec(pr)[0] + "/head";
-
-    return pr;
-}
-
-/**
- * Converts JIRA ticket full name to the tickets number.
- *
- * @param ticket - JIRA ticket.
- * @returns {string} JIRA ticket number.
- */
-function jiraTicketNumber(ticket) {
-    var regExpr = /(ignite-)?(\d*)/i;
-
-    return regExpr.exec(ticket)[2];
-}
-
-function showFormAndSuitesForPrCheck(result) {
-    var res = "";
-
-    for (var i = 0; i < result.length; i++) {
-        var chainAtServer = result[i];
-
-        res += "<form action='pr.html'>";
-        res += "Server: <input type='text' name='serverId' value=" + 
chainAtServer.serverId + " readonly>";
-        res += "Chain: <input type='text' name='suiteId' value=" + 
chainAtServer.suiteId + ">";
-        res += "Base branch: <input class='branchForTc" + 
chainAtServer.serverId +
-            "' type='text' name='baseBranchForTc'  title='Etalon branch to 
take base data from, e.g refs/heads/master'> ";
-        res += "<b>Branch:</b> <input class='branchForTc" + 
chainAtServer.serverId +
-            "' type='text' name='branchForTc' title='Tested branch, e.g. 
pull/4790/head or ignite-9349' required> ";
-        res += "<input type='submit' name='action' value='Latest' title='Show 
latest runs'>";
-        // res+="<input type='submit' name='action' value='Chain'>";
-        res += "<input type='submit' name='action' value='History' title='Show 
last 10 runs merged'>";
-        res += "</form>";
-    }
-
-    $("#suitesForPrCheck").html(res);
-}
+        $(document).ready(function() {
+            $.getScript("js/common-1.6.js", function(data, textStatus, jqxhr){ 
});
+
+            $( document ).tooltip();
+            $( "#accordion" ).accordion({
+                heightStyle: "fill"
+            });
+            loadData();
+        });
+
+        function loadData() {
+            $("#loadStatus").html("<img 
src='https://www.wallies.com/filebin/images/loading_apple.gif' width=20px 
height=20px> Please wait");
+
+            $.ajax({
+                url: "rest/branches/version",
+                success: showVersionInfo,
+                error: showErrInLoadStatus
+            });
+
+            $.ajax({
+                url: "rest/branches/suites",
+                success: function(result) {
+                    $("#loadStatus").html("");
+                    showSuitesForTeamCityRunData(result);
+                    showFormAndSuitesForPrCheck(result);
+                    tryToFillAutocompleteLists();
+                    showCommentJiraForm(result);
+                },
+                error: showErrInLoadStatus
+            });
+
+            $.ajax({
+                url: "rest/branches/getServerIds",
+                success: setupAutocompleteList
+            });
+        }
+
+        function showSuitesForTeamCityRunData(result) {
+            var res = "";
+
+            for (var i = 0; i < result.length; i++) {
+                var chainAtServer = result[i];
+
+                // TODO multiple servers
+                if (chainAtServer.serverId != "apache")
+                    continue;
+
+                res += "Server: <input type='text' name='serverId' value='" + 
chainAtServer.serverId + "' readonly>";
+                res += "Chain: <input type='text' name='suiteId' value='" + 
chainAtServer.suiteId + "' readonly>";
+                res += "Branch: <input type='text' name='branchForTc' 
class='branchForTc" + chainAtServer.serverId +
+                    "' required> ";
+                res += "Ticket: <input type='text' name='ticketId'>";
+                res += "<button name='jira' type='button' 
onclick='trigBuild(\"tests\")'>Start tests</button>";
+                res += "<button name='jira' 
onclick='trigBuild(\"tests+jira\")'>Start tests and comment JIRA ticket on 
ready</button>";
+                //res += "<button name='git' 
onclick='trigBuild(\"tests+jira\")'>Start tests and comment GitHub PR on 
ready</button>";
+                /*
+                res+="Server: <input type='text' name='serverId' value=" + 
serverId +" readonly>" ;
+                res+="Pull Request #<input type='text' name='prId' 
onkeypress='return trigBuild(event)'> ";
+                res+="<button onclick='trigBuild()'>Run All</button><br>";
+                */
+            }
+
+            $("#suitesForRunAll").html(res);
+        }
+
+        /**
+         * This form allows user to startIgnite TeamCity Run All build.
+         */
+        function showCommentJiraForm(result) {
+            var res = "";
+
+            for (var i = 0; i < result.length; i++) {
+                var chainAtServer = result[i];
+
+                // TODO multiple servers
+                if (chainAtServer.serverId != "apache")
+                    continue;
+
+                res += "Server: <input type='text' name='serverId' value=" + 
chainAtServer.serverId +" readonly>" ;
+                res += "Chain: <input type='text' name='suiteId' value='" + 
chainAtServer.suiteId + "' readonly>";
+                res += "Branch: <input type='text' name='branchForTc' 
class='branchForTc" + chainAtServer.serverId +
+                    "' required> ";
+                res += "Ticket: <input type='text' name='ticketId'> ";
+                res += "<button name='action' 
onclick='notifyJira()'>Notify</button>";
+            }
+
+            $("#notifyJira").html(res);
+        }
+
+        /**
+         * Start Run All build on TeamCity and comment in JIRA ticket when 
build will be finished.
+         */
+        function trigBuild(trigCase) {
+            var fields = document.getElementById("suitesForRunAll").children;
+
+            var srvId = fields.namedItem("serverId").value;
+            var suiteId = fields.namedItem("suiteId").value;
+            var branchName = 
branchForTc(fields.namedItem("branchForTc").value);
+            var ticketId = 
jiraTicketNumber(fields.namedItem("ticketId").value);
+
+            triggerBuild(srvId, suiteId, branchName, false, trigCase !== 
"tests", ticketId)
+        }
+
+        /**
+         * Comment in JIRA ticket with results for the given PR.
+         */
+        function notifyJira() {
+            var fields = document.getElementById("notifyJira").children;
+
+            var srvId = fields.namedItem("serverId").value;
+            var suiteId = fields.namedItem("suiteId").value;
+            var branchName = 
branchForTc(fields.namedItem("branchForTc").value);
+            var ticketId = 
jiraTicketNumber(fields.namedItem("ticketId").value);
+
+            commentJira(srvId, suiteId, branchName, ticketId)
+        }
+
+        /**
+         * Converts PR number to branch for TeamCity.
+         *
+         * @param pr - Pull Request number.
+         * @returns {String} Branch for TeamCity.
+         */
+        function branchForTc(pr) {
+            var regExpr = /(\d*)/i;
+
+            if (regExpr.exec(pr)[0] === pr)
+                return "pull/" + regExpr.exec(pr)[0] + "/head";
+
+            return pr;
+        }
+
+        /**
+         * Converts JIRA ticket full name to the tickets number.
+         *
+         * @param ticket - JIRA ticket.
+         * @returns {string} JIRA ticket number.
+         */
+        function jiraTicketNumber(ticket) {
+            var regExpr = /(ignite-)?(\d*)/i;
+
+            return regExpr.exec(ticket)[2];
+        }
+
+        function showFormAndSuitesForPrCheck(result) {
+            var res = "";
+
+            for (var i = 0; i < result.length; i++) {
+                var chainAtServer = result[i];
+
+                res += "<form action='pr.html'>";
+                res += "Server: <input type='text' name='serverId' value=" + 
chainAtServer.serverId + " readonly>";
+                res += "Chain: <input type='text' name='suiteId' value=" + 
chainAtServer.suiteId + ">";
+                res += "Base branch: <input class='branchForTc" + 
chainAtServer.serverId +
+                    "' type='text' name='baseBranchForTc'  title='Etalon 
branch to take base data from, e.g refs/heads/master'> ";
+                res += "<b>Branch:</b> <input class='branchForTc" + 
chainAtServer.serverId +
+                    "' type='text' name='branchForTc' title='Tested branch, 
e.g. pull/4790/head or ignite-9349' required> ";
+                res += "<input type='submit' name='action' value='Latest' 
title='Show latest runs'>";
+                // res+="<input type='submit' name='action' value='Chain'>";
+                res += "<input type='submit' name='action' value='History' 
title='Show last 10 runs merged'>";
+                res += "</form>";
+            }
+
+            $("#suitesForPrCheck").html(res);
+        }
     </script>
 </head>
 <body>
diff --git a/ignite-tc-helper-web/src/main/webapp/services.html 
b/ignite-tc-helper-web/src/main/webapp/services.html
index f913fa4..2493653 100644
--- a/ignite-tc-helper-web/src/main/webapp/services.html
+++ b/ignite-tc-helper-web/src/main/webapp/services.html
@@ -1,219 +1,3 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <title>Services</title>
-    <link rel="icon" href="img/leaf-icon-png-7066.png">
-
-    <link rel="stylesheet" 
href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css";>
-
-    <link rel="stylesheet" href="css/style-1.5.css">
-
-    <script src="https://code.jquery.com/jquery-1.12.4.js";></script>
-    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js";></script>
-
-    <script src="js/common-1.6.js"></script>
-    <script src="js/testfails-2.1.js"></script>
-
-    <style>
-
-    </style>
-    <script>
-$(document).ready(function() {
-    $.getScript("js/common-1.6.js", function(data, textStatus, jqxhr){ });
-
-    $( document ).tooltip();
-    loadData();
-});
-
-function loadData() {
-    $("#loadStatus").html("<img 
src='https://www.wallies.com/filebin/images/loading_apple.gif' width=20px 
height=20px> Please wait");
-
-    $.ajax({
-        url: "rest/branches/version",
-        success: showVersionInfo,
-        error: showErrInLoadStatus
-    });
-
-    $.ajax({
-        url: "rest/branches/suites",
-        success: function(result) {
-            $("#loadStatus").html("");
-            showSuitesForTeamCityRunData(result);
-            showFormAndSuitesForPrCheck(result);
-            tryToFillAutocompleteLists();
-            showCommentJiraForm(result);
-        },
-        error: showErrInLoadStatus
-    });
-
-    $.ajax({
-        url: "rest/branches/getServerIds",
-        success: setupAutocompleteList
-    });
-}
-
-function showSuitesForTeamCityRunData(result) {
-    var res = "";
-
-    for (var i = 0; i < result.length; i++) {
-        var chainAtServer = result[i];
-
-        // TODO multiple servers
-        if (chainAtServer.serverId != "apache")
-            continue;
-
-        res += "Server: <input type='text' name='serverId' value='" + 
chainAtServer.serverId + "' readonly>";
-        res += "Chain: <input type='text' name='suiteId' value='" + 
chainAtServer.suiteId + "' readonly>";
-        res += "Branch: <input type='text' name='branchForTc' 
class='branchForTc" + chainAtServer.serverId +
-            "' required> ";
-        res += "Ticket: <input type='text' name='ticketId'>";
-        res += "<button name='jira' type='button' 
onclick='trigBuild(\"tests\")'>Start tests</button>";
-        res += "<button name='jira' onclick='trigBuild(\"tests+jira\")'>Start 
tests and comment JIRA ticket on ready</button>";
-        //res += "<button name='git' onclick='trigBuild(\"tests+jira\")'>Start 
tests and comment GitHub PR on ready</button>";
-        /*
-        res+="Server: <input type='text' name='serverId' value=" + serverId +" 
readonly>" ;
-        res+="Pull Request #<input type='text' name='prId' onkeypress='return 
trigBuild(event)'> ";
-        res+="<button onclick='trigBuild()'>Run All</button><br>";
-        */
-    }
-
-    $("#suitesForRunAll").html(res);
-}
-
-/**
- * This form allows user to startIgnite TeamCity Run All build.
- */
-function showCommentJiraForm(result) {
-    var res = "";
-
-    for (var i = 0; i < result.length; i++) {
-        var chainAtServer = result[i];
-
-        // TODO multiple servers
-        if (chainAtServer.serverId != "apache")
-            continue;
-
-        res += "Server: <input type='text' name='serverId' value=" + 
chainAtServer.serverId +" readonly>" ;
-        res += "Chain: <input type='text' name='suiteId' value='" + 
chainAtServer.suiteId + "' readonly>";
-        res += "Branch: <input type='text' name='branchForTc' 
class='branchForTc" + chainAtServer.serverId +
-            "' required> ";
-        res += "Ticket: <input type='text' name='ticketId'> ";
-        res += "<button name='action' onclick='notifyJira()'>Notify</button>";
-    }
-
-    $("#notifyJira").html(res);
-}
-
-/**
- * Start Run All build on TeamCity and comment in JIRA ticket when build will 
be finished.
- */
-function trigBuild(trigCase) {
-    var fields = document.getElementById("suitesForRunAll").children;
-
-    var srvId = fields.namedItem("serverId").value;
-    var suiteId = fields.namedItem("suiteId").value;
-    var branchName = branchForTc(fields.namedItem("branchForTc").value);
-    var ticketId = jiraTicketNumber(fields.namedItem("ticketId").value);
-
-    triggerBuild(srvId, suiteId, branchName, false, trigCase !== "tests", 
ticketId)
-}
-
-/**
- * Comment in JIRA ticket with results for the given PR.
- */
-function notifyJira() {
-    var fields = document.getElementById("notifyJira").children;
-
-    var srvId = fields.namedItem("serverId").value;
-    var suiteId = fields.namedItem("suiteId").value;
-    var branchName = branchForTc(fields.namedItem("branchForTc").value);
-    var ticketId = jiraTicketNumber(fields.namedItem("ticketId").value);
-
-    commentJira(srvId, suiteId, branchName, ticketId)
-}
-
-/**
- * Converts PR number to branch for TeamCity.
- *
- * @param pr - Pull Request number.
- * @returns {String} Branch for TeamCity.
- */
-function branchForTc(pr) {
-    var regExpr = /(\d*)/i;
-
-    if (regExpr.exec(pr)[0] === pr)
-        return "pull/" + regExpr.exec(pr)[0] + "/head";
-
-    return pr;
-}
-
-/**
- * Converts JIRA ticket full name to the tickets number.
- *
- * @param ticket - JIRA ticket.
- * @returns {string} JIRA ticket number.
- */
-function jiraTicketNumber(ticket) {
-    var regExpr = /(ignite-)?(\d*)/i;
-
-    return regExpr.exec(ticket)[2];
-}
-
-function showFormAndSuitesForPrCheck(result) {
-    var res = "";
-
-    for (var i = 0; i < result.length; i++) {
-        var chainAtServer = result[i];
-
-        res += "<form action='pr.html'>";
-        res += "Server: <input type='text' name='serverId' value=" + 
chainAtServer.serverId + " readonly>";
-        res += "Chain: <input type='text' name='suiteId' value=" + 
chainAtServer.suiteId + ">";
-        res += "Base branch: <input class='branchForTc" + 
chainAtServer.serverId +
-            "' type='text' name='baseBranchForTc'  title='Etalon branch to 
take base data from, e.g refs/heads/master'> ";
-        res += "<b>Branch:</b> <input class='branchForTc" + 
chainAtServer.serverId +
-            "' type='text' name='branchForTc' title='Tested branch, e.g. 
pull/4790/head or ignite-9349' required> ";
-        res += "<input type='submit' name='action' value='Latest' title='Show 
latest runs'>";
-        // res+="<input type='submit' name='action' value='Chain'>";
-        res += "<input type='submit' name='action' value='History' title='Show 
last 10 runs merged'>";
-        res += "</form>";
-    }
-
-    $("#suitesForPrCheck").html(res);
-}
-    </script>
-</head>
-<body>
-<div id="loadStatus"></div>
-
-<div class="formgroup">
-    Trigger new TeamCity Run All for a PR/Branch: <br>
-    <div id="suitesForRunAll"></div>
-</div>
-<br>
-
-<div class="formgroup">
-    Notify JIRA (save TC Bot visa to a ticket comment): <br>
-    <div id="notifyJira"></div>
-</div>
-<br>
-
-<br>Check results of branch/PR TeamCity Run All:
-<div id="suitesForPrCheck"></div>
-
-
-<!--Notify GitHub:   <br>
-<div id="notifyGitHub">
-    <form>
-        Server: <input type='text' name='serverId' value="apache" readonly>
-        Branch: <input type='text' name='branchForTc' required>
-        <input type='submit' name='action' value='Notify'>
-    </form>
-</div>
-<br>-->
-
-<div id="version"></div>
-
-<div style="visibility:hidden"><div id="triggerConfirm" title="Trigger 
Confirmation"></div><div id="triggerDialog" title="Trigger Result"></div></div>
-</body>
-</html>
\ No newline at end of file
+<script>
+    window.location='prs.html';
+</script>
\ No newline at end of file

Reply via email to