• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline
    • None

      When pulling my workflow script from a svn repo I get two builds triggered for one revision change if build runs longer then pull interval,

      To reproduce:

      Create workflow job with a standard svn pull configured in job, for my test I set to every minute

      Sample Job DSL
      ---------------------------------------

      node ('master') { 
      checkout changelog: false, poll: false, scm: [ $class: "SubversionSCM", locations: [[ remote:'SVNURL/trunk/flow']] ] 
      load 'flow/Test.groovy' 
      }()
      

      Sample Test.groovy
      ---------------------------

      { -> 
      node() { 
      ws() { 
      checkout changelog: true, poll: true, scm: [$class: "SubversionSCM", locations: [[remote: 'SVNURL/trunk']]] 
      sleep 300 
      } 
      } 
      }
      

      Note: I pull my workflow scripts from the same repo as my build.

      Any scheduled poll that happens before build completion will trigger another job,

      Looking at the polling log it seems it is comparing against the last completed build and not the in progress.

      Notes:

          [JENKINS-32214] Workflow and svn polling

          Jesse Glick added a comment -

          Right. I pretty easily reproduced the issue, or at least a simplified variant of it. But the solution is not so clear. We want to pay attention to the complete set of SCMs as definitively recorded in the last completed build, but amending that with new information from running builds—at least updated revision state baselines.

          Jesse Glick added a comment - Right. I pretty easily reproduced the issue, or at least a simplified variant of it. But the solution is not so clear. We want to pay attention to the complete set of SCMs as definitively recorded in the last completed build, but amending that with new information from running builds—at least updated revision state baselines.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java
          http://jenkins-ci.org/commit/workflow-plugin/89ec825e92169b99abeedf64ee1a99c9a79c2624
          Log:
          JENKINS-32214 Reproduced potentially undesirable polling semantics in test.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java http://jenkins-ci.org/commit/workflow-plugin/89ec825e92169b99abeedf64ee1a99c9a79c2624 Log: JENKINS-32214 Reproduced potentially undesirable polling semantics in test.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          http://jenkins-ci.org/commit/workflow-plugin/05e46bc4c66a5e0db4f5cced25f824d022b1d95a
          Log:
          [FIXED JENKINS-32214] WorkflowJob.poll should give preference to any SCMRevisionState from the latest running build.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java http://jenkins-ci.org/commit/workflow-plugin/05e46bc4c66a5e0db4f5cced25f824d022b1d95a Log: [FIXED JENKINS-32214] WorkflowJob.poll should give preference to any SCMRevisionState from the latest running build.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          http://jenkins-ci.org/commit/workflow-plugin/c12abe251d9ad396966460bfb8d7bf9469eb6064
          Log:
          JENKINS-32214 WorkflowJob.poll reworked to consider polling baselines from any running build or prior polling.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java http://jenkins-ci.org/commit/workflow-plugin/c12abe251d9ad396966460bfb8d7bf9469eb6064 Log: JENKINS-32214 WorkflowJob.poll reworked to consider polling baselines from any running build or prior polling.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          http://jenkins-ci.org/commit/workflow-plugin/a05eb6a108686e118c991380f252ec7ee71a09e5
          Log:
          Merge pull request #344 from jglick/pollDuringBuild-JENKINS-32214

          JENKINS-32214 Polling baseline with in-progress builds

          Compare: https://github.com/jenkinsci/workflow-plugin/compare/d26750fc6fa8...a05eb6a10868

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java http://jenkins-ci.org/commit/workflow-plugin/a05eb6a108686e118c991380f252ec7ee71a09e5 Log: Merge pull request #344 from jglick/pollDuringBuild- JENKINS-32214 JENKINS-32214 Polling baseline with in-progress builds Compare: https://github.com/jenkinsci/workflow-plugin/compare/d26750fc6fa8...a05eb6a10868

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java
          http://jenkins-ci.org/commit/workflow-scm-step-plugin/4d4783967c042584537aa82e22bfdb602aa93101
          Log:
          JENKINS-32214 Reproduced potentially undesirable polling semantics in test.
          Originally-Committed-As: 89ec825e92169b99abeedf64ee1a99c9a79c2624

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java http://jenkins-ci.org/commit/workflow-scm-step-plugin/4d4783967c042584537aa82e22bfdb602aa93101 Log: JENKINS-32214 Reproduced potentially undesirable polling semantics in test. Originally-Committed-As: 89ec825e92169b99abeedf64ee1a99c9a79c2624

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java
          http://jenkins-ci.org/commit/workflow-scm-step-plugin/936db2be4612fe1ac5aa5e7d05334d3b68155998
          Log:
          [FIXED JENKINS-32214] WorkflowJob.poll should give preference to any SCMRevisionState from the latest running build.
          Originally-Committed-As: 05e46bc4c66a5e0db4f5cced25f824d022b1d95a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java http://jenkins-ci.org/commit/workflow-scm-step-plugin/936db2be4612fe1ac5aa5e7d05334d3b68155998 Log: [FIXED JENKINS-32214] WorkflowJob.poll should give preference to any SCMRevisionState from the latest running build. Originally-Committed-As: 05e46bc4c66a5e0db4f5cced25f824d022b1d95a

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java
          http://jenkins-ci.org/commit/workflow-scm-step-plugin/ad9e8f6be50d4f29e71a46b594bca68c5c874726
          Log:
          JENKINS-32214 WorkflowJob.poll reworked to consider polling baselines from any running build or prior polling.
          Originally-Committed-As: c12abe251d9ad396966460bfb8d7bf9469eb6064

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SubversionStepTest.java http://jenkins-ci.org/commit/workflow-scm-step-plugin/ad9e8f6be50d4f29e71a46b594bca68c5c874726 Log: JENKINS-32214 WorkflowJob.poll reworked to consider polling baselines from any running build or prior polling. Originally-Committed-As: c12abe251d9ad396966460bfb8d7bf9469eb6064

          Code changed in jenkins
          User: Jesse Glick
          Path:
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          http://jenkins-ci.org/commit/workflow-job-plugin/7d44f65c3e0d06110627f3bbb0765f14e319f27a
          Log:
          [FIXED JENKINS-32214] WorkflowJob.poll should give preference to any SCMRevisionState from the latest running build.
          Originally-Committed-As: 05e46bc4c66a5e0db4f5cced25f824d022b1d95a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java http://jenkins-ci.org/commit/workflow-job-plugin/7d44f65c3e0d06110627f3bbb0765f14e319f27a Log: [FIXED JENKINS-32214] WorkflowJob.poll should give preference to any SCMRevisionState from the latest running build. Originally-Committed-As: 05e46bc4c66a5e0db4f5cced25f824d022b1d95a

          Code changed in jenkins
          User: Jesse Glick
          Path:
          job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
          http://jenkins-ci.org/commit/workflow-job-plugin/77999f564410f4408a75994fe8ba96f68de40cde
          Log:
          JENKINS-32214 WorkflowJob.poll reworked to consider polling baselines from any running build or prior polling.
          Originally-Committed-As: c12abe251d9ad396966460bfb8d7bf9469eb6064

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java http://jenkins-ci.org/commit/workflow-job-plugin/77999f564410f4408a75994fe8ba96f68de40cde Log: JENKINS-32214 WorkflowJob.poll reworked to consider polling baselines from any running build or prior polling. Originally-Committed-As: c12abe251d9ad396966460bfb8d7bf9469eb6064

            jglick Jesse Glick
            owood Owen Wood
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: