Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.54</version>
<version>4.2</version>
<relativePath />
</parent>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
Expand Down Expand Up @@ -64,7 +64,7 @@
<properties>
<revision>2.36</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.176.1</jenkins.version>
<jenkins.version>2.241-rc30038.0428cd872667</jenkins.version>
<java.level>8</java.level>
<useBeta>true</useBeta>
<workflow-step-api-plugin.version>2.20</workflow-step-api-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
import hudson.model.AutoCompletionCandidates;
import hudson.model.Computer;
import hudson.model.Executor;
import hudson.model.Job;
import hudson.model.Label;
import hudson.model.Node;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.model.labels.LabelExpression;
import hudson.util.FormValidation;
import java.io.Serializable;
import java.util.Set;
Expand All @@ -49,6 +51,7 @@
import org.jenkinsci.plugins.workflow.steps.StepContext;
import org.jenkinsci.plugins.workflow.steps.StepDescriptor;
import org.jenkinsci.plugins.workflow.steps.StepExecution;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;

Expand Down Expand Up @@ -95,22 +98,12 @@ public final class ExecutorStep extends Step implements Serializable {
return true;
}

// TODO copied from AbstractProjectDescriptor
public AutoCompletionCandidates doAutoCompleteLabel(@QueryParameter String value) {
AutoCompletionCandidates c = new AutoCompletionCandidates();
Jenkins j = Jenkins.getInstanceOrNull();
if (j != null) {
for (Label label : j.getLabels()) {
if (label.getName().startsWith(value)) {
c.add(label.getName());
}
}
}
return c;
return LabelExpression.autoComplete(value);
}

public FormValidation doCheckLabel(@QueryParameter String value) {
return AbstractProject.AbstractProjectDescriptor.validateLabelExpression(value, /* LabelValidator does not support Job */null);
public FormValidation doCheckLabel(@AncestorInPath Job<?, ?> job, @QueryParameter String value) {
return LabelExpression.validate(value, job);
}

@Override public Set<? extends Class<?>> getRequiredContext() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,9 @@ private final class PlaceholderExecutable implements ContinuableExecutable, Acce
// Cf. AbstractBuild.getEnvironment:
env.put("WORKSPACE", workspace.getRemote());
if (workspace.getParent() != null) {
env.put("WORKSPACE_TMP", WorkspaceList.tempDir(workspace).getRemote()); // JENKINS-60634
FilePath tmp = WorkspaceList.tempDir(workspace);
if (tmp != null)
env.put("WORKSPACE_TMP", tmp.getRemote()); // JENKINS-60634
}
FlowNode flowNode = context.get(FlowNode.class);
if (flowNode != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public boolean start() throws Exception {
Map<String, String> env = new HashMap<>();
env.put("WORKSPACE", workspace.getRemote());
if (workspace.getParent() != null) {
env.put("WORKSPACE_TMP", WorkspaceList.tempDir(workspace).getRemote());
FilePath tmp = WorkspaceList.tempDir(workspace);
if (tmp != null)
env.put("WORKSPACE_TMP", tmp.getRemote());
}
getContext().newBodyInvoker()
.withContexts(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:entry title="Label" field="label">
<f:textbox/>
<f:textbox autoCompleteDelimChar=" "/>
</f:entry>
</j:jelly>