Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-42194] Code review reveals valid point, no schedules is not …
…a warning

(cherry picked from commit 5f5f880)
  • Loading branch information
stephenc authored and olivergondza committed Apr 13, 2017
1 parent da67b37 commit 7f42b5b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions core/src/main/java/hudson/triggers/SCMTrigger.java
Expand Up @@ -358,6 +358,24 @@ public FormValidation doCheckPollingThreadCount(@QueryParameter String value) {
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
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/resources/hudson/triggers/Messages.properties
Expand Up @@ -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 *.
Expand Down

0 comments on commit 7f42b5b

Please sign in to comment.