提交 add119d3 编写于 作者: L lvotypko 提交者: Kohsuke Kawaguchi

Correction of returned url

上级 d1b2ba7e
......@@ -124,6 +124,16 @@ public class MatrixBuild extends AbstractBuild<MatrixProject,MatrixBuild> {
return MatrixBuild.this.getRun(combination);
}
/**
* Return absolute url of run {@link MatrixRun} which belongs to a given build {@link MatrixBuild}.
* If there is no run which belongs to the build, return url of run, which belongs to the nearest previous build.
*
*/
public String getNearestRunUrl(){
String url = Jenkins.getInstance().getRootUrl() + getRun().getUrl();
return url;
}
public String getShortUrl() {
return Util.rawEncode(combination.toString());
}
......@@ -235,7 +245,7 @@ public class MatrixBuild extends AbstractBuild<MatrixProject,MatrixBuild> {
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) {
try {
MatrixRun item = getRun(Combination.fromString(token));
if(item!=null)
if(item!=null && item.getNumber()==this.getNumber()) //do not return run of other matrix build
return item;
} catch (IllegalArgumentException _) {
// failed to parse the token as Combination. Must be something else
......
......@@ -35,7 +35,7 @@ THE SOFTWARE.
<img src="${imagesURL}/24x24/grey.png" tooltip="${%Not run}" alt="${%Not run}" height="24" width="24"/>
</j:when>
<j:otherwise>
<a href="${p.shortUrl}/" class="model-link">
<a href="${p.nearestRunUrl}/" class="model-link">
<img src="${imagesURL}/24x24/${b.buildStatusUrl}" tooltip="${p.tooltip} ${it.number!=b.number?(it.isBuilding()?'- pending' : '- skipped'):''}" alt="${p.tooltip}" style="${it.number!=b.number?'opacity:0.5':''}" height="24" width="24"/>
<j:if test="${empty(o.x) and empty(o.y)}">
${p.combination.toString(o.z)}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册