Skip to content
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

Closed
wants to merge 12 commits into from

Conversation

zzzadruga
Copy link
Contributor

No description provided.

@@ -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)
Copy link
Contributor

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]));
Copy link
Contributor

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>&nbsp;&nbsp;";
Copy link
Contributor

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>&nbsp;&nbsp;";

res += "<button onclick='triggerBuilds(\"" + server.serverId + "\", \"" + blockersList + "\", \"" + server.branchName + "\", false, true)'> Re-run possible blockers & Comment JIRA</button>";
Copy link
Contributor

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)' ";
Copy link
Contributor

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)' ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too long line.

Nikolai Kulagin added 3 commits October 5, 2018 12:06
# 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

/** {@inheritDoc} */
@Override public int hashCode() {

Copy link
Contributor

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()){
Copy link
Contributor

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{
Copy link
Contributor

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) {
Copy link
Contributor

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){
Copy link
Contributor

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;
Copy link
Contributor

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. */
Copy link
Contributor

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");
Copy link
Contributor

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,
Copy link
Contributor

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 = "";
Copy link
Contributor

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;
Copy link
Contributor

@SomeFire SomeFire Oct 9, 2018

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.

@asfgit asfgit closed this in bd96ed3 Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants