Skip to content

Commit

Permalink
Prevent infinite loop in multijob view, fixes #255
Browse files Browse the repository at this point in the history
  • Loading branch information
balakine committed Jul 25, 2024
1 parent b70f9e1 commit 80676e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,12 @@ public String toString() {
+ ", buildNumber=" + buildNumber + "]";
}

@Exported
@Exported
public String getBuildID() {
return buildID;
}

@Exported
@CheckForNull
public Run<?,?> getBuild() {
if (buildID != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
<j:set var="lastPhase" value=""/>
<j:set var="builders" value="${it.getBuilders()}"/>
<j:set var="indent" value="1"/>
<j:new var="parents" className="java.util.ArrayDeque"/>
<j:invoke on="${parents}" method="push">
<j:arg value="${it.getExternalizableId()}"/>
</j:invoke>

<st:include page="table.jelly" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,21 @@
</tr>
</j:choose>
<j:choose>
<j:when test="${builder.isMultiJobBuild()}">
<j:when test="${builder.isMultiJobBuild() and not parents.contains(builder.buildID)}">
<j:set var="oldLastPhase" value="${lastPhase}"/>
<j:set var="oldBuilders" value="${builders}"/>
<j:set var="oldIndent" value="${indent}"/>

<j:set var="lastPhase" value=""/>
<j:set var="builders" value="${builder.build.getSubBuilds()}"/>
<j:set var="indent" value="${indent + 2}"/>
<j:invoke on="${parents}" method="push">
<j:arg value="${builder.buildID}"/>
</j:invoke>

<st:include page="table.jelly" />

<j:invoke on="${parents}" method="pop"/>
<j:set var="lastPhase" value="${oldLastPhase}"/>
<j:set var="builders" value="${oldLastBuilders}"/>
<j:set var="indent" value="${oldIndent}"/>
Expand Down

0 comments on commit 80676e0

Please sign in to comment.