Skip to content
Permalink
Browse files
Checkbox 'delete all files in checkout directory before each snapshot…
… dependency build' #167

Signed-off-by: Ivan Rakov <ivan.glukos@gmail.com>
  • Loading branch information
sergeyuttsel authored and glukos committed Jul 9, 2020
1 parent 6fa6ce6 commit 272ad2844e91b026960d59071f5c8b2e1802b2d0
Showing 4 changed files with 21 additions and 13 deletions.
@@ -267,6 +267,7 @@ private void insertTicketStatus(Set<MuteInfo> mutes, Collection<Ticket> tickets,
@Nullable String ticketId,
@Nullable String prNum,
@Nullable String baseBranchForTc,
@Nonnull Boolean cleanRebuild,
@Nullable ITcBotUserCreds prov) {
String jiraRes = "";

@@ -297,7 +298,7 @@ private void insertTicketStatus(Set<MuteInfo> mutes, Collection<Ticket> tickets,
Set<Integer> buildidsToSync = new HashSet<>();

for (int i = 0; i < suiteIds.length; i++) {
T2<Build, Set<Integer>> objects = teamcity.triggerBuild(suiteIds[i], branchForTc, false, top != null && top, new HashMap<>(),
T2<Build, Set<Integer>> objects = teamcity.triggerBuild(suiteIds[i], branchForTc, cleanRebuild, top != null && top, new HashMap<>(),
false, "");
buildidsToSync.addAll(objects.get2());
builds[i] = objects.get1();
@@ -83,7 +83,8 @@ public TriggerResult triggerBuilds(
@Nullable @QueryParam("observe") Boolean observe,
@Nullable @QueryParam("ticketId") String ticketId,
@Nullable @QueryParam("prNum") String prNum,
@Nullable @QueryParam("baseBranchForTc") String baseBranchForTc
@Nullable @QueryParam("baseBranchForTc") String baseBranchForTc,
@Nonnull @QueryParam("cleanRebuild") Boolean cleanRebuild
) {
ITcBotUserCreds prov = ITcBotUserCreds.get(req);
Injector injector = CtxListener.getInjector(ctx);
@@ -95,7 +96,7 @@ public TriggerResult triggerBuilds(

String jiraRes = injector
.getInstance(TcBotTriggerAndSignOffService.class)
.triggerBuildsAndObserve(srvCodeOrAlias, branchForTc, parentSuiteId, suiteIdList, top, observe, ticketId, prNum, baseBranchForTc, prov);
.triggerBuildsAndObserve(srvCodeOrAlias, branchForTc, parentSuiteId, suiteIdList, top, observe, ticketId, prNum, baseBranchForTc, cleanRebuild, prov);

return new TriggerResult("Tests started." + (!jiraRes.isEmpty() ? "<br>" + jiraRes : ""));
}
@@ -237,12 +237,12 @@ function showChainCurrentStatusData(chain, settings) {
moreInfoTxt += "Trigger failed " + cntFailed + " builds";
moreInfoTxt += " <a href='javascript:void(0);' ";
moreInfoTxt += " onClick='triggerBuilds(\"" + srvCodeForTriggering + "\", \"" + parentSuitId + "\", " +
"\"" + suitesFailedList + "\", \"" + chain.branchName + "\", false, false, null, \"" + chain.prNum + "\", null)' ";
"\"" + suitesFailedList + "\", \"" + chain.branchName + "\", false, false, null, \"" + chain.prNum + "\", null, false)' ";
moreInfoTxt += " title='trigger builds'>in queue</a> ";

moreInfoTxt += " <a href='javascript:void(0);' ";
moreInfoTxt += " onClick='triggerBuilds(\"" + srvCodeForTriggering + "\", \"" + parentSuitId + "\", " +
"\"" + suitesFailedList + "\", \"" + chain.branchName + "\", true, false, null, \"" + chain.prNum + "\", null)' ";
"\"" + suitesFailedList + "\", \"" + chain.branchName + "\", true, false, null, \"" + chain.prNum + "\", null, false)' ";
moreInfoTxt += " title='trigger builds'>on top</a><br>";
}

@@ -302,7 +302,7 @@ function showChainCurrentStatusData(chain, settings) {
"\"" + chain.branchName + "\", " +
"\"" + parentSuitId + "\", " +
"\"\", " + // ticket id
"\"" + baseBranchForTc + "\")'>Comment JIRA</button>&nbsp;&nbsp;";
"\"" + baseBranchForTc + "\")'>Comment JIRA</button><br>";

var blockersList = "";

@@ -319,6 +319,8 @@ function showChainCurrentStatusData(chain, settings) {
}
}

res += "<label for='cleanRebuild'><input id='cleanRebuild' type='checkbox'>Delete all files in checkout directory before each snapshot dependency build</label><br>"

res += "<button onclick='triggerBuilds(" +
"\"" + srvCodeForTriggering + "\", " +
"\"" + parentSuitId + "\", " +
@@ -328,7 +330,8 @@ function showChainCurrentStatusData(chain, settings) {
"false, " + //observe
"null, " + // ticketId
"\"" + + chain.prNum + "\", " +
"\"" + baseBranchForTc + "\" " +
"\"" + baseBranchForTc + "\", " +
"document.getElementById(\"cleanRebuild\").checked" +
")'> " +
"Re-run possible blockers</button><br>";

@@ -341,7 +344,9 @@ function showChainCurrentStatusData(chain, settings) {
"false, " + //observe
"null, " + // ticketId
"\"" + chain.prNum + "\", " + //prNum
"\"" + baseBranchForTc + "\")'> " +
"\"" + baseBranchForTc + "\", " +
"document.getElementById(\"cleanRebuild\").checked" +
")'> " +
"Re-run possible blockers (top queue)</button><br>";
}

@@ -445,7 +450,7 @@ function filterPossibleBlocker(suite) {
return null;
}

function triggerBuilds(tcServerCode, parentSuiteId, suiteIdList, branchName, top, observe, ticketId, prNum, baseBranchForTc) {
function triggerBuilds(tcServerCode, parentSuiteId, suiteIdList, branchName, top, observe, ticketId, prNum, baseBranchForTc, cleanRebuild=false) {
var queueAtTop = isDefinedAndFilled(top) && top;
var observeJira = isDefinedAndFilled(observe) && observe;
var suiteIdsNotExists = !isDefinedAndFilled(suiteIdList) || suiteIdList.length === 0;
@@ -510,7 +515,8 @@ function triggerBuilds(tcServerCode, parentSuiteId, suiteIdList, branchName, top
"observe": observeJira,
"ticketId": ticketId,
"prNum": prNum,
"baseBranchForTc": baseBranchForTc
"baseBranchForTc": baseBranchForTc,
"cleanRebuild": cleanRebuild
},
success: successDialog,
error: showErrInLoadStatus
@@ -732,12 +738,12 @@ function showSuiteData(suite, settings, prNum) {
mInfo += " Trigger build: ";
mInfo += "<a href='javascript:void(0);' ";
mInfo += " onClick='triggerBuilds(\"" + suite.serverId + "\", null, \"" +
suite.suiteId + "\", \"" + suite.branchName + "\", false, false, null, \"" + prNum + "\", null)' ";
suite.suiteId + "\", \"" + suite.branchName + "\", false, false, null, \"" + prNum + "\", null, false)' ";
mInfo += " title='trigger build' >queue</a> ";

mInfo += "<a href='javascript:void(0);' ";
mInfo += " onClick='triggerBuilds(\"" + suite.serverId + "\", null, \"" +
suite.suiteId + "\", \"" + suite.branchName + "\", true, false, null, \"" + prNum + "\", null)' ";
suite.suiteId + "\", \"" + suite.branchName + "\", true, false, null, \"" + prNum + "\", null, false)' ";
mInfo += " title='trigger build at top of queue'>top</a><br>";
}

@@ -172,7 +172,7 @@ private File logsDir() {
String comments = " <comment><text>" +
Strings.nullToEmpty(freeTextComments) + ", " +
"Build triggered from Ignite TC Bot" +
" [cleanRebuild=" + cleanRebuild + ", top=" + queueAtTop + "]" +
" [cleanSources=" + cleanRebuild + ", cleanRebuild=" + cleanRebuild + ", top=" + queueAtTop + "]" +
"</text></comment>\n";

Map<String, Object> props = new HashMap<>();

0 comments on commit 272ad28

Please sign in to comment.