提交 7f42b5bb 编写于 作者: S Stephen Connolly 提交者: Oliver Gondža

[JENKINS-42194] Code review reveals valid point, no schedules is not a warning

(cherry picked from commit 5f5f8800)
上级 da67b374
......@@ -358,6 +358,24 @@ public class SCMTrigger extends Trigger<Item> {
return FormValidation.ok();
return FormValidation.validateNonNegativeInteger(value);
}
/**
* Performs syntax check.
*/
public FormValidation doCheckScmpoll_spec(@QueryParameter String value,
@QueryParameter boolean ignorePostCommitHooks,
@AncestorInPath Item item) {
if (StringUtils.isBlank(value)) {
if (ignorePostCommitHooks) {
return FormValidation.ok(Messages.SCMTrigger_no_schedules_no_hooks());
} else {
return FormValidation.ok(Messages.SCMTrigger_no_schedules_hooks());
}
} else {
return Jenkins.getInstance().getDescriptorByType(TimerTrigger.DescriptorImpl.class)
.doCheckSpec(value, item);
}
}
}
@Extension
......
......@@ -23,6 +23,8 @@
SCMTrigger.DisplayName=Poll SCM
SCMTrigger.getDisplayName={0} Polling Log
SCMTrigger.BuildAction.DisplayName=Polling Log
SCMTrigger.no_schedules_no_hooks=Post commit hooks are being ignored and no schedules so will never run due to SCM changes
SCMTrigger.no_schedules_hooks=No schedules so will only run due to SCM changes if triggered by a post-commit hook
SCMTrigger.SCMTriggerCause.ShortDescription=Started by an SCM change
TimerTrigger.DisplayName=Build periodically
TimerTrigger.MissingWhitespace=You appear to be missing whitespace between * and *.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册