Skip to content

Commit b7f0d88

Browse files
authored
Revert "Link to full node log from the window"
1 parent 124e5ce commit b7f0d88

File tree

5 files changed

+5
-27
lines changed

5 files changed

+5
-27
lines changed

rest-api/src/main/java/com/cloudbees/workflow/rest/endpoints/RunAPI.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.jenkinsci.plugins.workflow.support.steps.input.InputStepExecution;
4040
import org.kohsuke.accmod.Restricted;
4141
import org.kohsuke.accmod.restrictions.DoNotUse;
42-
import org.kohsuke.accmod.restrictions.NoExternalUse;
4342
import org.kohsuke.stapler.QueryParameter;
4443
import org.kohsuke.stapler.Stapler;
4544
import org.kohsuke.stapler.interceptor.RequirePOST;
@@ -97,7 +96,7 @@ public RunExt doIndex() {
9796
return doDescribe();
9897
}
9998

100-
@Restricted(NoExternalUse.class) // WebMethod
99+
@Restricted(DoNotUse.class) // WebMethod
101100
@ServeJson
102101
public RunExt doDescribe() {
103102
return RunExt.create(getRun()).createWrapper();

rest-api/src/main/java/com/cloudbees/workflow/rest/external/AtomFlowNodeExt.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import com.cloudbees.workflow.rest.endpoints.flownode.Log;
2727
import com.cloudbees.workflow.rest.hal.Link;
28-
import com.cloudbees.workflow.util.ModelUtil;
2928
import org.jenkinsci.plugins.workflow.actions.ErrorAction;
3029
import org.jenkinsci.plugins.workflow.actions.LogAction;
3130
import org.jenkinsci.plugins.workflow.graph.FlowNode;
@@ -70,10 +69,8 @@ public static AtomFlowNodeExt create(FlowNode node, String execNodeName, ExecDur
7069
// It would be super awesome if we didn't need to make a throwaway object
7170
basic.addBasicNodeData(node, execNodeName, duration, startTimeMillis, status, error);
7271
if (basic.getStatus() != StatusExt.NOT_EXECUTED && Stapler.getCurrentRequest() != null) {
73-
LogAction la = node.getAction(LogAction.class);
74-
if (la != null) {
72+
if (node.getAction(LogAction.class) != null) {
7573
basic.get_links().setLog(Link.newLink(Log.getUrl(node)));
76-
basic.get_links().setConsole(Link.newLink(ModelUtil.getFullItemUrl(node) + la.getUrlName()));
7774
}
7875
}
7976
basic.addParentNodeRefs(node);

rest-api/src/main/java/com/cloudbees/workflow/rest/external/FlowNodeExt.java

-12
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,7 @@ public void setPauseDurationMillis(long pauseDurationMillis) {
143143
}
144144

145145
public static final class FlowNodeLinks extends Links {
146-
/** Link to rest API for the console */
147146
private Link log;
148-
/** Link to the human consumable console page */
149-
private Link console;
150147

151148
@JsonInclude(JsonInclude.Include.NON_NULL)
152149
public Link getLog() {
@@ -156,15 +153,6 @@ public Link getLog() {
156153
public void setLog(Link log) {
157154
this.log = log;
158155
}
159-
160-
@JsonInclude(JsonInclude.Include.NON_NULL)
161-
public Link getConsole() {
162-
return console;
163-
}
164-
165-
public void setConsole(Link console) {
166-
this.console = console;
167-
}
168156
}
169157

170158
public static FlowNodeExt create(FlowNode node) {

rest-api/src/test/java/com/cloudbees/workflow/rest/endpoints/FlowNodeAPITest.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import com.cloudbees.workflow.Util;
2727
import com.cloudbees.workflow.rest.external.AtomFlowNodeExt;
28-
import com.cloudbees.workflow.rest.external.FlowNodeExt;
2928
import com.cloudbees.workflow.rest.external.FlowNodeLogExt;
3029
import com.cloudbees.workflow.rest.external.RunExt;
3130
import com.cloudbees.workflow.rest.external.StageNodeExt;
@@ -134,10 +133,8 @@ private void assert_log_ok(JenkinsRule.WebClient webClient, JSONReadWrite jsonRe
134133
jsonResponse = stageDescription.getWebResponse().getContentAsString();
135134
StageNodeExt stageDesc = jsonReadWrite.fromString(jsonResponse, StageNodeExt.class);
136135

137-
FlowNodeExt.FlowNodeLinks links = stageDesc.getStageFlowNodes().get(0).get_links();
138-
String logUrl = links.getLog().href;
136+
String logUrl = stageDesc.getStageFlowNodes().get(0).get_links().getLog().href;
139137
Assert.assertEquals("/jenkins/job/Noddy%20Job/1/execution/node/6/wfapi/log", logUrl);
140-
Assert.assertEquals("/jenkins/job/Noddy%20Job/1/execution/node/6/log", links.getConsole().href);
141138

142139
Page nodeLog = webClient.goTo(Util.removeRootUrl(logUrl), "application/json");
143140
jsonResponse = nodeLog.getWebResponse().getContentAsString();

ui/src/main/js/view/templates/stage-logs.hbs

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@
44
{{#if this._links.log.href}}
55
<div class="node-log-frame {{this.status}}" cbwf-controller="node-log" objectUrl="{{this._links.log.href}}">
66
<div class="node-name"><span class="glyphicon glyphicon-collapse-down" title="Expand"></span><span class="glyphicon glyphicon-collapse-up" title="Collapse"></span>
7-
<a class="log-link" href="{{this._links.console.href}}">
87
{{this.name}}
98
{{#if this.parameterDescription}}
10-
-- {{this.parameterDescription}}
9+
-- {{this.parameterDescription}} --
1110
{{/if}}
12-
</a>
1311
{{#if this.durationMillis}} (self time {{formatTime this.durationMillis}}){{/if}}
14-
1512
</div>
1613
<div class="log-details"></div>
1714
</div>
@@ -22,4 +19,4 @@
2219
{{/if}}
2320
{{/ifCond}}
2421
{{/each}}
25-
</div>
22+
</div>

0 commit comments

Comments
 (0)