Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-6846

Poll SCM with post-commit hook or by cron-definition

      We have splitted some projects from one single job (doing build/test/analyse) to two jobs (one only for build and second one for test/analyse). The first job polls scm every 10 minutes, the second one polls scm at midnight.

      Now we defined a svn post-commit hook for CI, so we don't have to poll every 10 minutes for changes. This is fine for the first job, but the second one now starts too (because 'Poll SCM' is checked). For now it is not possible to define a job, that polls scm due a cron-definition and another one that is triggered by post-commit hook.

      It would be nice to have an additional option like "ignore post-commit hook". So 'Poll SCM' could be checked and triggered by cron-definition and not by post-commit.

          [JENKINS-6846] Poll SCM with post-commit hook or by cron-definition

          kutzi added a comment -

          I support that request. The post commit hook doesn't allow jobs like: 'run some reports every 2 hours, but only if SCM has changed'.

          kutzi added a comment - I support that request. The post commit hook doesn't allow jobs like: 'run some reports every 2 hours, but only if SCM has changed'.

          manthos added a comment - - edited

          Changed this improvement to critical.

          For now it is not possible to have jobs triggered by SCM postcommithook and jobs triggered only by polling SCM at a defined time. Only one or other mode is possible; hudson wide...

          A option like this could bring full flexibility back:

          [ ] Poll SCM
          [ ] by postcommithook
          [ ] Schedule (with cron)

          manthos added a comment - - edited Changed this improvement to critical. For now it is not possible to have jobs triggered by SCM postcommithook and jobs triggered only by polling SCM at a defined time. Only one or other mode is possible; hudson wide... A option like this could bring full flexibility back: [ ] Poll SCM [ ] by postcommithook [ ] Schedule (with cron)

          kutzi added a comment -

          For easier migration of existing configurations it would e.g. be possible to just add another checkbox
          [x] listen to post-commit-hooks
          which would be true by default (and for migrated configs).
          If you only want to poll by cron you only would have to disable the checkbox

          kutzi added a comment - For easier migration of existing configurations it would e.g. be possible to just add another checkbox [x] listen to post-commit-hooks which would be true by default (and for migrated configs). If you only want to poll by cron you only would have to disable the checkbox

          @manthos
          request information:
          1) Do you have think that the second job could poll build result of job1 instead of SCM
          2) How do you schedule the first job in the post commit hook?

          Gregory Boissinot added a comment - @manthos request information: 1) Do you have think that the second job could poll build result of job1 instead of SCM 2) How do you schedule the first job in the post commit hook?

          manthos added a comment -

          1) this doesn't change anything. if I bind job2 to job1, job2 builds right after job1...
          2) first job starts building by a scm postcommithook (push), no cronjob needed.

          IMO 'Poll SCM' and 'postcommithook (push)' are different triggers. Currently you are not able to have different Builds (based on same scm repository) but one triggered by postcommithook (push), the other by poll.

          Example:
          Job1:

          • maven deploy -DskipTests=true of http://svn.foo.bar/svn/java/foobarproject
          • build triggered by scm postcommithook (push)
            So every time a user checks something into scm, foobarproject builds, skipping the (time consuming) tests

          Job2:

          • maven test of http://svn.foo.bar/svn/java/foobarproject
          • build triggered by Poll SCM, in ex: (Mo-Fr at 23:00 -> 0 23 * * 1,2,3,4,5)
            So at 23:00 -> tests of foobarproject but only if something checked in (since last run)

          manthos added a comment - 1) this doesn't change anything. if I bind job2 to job1, job2 builds right after job1... 2) first job starts building by a scm postcommithook (push), no cronjob needed. IMO 'Poll SCM' and 'postcommithook (push)' are different triggers. Currently you are not able to have different Builds (based on same scm repository) but one triggered by postcommithook (push), the other by poll. Example: Job1: maven deploy -DskipTests=true of http://svn.foo.bar/svn/java/foobarproject build triggered by scm postcommithook (push) So every time a user checks something into scm, foobarproject builds, skipping the (time consuming) tests Job2: maven test of http://svn.foo.bar/svn/java/foobarproject build triggered by Poll SCM, in ex: (Mo-Fr at 23:00 -> 0 23 * * 1,2,3,4,5) So at 23:00 -> tests of foobarproject but only if something checked in (since last run)

          +1
          Same Problem: running nightly UI tests, which take about 3-4 hours to finish. I want this to run only after an actual change, because running every midnight will make the test-result-history kind of useless.

          Therefore this is definitively a critical bug!

          Rainer Weinhold added a comment - +1 Same Problem: running nightly UI tests, which take about 3-4 hours to finish. I want this to run only after an actual change, because running every midnight will make the test-result-history kind of useless. Therefore this is definitively a critical bug!

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/triggers/SCMTrigger.java
          core/src/main/resources/hudson/triggers/SCMTrigger/config.jelly
          core/src/main/resources/hudson/triggers/SCMTrigger/help-ignorePostCommitHooks.html
          http://jenkins-ci.org/commit/jenkins/b65c30cb368e79205edacd958d8fd98dd89f3a73
          Log:
          Switch to ignore post-commit hook in SCM polling triggers [FIXED JENKINS-6846]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/triggers/SCMTrigger.java core/src/main/resources/hudson/triggers/SCMTrigger/config.jelly core/src/main/resources/hudson/triggers/SCMTrigger/help-ignorePostCommitHooks.html http://jenkins-ci.org/commit/jenkins/b65c30cb368e79205edacd958d8fd98dd89f3a73 Log: Switch to ignore post-commit hook in SCM polling triggers [FIXED JENKINS-6846]

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          src/main/java/hudson/scm/SubversionRepositoryStatus.java
          http://jenkins-ci.org/commit/subversion-plugin/2de66bbcc17e80933d754bba09d000b4c6d1ab4d
          Log:
          Switch to ignore post-commit hook in SCM polling triggers [FIXED JENKINS-6846]

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/scm/SubversionRepositoryStatus.java http://jenkins-ci.org/commit/subversion-plugin/2de66bbcc17e80933d754bba09d000b4c6d1ab4d Log: Switch to ignore post-commit hook in SCM polling triggers [FIXED JENKINS-6846]

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2096
          Switch to ignore post-commit hook in SCM polling triggers [FIXED JENKINS-6846] (Revision b65c30cb368e79205edacd958d8fd98dd89f3a73)

          Result = UNSTABLE
          Christoph Kutzinski : b65c30cb368e79205edacd958d8fd98dd89f3a73
          Files :

          • core/src/main/resources/hudson/triggers/SCMTrigger/help-ignorePostCommitHooks.html
          • changelog.html
          • core/src/main/resources/hudson/triggers/SCMTrigger/config.jelly
          • core/src/main/java/hudson/triggers/SCMTrigger.java

          dogfood added a comment - Integrated in jenkins_main_trunk #2096 Switch to ignore post-commit hook in SCM polling triggers [FIXED JENKINS-6846] (Revision b65c30cb368e79205edacd958d8fd98dd89f3a73) Result = UNSTABLE Christoph Kutzinski : b65c30cb368e79205edacd958d8fd98dd89f3a73 Files : core/src/main/resources/hudson/triggers/SCMTrigger/help-ignorePostCommitHooks.html changelog.html core/src/main/resources/hudson/triggers/SCMTrigger/config.jelly core/src/main/java/hudson/triggers/SCMTrigger.java

            kutzi kutzi
            manthos manthos
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: