Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LabelAction messages for Build and WaitForBuild steps #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@
final ParameterizedJobMixIn.ParameterizedJob project = (ParameterizedJobMixIn.ParameterizedJob) item;
getContext().get(TaskListener.class).getLogger().println("Scheduling project: " + ModelHyperlinkNote.encodeTo(project));

node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_building_(project.getFullDisplayName())));
if (!step.getWait() || step.getWaitForStart()) {
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_scheduling_(project.getFullDisplayName())));
} else {
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_building_(project.getFullDisplayName())));
}

if (step.getWait() || step.getWaitForStart()) {
StepContext context = getContext();
Expand All @@ -115,6 +119,12 @@
Queue.Task task = (Queue.Task) item;
getContext().get(TaskListener.class).getLogger().println("Scheduling item: " + ModelHyperlinkNote.encodeTo(item));
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_building_(task.getFullDisplayName())));
if (!step.getWait() || step.getWaitForStart()) {

Check warning on line 122 in src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 122 is only partially covered, 3 branches are missing
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_scheduling_(task.getFullDisplayName())));
} else {
node.addAction(new LabelAction(Messages.BuildTriggerStepExecution_building_(task.getFullDisplayName())));

Check warning on line 125 in src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 125 is not covered by tests
}

if (step.getWait() || step.getWaitForStart()) {
StepContext context = getContext();
actions.add(new BuildTriggerAction(context, step.isPropagate(), step.getWaitForStart()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import hudson.model.Run;
import hudson.model.TaskListener;
import jenkins.model.Jenkins;

import org.jenkinsci.plugins.workflow.actions.LabelAction;
import org.jenkinsci.plugins.workflow.graph.FlowNode;
import org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl;
import org.jenkinsci.plugins.workflow.steps.FlowInterruptedException;
import org.jenkinsci.plugins.workflow.steps.StepContext;
Expand Down Expand Up @@ -39,6 +42,9 @@ public boolean start() throws Exception {
throw new AbortException("No build exists with runId " + step.getRunId());
}

FlowNode node = getContext().get(FlowNode.class);
node.addAction(new LabelAction(Messages.WaitForBuildStepExecution_waitfor_(step.getRunId())));

String runHyperLink = ModelHyperlinkNote.encodeTo("/" + run.getUrl(), run.getFullDisplayName());
TaskListener taskListener = getContext().get(TaskListener.class);
if (run.isBuilding()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ BuildTriggerStep.no_job_configured=No job configured
BuildTriggerStep.cannot_find=No such job {0}
BuildTriggerStep.unsupported=Building a {0} is not supported
BuildTriggerStepExecution.building_=Building {0}
BuildTriggerStepExecution.scheduling_=Scheduling {0}
BuildTriggerStepExecution.convertedParameterDescription=\
{0} (Automatically converted to {1} because {2} passed the parameter using a different type)
WaitForBuildStep.cannot_find=No such run with externalizable id {0}
WaitForBuildStep.no_run_configured=No runId configured
WaitForBuildStepExecution.waitfor_=Wait for {0} to complete