Skip to content
Browse files

Added another hyperlink to the console output of a blocked matrix build

configuration.
  • Loading branch information...
1 parent 8921d49 commit ff4b02559534c4c67ef95a13defcd7a4fc850a1b @fredg02 fredg02 committed Mar 20, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/src/main/java/hudson/model/queue/CauseOfBlockage.java
View
3 core/src/main/java/hudson/model/queue/CauseOfBlockage.java
@@ -1,5 +1,6 @@
package hudson.model.queue;
+import hudson.console.HyperlinkNote;
import hudson.model.Queue.Task;
import hudson.model.Node;
import hudson.model.Messages;
@@ -102,7 +103,7 @@ public BecauseNodeIsBusy(Node node) {
}
public String getShortDescription() {
- return Messages.Queue_WaitingForNextAvailableExecutorOn(node.getNodeName());
+ return Messages.Queue_WaitingForNextAvailableExecutorOn(HyperlinkNote.encodeTo("/computer/"+ node.getNodeName(), node.getNodeName()));
}
}

6 comments on commit ff4b025

@dty
Jenkins member
dty commented on ff4b025 May 3, 2012

This breaks the JSON representation because the hyperlink contains a non-printing character.

@fredg02
Jenkins member
fredg02 commented on ff4b025 May 3, 2012

Oh, I'm sorry about that. Is there any way we can escape non-printing characters for the JSON representation?

@dty
Jenkins member
dty commented on ff4b025 May 4, 2012

Well I think a better place for the note is in usages of getShortDescription where it's being used for display purposes, like in the console itself.

Or, have a new method that returns an annotated version, and let callers decide which method to use.

@fredg02
Jenkins member
fredg02 commented on ff4b025 May 4, 2012

Ok. I'll take a look at it tomorrow.

@fredg02
Jenkins member
fredg02 commented on ff4b025 May 5, 2012

I opened a pull request (#467).
Please let me know if this what you had in mind.
BTW: How exactly can the broken JSON representation be reproduced?

@fredg02
Jenkins member
fredg02 commented on ff4b025 May 6, 2012

Nevermind. I found out how to reproduce the broken JSON. :)
It affects all remote APIs.

The error was also described here: https://issues.jenkins-ci.org/browse/JENKINS-10468?focusedCommentId=161967&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-161967 (only the issue in the first comment, the original issue has a different cause)

Please sign in to comment.
Something went wrong with that request. Please try again.