提交 492b4902 编写于 作者: M Matt Moore

Adjust my prior change to better utilize structured form submission to...

Adjust my prior change to better utilize structured form submission to accomodate a plugins that are not using p:config-assignedLabel
上级 207bf238
......@@ -1815,6 +1815,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
if(req.hasParameter("customWorkspace.directory")) {
// Workaround for JENKINS-25221 while plugins are being updated.
LOGGER.log(Level.WARNING, "label assignment is using legacy 'customWorkspace.directory'");
customWorkspace = Util.fixEmptyAndTrim(req.getParameter("customWorkspace.directory"));
} else if(json.optBoolean("hasCustomWorkspace", json.has("customWorkspace"))) {
customWorkspace = Util.fixEmptyAndTrim(json.optString("customWorkspace"));
......@@ -1828,7 +1829,11 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
else
scmCheckoutStrategy = null;
if(json.optBoolean("hasSlaveAffinity", json.has("label"))) {
if(req.hasParameter("_.assignedLabelString")) {
// Workaround for JENKINS-25372 while plugin is being updated.
LOGGER.log(Level.WARNING, "label assignment is using legacy '_.assignedLabelString'");
assignedNode = Util.fixEmptyAndTrim(req.getParameter("_.assignedLabelString"));
} else if(json.optBoolean("hasSlaveAffinity", json.has("label"))) {
assignedNode = Util.fixEmptyAndTrim(json.optString("label"));
} else {
assignedNode = null;
......@@ -2026,6 +2031,14 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return true;
}
public FormValidation doCheckAssignedLabelString(@AncestorInPath AbstractProject<?,?> project,
@QueryParameter String value) {
// Provide a legacy interface in case plugins are not going through p:config-assignedLabel
// see: JENKINS-25372
LOGGER.log(Level.WARNING, "checking label via legacy '_.assignedLabelString'");
return doCheckLabel(project, value);
}
public FormValidation doCheckLabel(@AncestorInPath AbstractProject<?,?> project,
@QueryParameter String value) {
if (Util.fixEmpty(value)==null)
......@@ -2084,6 +2097,13 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return candidates;
}
public AutoCompletionCandidates doAutoCompleteAssignedLabelString(@QueryParameter String value) {
// Provide a legacy interface in case plugins are not going through p:config-assignedLabel
// see: JENKINS-25372
LOGGER.log(Level.WARNING, "autocompleting label via legacy '_.assignedLabelString'");
return doAutoCompleteLabel(value);
}
public AutoCompletionCandidates doAutoCompleteLabel(@QueryParameter String value) {
AutoCompletionCandidates c = new AutoCompletionCandidates();
Set<Label> labels = Jenkins.getInstance().getLabels();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册