[GitHub] SomeFire commented on a change in pull request #27: IGNITE-9770 Add 'Re-run possible blockers' button

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] SomeFire commented on a change in pull request #27: IGNITE-9770 Add 'Re-run possible blockers' button

GitBox
SomeFire commented on a change in pull request #27: IGNITE-9770 Add 'Re-run possible blockers' button
URL: https://github.com/apache/ignite-teamcity-bot/pull/27#discussion_r223332768
 
 

 ##########
 File path: ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
 ##########
 @@ -355,59 +384,82 @@ function triggerBuild(serverId, suiteId, branchName, top, observe, ticketId) {
     });
 }
 
-function triggerBuilds(serverId, suiteIdList, branchName, top) {
-    var res = "Trigger builds at server: " + serverId + "<br>" +
-        "Branch:" + branchName + "<br>Top: " + top + "<br>";
+function triggerBuilds(serverId, suiteIdList, branchName, top, observe, ticketId) {
+    var possibleBlockersNotFound = suiteIdList.length === 0;
+    var res = "";
 
-    var partsOfStr = suiteIdList.split(',');
+    if (possibleBlockersNotFound) {
+        res = "Possible Blockers not found!";
+    }
+    else {
+        res = "Trigger builds at server: " + serverId + "<br>" +
+            "Branch:" + branchName + "<br>Top: " + top + "<br>";
+
+        var partsOfStr = suiteIdList.split(',');
 
-    for (var i = 0; i < partsOfStr.length; i++) {
-        var suite = partsOfStr[i];
-        res += "Suite ID: " + suite + "<br>";
+        for (var i = 0; i < partsOfStr.length; i++) {
+            var suite = partsOfStr[i];
+            res += "Suite ID: " + suite + "<br>";
+        }
     }
+
     var triggerConfirm = $("#triggerConfirm");
 
     triggerConfirm.html(res);
 
-    triggerConfirm.dialog({
-        modal: true,
-        buttons: {
-            "Run": function() {
-                $(this).dialog("close");
-
-                var queueAtTop = isDefinedAndFilled(top) && top
-                $.ajax({
-                    url: 'rest/build/triggerBuilds',
-                    data: {
-                        "serverId": serverId,
-                        "suiteIdList": suiteIdList,
-                        "branchName": branchName,
-                        "top": queueAtTop
-                    },
-                    success: function(result) {
-                        var dialog = $("#triggerDialog");
-
-                        dialog.html("Trigger builds at server: " + serverId + "<br>" +
-                            " Suites " + suiteIdList + "<br>Branch:" + branchName + "<br>Top: " + top +
-                            "<br><br> Result: " + result.result);
-                        dialog.dialog({
-                            modal: true,
-                            buttons: {
-                                "Ok": function() {
-                                    $(this).dialog("close");
+    if (possibleBlockersNotFound){
 
 Review comment:
   Add space before opening brace.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services