New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-9770 Add 'Re-run possible blockers' button #27
Conversation
@@ -167,7 +167,8 @@ private String observeJira( | |||
|
|||
BuildObserver observer = CtxListener.getInjector(context).getInstance(BuildObserver.class); | |||
|
|||
observer.observe(build, srvId, prov, "ignite-" + ticketId); | |||
for (Build build : builds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't observe builds for the same PR separately, because in such case we Bot will comment same ticket for every build. We should wait while all of the builds will be finished and comment only once.
} | ||
|
||
return new SimpleResult("OK"); | ||
if (observe != null && observe) | ||
jiraRes = observeJira(srvId, branchName, ticketId, helper, teamcity, prov, buildList.toArray(new Build[0])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant argument new Build[0]
.
} | ||
} | ||
|
||
res += "<button onclick='triggerBuilds(\"" + server.serverId + "\", \"" + blockersList + "\", \"" + server.branchName + "\", false, false)'> Re-run possible blockers</button> "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too long line. Also, add <br>
tag.
|
||
res += "<button onclick='triggerBuilds(\"" + server.serverId + "\", \"" + blockersList + "\", \"" + server.branchName + "\", false, false)'> Re-run possible blockers</button> "; | ||
|
||
res += "<button onclick='triggerBuilds(\"" + server.serverId + "\", \"" + blockersList + "\", \"" + server.branchName + "\", false, true)'> Re-run possible blockers & Comment JIRA</button>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too long line. Also, add <br>
tag and move this under settings.isJiraAvailable()
check.
@@ -125,11 +124,11 @@ function showChainCurrentStatusData(server, settings) { | |||
if (suitesFailedList.length !== 0 && isDefinedAndFilled(server.serverId) && isDefinedAndFilled(server.branchName)) { | |||
mInfo += "Trigger failed " + cntFailed + " builds"; | |||
mInfo += " <a href='javascript:void(0);' "; | |||
mInfo += " onClick='triggerBuilds(\"" + server.serverId + "\", \"" + suitesFailedList + "\", \"" + server.branchName + "\", false)' "; | |||
mInfo += " onClick='triggerBuilds(\"" + server.serverId + "\", \"" + suitesFailedList + "\", \"" + server.branchName + "\", false, false)' "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too long line.
mInfo += " title='trigger builds'>in queue</a> "; | ||
|
||
mInfo += " <a href='javascript:void(0);' "; | ||
mInfo += " onClick='triggerBuilds(\"" + server.serverId + "\", \"" + suitesFailedList + "\", \"" + server.branchName + "\", true)' "; | ||
mInfo += " onClick='triggerBuilds(\"" + server.serverId + "\", \"" + suitesFailedList + "\", \"" + server.branchName + "\", true, false)' "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too long line.
…possible button&comment jira' button
# Conflicts: # ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java # ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuild.java
# Conflicts: # ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/TriggerBuild.java
|
||
/** {@inheritDoc} */ | ||
@Override public int hashCode() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line.
*/ | ||
public boolean isFinished(IAnalyticsEnabledTeamcity teamcity) { | ||
for (Map.Entry<Build, Boolean> entry : finishedBuilds.entrySet()){ | ||
if (!entry.getValue()){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need space before opening brace.
import org.apache.ignite.ci.tcmodel.result.Build; | ||
import org.apache.ignite.ci.user.ICredentialsProv; | ||
|
||
public class BuildsInfo{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need space before opening brace.
|
||
var partsOfStr = suiteIdList.split(','); | ||
if (possibleBlockersNotFound) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove braces for one-line if
statement.
buttons: { | ||
"Ok": function() { | ||
$(this).dialog("close"); | ||
if (possibleBlockersNotFound){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space before opening brace.
@@ -0,0 +1,100 @@ | |||
package org.apache.ignite.ci.observer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed license.
/** Branch name. */ | ||
public final String branchName; | ||
|
||
/** Prov. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Credentials.
@@ -71,14 +72,16 @@ public SimpleResult triggerBuild( | |||
if (!prov.hasAccess(srvId)) | |||
throw ServiceUnauthorizedException.noCreds(srvId); | |||
|
|||
if (isNullOrEmpty(suiteIdList)) | |||
return new SimpleResult("Error: nothing to run"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed dot.
@@ -77,7 +78,7 @@ | |||
@NotNull public String triggerBuildAndObserve( | |||
@Nullable String srvId, | |||
@Nullable String branchForTc, | |||
@Nullable String suiteId, | |||
@Nullable String suiteIdList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this method to triggerBuildsAndObserve
.
@@ -214,14 +236,21 @@ function addBlockersData(server, settings) { | |||
return ""; | |||
|
|||
var blockers = ""; | |||
var blockersList = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable is never used.
var queueAtTop = isDefinedAndFilled(top) && top; | ||
var observeJira = isDefinedAndFilled(observe) && observe; | ||
var suiteIdsNotFound = suiteIdList.length === 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will not work if suiteIdList
is undefined.
No description provided.