Skip to content
Permalink
Browse files
Switch to ignore post-commit hook in SCM polling triggers [FIXED JENK…
…INS-6846]
  • Loading branch information
kutzi committed Nov 24, 2012
1 parent 41f1fe6 commit b65c30cb368e79205edacd958d8fd98dd89f3a73
@@ -58,6 +58,10 @@
<li class=bug>
Slave's Name should be trimmed of spaces at the beginning and end of the Name on Save.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-15836">issue 15836</a>)
<li class=rfe>
Added new switch to ignore post-commit hooks in SCM polling triggers.
This requires that the SCM plugin supports this feature, too!
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-6846">issue 6846</a>)

</ul>
</div><!--=TRUNK-END=-->
@@ -73,9 +73,28 @@
* @author Kohsuke Kawaguchi
*/
public class SCMTrigger extends Trigger<SCMedItem> {
@DataBoundConstructor

private boolean ignorePostCommitHooks;

public SCMTrigger(String scmpoll_spec) throws ANTLRException {
this(scmpoll_spec, false);
}

@DataBoundConstructor
public SCMTrigger(String scmpoll_spec, boolean ignorePostCommitHooks) throws ANTLRException {
super(scmpoll_spec);
this.ignorePostCommitHooks = ignorePostCommitHooks;
}

/**
* This trigger wants to ignore post-commit hooks.
* <p>
* SCM plugins must respect this and not run this trigger for post-commit notifications.
*
* @since 1.493
*/
public boolean isIgnorePostCommitHooks() {
return this.ignorePostCommitHooks;
}

@Override
@@ -27,4 +27,7 @@ THE SOFTWARE.
<f:entry title="${%Schedule}" help="/descriptor/hudson.triggers.TimerTrigger/help/spec">
<f:textarea name="scmpoll_spec" checkUrl="'${rootURL}/trigger/TimerTrigger/check?value='+encodeURIComponent(this.value)" value="${instance.spec}"/>
</f:entry>
<f:entry field="ignorePostCommitHooks" title="${%Ignore post-commit hooks}">
<f:checkbox />
</f:entry>
</j:jelly>
@@ -0,0 +1,8 @@
<div>
Ignore changes notified by SCM post-commit hooks.
<p>
This can be useful if you want to prevent some long-running jobs (e.g. reports) starting because of every commit, but still want to
run them periodic if SCM changes have occurred.
<p>
Note that this option needs to be supported by the SCM plugin, too! The subversion-plugin supports this since version 1.44.
</div>

0 comments on commit b65c30c

Please sign in to comment.