Skip to content
Permalink
Browse files
Checkbox 'Delete all files in checkout directory before each snapshot…
… dependency build' added (#161)

Signed-off-by: Ivan Rakov <ivan.glukos@gmail.com>
  • Loading branch information
sergeyuttsel authored and glukos committed May 25, 2020
1 parent 9d2f5c4 commit 6d9f9a5d78293de5a9377786f3227c5bb101c4f9
Showing 3 changed files with 16 additions and 8 deletions.
@@ -265,6 +265,7 @@ private void insertTicketStatus(Set<MuteInfo> mutes, Collection<Ticket> tickets,
@Nullable String ticketId,
@Nullable String prNum,
@Nullable String baseBranchForTc,
@Nonnull Boolean cleanSources,
@Nullable ITcBotUserCreds prov) {
String jiraRes = "";

@@ -295,7 +296,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, cleanSources, 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("cleanSources") Boolean cleanSources
) {
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, cleanSources, prov);

return new TriggerResult("Tests started." + (!jiraRes.isEmpty() ? "<br>" + jiraRes : ""));
}
@@ -256,7 +256,7 @@ function showChainCurrentStatusData(chain, settings) {
"\"" + chain.branchName + "\", " +
"\"" + parentSuitId + "\", " +
"\"\", " + // ticket id
"\"" + baseBranchForTc + "\")'>Comment JIRA</button>&nbsp;&nbsp;";
"\"" + baseBranchForTc + "\")'>Comment JIRA</button><br>";

var blockersList = "";

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

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

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

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

@@ -402,7 +407,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, cleanSources) {
var queueAtTop = isDefinedAndFilled(top) && top;
var observeJira = isDefinedAndFilled(observe) && observe;
var suiteIdsNotExists = !isDefinedAndFilled(suiteIdList) || suiteIdList.length === 0;
@@ -467,7 +472,8 @@ function triggerBuilds(tcServerCode, parentSuiteId, suiteIdList, branchName, top
"observe": observeJira,
"ticketId": ticketId,
"prNum": prNum,
"baseBranchForTc": baseBranchForTc
"baseBranchForTc": baseBranchForTc,
"cleanSources": cleanSources
},
success: successDialog,
error: showErrInLoadStatus

0 comments on commit 6d9f9a5

Please sign in to comment.