Skip to content

Commit fa7eb90

Browse files
author
Stuart Rowe
committed
Update LabelAction messages for Build and WaitForBuild steps
1 parent 589d5c2 commit fa7eb90

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ public boolean start() throws Exception {
8888
final ParameterizedJobMixIn.ParameterizedJob project = (ParameterizedJobMixIn.ParameterizedJob) item;
8989
getContext().get(TaskListener.class).getLogger().println("Scheduling project: " + ModelHyperlinkNote.encodeTo(project));
9090

91-
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_building_(project.getFullDisplayName())));
91+
if (!step.getWait() || step.getWaitForStart()) {
92+
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_scheduling_(project.getFullDisplayName())));
93+
} else {
94+
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_building_(project.getFullDisplayName())));
95+
}
9296

9397
if (step.getWait() || step.getWaitForStart()) {
9498
StepContext context = getContext();
@@ -115,6 +119,12 @@ public boolean start() throws Exception {
115119
Queue.Task task = (Queue.Task) item;
116120
getContext().get(TaskListener.class).getLogger().println("Scheduling item: " + ModelHyperlinkNote.encodeTo(item));
117121
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_building_(task.getFullDisplayName())));
122+
if (!step.getWait() || step.getWaitForStart()) {
123+
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_scheduling_(task.getFullDisplayName())));
124+
} else {
125+
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_building_(task.getFullDisplayName())));
126+
}
127+
118128
if (step.getWait() || step.getWaitForStart()) {
119129
StepContext context = getContext();
120130
actions.add(new BuildTriggerAction(context, step.isPropagate(), step.getWaitForStart()));

src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/WaitForBuildStepExecution.java

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
import hudson.model.Run;
1111
import hudson.model.TaskListener;
1212
import jenkins.model.Jenkins;
13+
14+
import org.jenkinsci.plugins.workflow.actions.LabelAction;
15+
import org.jenkinsci.plugins.workflow.graph.FlowNode;
1316
import org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl;
1417
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException;
1518
import org.jenkinsci.plugins.workflow.steps.StepContext;
@@ -39,6 +42,9 @@ public boolean start() throws Exception {
3942
throw new AbortException("No build exists with runId " + step.getRunId());
4043
}
4144

45+
FlowNode node = getContext().get(FlowNode.class);
46+
node.addAction(new LabelAction(Messages.WaitForBuildStepExecution_waitfor_(step.getRunId())));
47+
4248
String runHyperLink = ModelHyperlinkNote.encodeTo("/" + run.getUrl(), run.getFullDisplayName());
4349
TaskListener taskListener = getContext().get(TaskListener.class);
4450
if (run.isBuilding()) {

src/main/resources/org/jenkinsci/plugins/workflow/support/steps/build/Messages.properties

+2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ BuildTriggerStep.no_job_configured=No job configured
2828
BuildTriggerStep.cannot_find=No such job {0}
2929
BuildTriggerStep.unsupported=Building a {0} is not supported
3030
BuildTriggerStepExecution.building_=Building {0}
31+
BuildTriggerStepExecution.scheduling_=Scheduling {0}
3132
BuildTriggerStepExecution.convertedParameterDescription=\
3233
{0} (Automatically converted to {1} because {2} passed the parameter using a different type)
3334
WaitForBuildStep.cannot_find=No such run with externalizable id {0}
3435
WaitForBuildStep.no_run_configured=No runId configured
36+
WaitForBuildStepExecution.waitfor_=Wait for {0} to complete

0 commit comments

Comments
 (0)