Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

configuration.
  • Loading branch information...
commit ff4b02559534c4c67ef95a13defcd7a4fc850a1b 1 parent 8921d49
Fred G authored March 20, 2012
3  core/src/main/java/hudson/model/queue/CauseOfBlockage.java
... ...
@@ -1,5 +1,6 @@
1 1
 package hudson.model.queue;
2 2
 
  3
+import hudson.console.HyperlinkNote;
3 4
 import hudson.model.Queue.Task;
4 5
 import hudson.model.Node;
5 6
 import hudson.model.Messages;
@@ -102,7 +103,7 @@ public BecauseNodeIsBusy(Node node) {
102 103
         }
103 104
 
104 105
         public String getShortDescription() {
105  
-            return Messages.Queue_WaitingForNextAvailableExecutorOn(node.getNodeName());
  106
+            return Messages.Queue_WaitingForNextAvailableExecutorOn(HyperlinkNote.encodeTo("/computer/"+ node.getNodeName(), node.getNodeName()));
106 107
         }
107 108
     }
108 109
 

6 notes on commit ff4b025

Dean Yu
Collaborator
dty commented on ff4b025 May 03, 2012

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

Fred G
Collaborator

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

Dean Yu
Collaborator
dty commented on ff4b025 May 03, 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.

Fred G
Collaborator

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

Fred G
Collaborator

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?

Fred G
Collaborator

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.