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

scm poll triggers even there is no change in repository(bitbucket)

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • git-plugin
    • None
    • we are using Jenkins LTS 2.176.3 on hosted on amazonlinux , job-dsl - 1.74 , git plugin - 4.0.0-rc

    Description

      step 1: create a seed job 
      ```
      String basepath = 'Common/Java/testapp'

      String giturl = 'git@bitbucket.org:abc/testapp'

      pipelineJob("$basepath/1.Build-Dev-Int") {
      logRotator {
      numToKeep(10)
      artifactNumToKeep(10)
      }
      parameters {
      stringParam('USE_GIT_BRANCH', 'master')
      }
      throttleConcurrentBuilds {
      maxTotal(1)
      }

      triggers {
      scm('H/15 * * * *')
      }

      definition {
      cpsScm {
      scm {
      git

      { remote \{ url(giturl) }

      branches('master')
      extensions { }
      }
      scriptPath('pipeline/pipeline_dev_int.groovy')
      }
      }
      }
      }```
      step 2 : create pipeline_dev_int.groovy

      ```@Library('sharedlibrary@master')

      node()

      remaining groovy script```
       

      step 3:     configured shared library in manage jenkins
      even though there is no change in repo it is triggering jobs 
       

       

      whenever a branch/ commit made to the shared library even though there is no change in testapp repo it triggering the job for every 15 min and found this in polling history

      Using strategy: Default
      [poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)
      No credentials specified
      > git --version # timeout=10
      > git ls-remote -h git@bitbucket.org:abc/testapp # timeout=10
      Found 3 remote heads on git@bitbucket.org:abc/testapp
      [poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97
      Using strategy: Specific revision
      [poll] Last Built Revision: Revision a7cf4fd0c7484765c4a5166a36613c387aee8501 (surya/MCDCA-1412-ECR-NEW-ACCOUNT)
      No credentials specified
      > git --version # timeout=10
      > git ls-remote -h git@bitbucket.org:abc/sharedlibrary # timeout=10
      Found 3 remote heads on git@bitbucket.org:abc/sharedlibrary
      [poll] Latest remote head revision on refs/heads/surya/MCDCA-1412-ECR-NEW-ACCOUNT is: ab8eb071afb815bca04fd4e50a991ae54ea37e8c
      Using strategy: Default
      [poll] Last Built Revision: Revision 6717866352d0d5a5e9b41da88a799993ab1d4191 (origin/master)
      using credential 6e83116e-4fb6-491a-a2c9-9ac9d51d4765
      > git --version # timeout=10
      using GIT_SSH to set credentials
      > git ls-remote -h git@bitbucket.org:abc/testapp # timeout=10
      Found 3 remote heads on git@bitbucket.org:abc/testapp
      [poll] Latest remote head revision on refs/heads/master is: 6717866352d0d5a5e9b41da88a799993ab1d4191 - already built by 97
      Done. Took 8.6 sec
      Changes found

      Polling Log

      This page captures the polling log that triggered this build.
      Started on Jul 30, 2018 7:15:00 PM Using strategy: Default [poll] Last Built Revision: Revision 80ae1a7997f138af5faa0e594eca7e88eb174026 (origin/master) > git --version # timeout=10 > git ls-remote -h git@bitbucket.org:xxx/xxxxxxx # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxxxx[poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 - already built by 185 no polling baseline in /var/lib/jenkins/workspace/Sandbox/xxxx/xxxx/1.Build-Dev-Int@libs/xxx on Using strategy: Default > git --version # timeout=10 using GIT_SSH to set credentials Bitbucket SSH Key > git ls-remote -h git@bitbucket.org:xxxxx.git # timeout=10 Found 1 remote heads on git@bitbucket.org:xx/xxxx.git [poll] Latest remote head revision on refs/heads/master is: 80ae1a7997f138af5faa0e594eca7e88eb174026 Done. Took 2.7 sec Changes found

      Attachments

        Activity

          markewaite Mark Waite added a comment -

          ashisharma888 there is not a way to do what you're proposing with a pipeline job that reads the Pipeline from SCM (in other words, an SCM pipeline that is not a multibranch pipeline). It might be possible from a multibranch pipeline job that is defined to select only a subset of branches.

          markewaite Mark Waite added a comment - ashisharma888 there is not a way to do what you're proposing with a pipeline job that reads the Pipeline from SCM (in other words, an SCM pipeline that is not a multibranch pipeline). It might be possible from a multibranch pipeline job that is defined to select only a subset of branches.
          ashisharma888 Ashish Sharma added a comment - - edited

          Ohh really, I thought it might be a common use case. Let me do similar POC around multi branch plugin.

          Thank you very much markewaite. You are awesome. Stay safe. Cheers.

          ashisharma888 Ashish Sharma added a comment - - edited Ohh really, I thought it might be a common use case. Let me do similar POC around multi branch plugin. Thank you very much markewaite . You are awesome. Stay safe. Cheers.
          ashisharma888 Ashish Sharma added a comment -

          markewaite Just to close the loop here, the use case we have is not resolved using multi branch pipeline as well as it can help to select which branch to run pipeline in but again can't solve the polling challenge I have. So to be able to get positive polling results for our case (Poll for a specific tag on new commit, and trigger build from the tag once the new commit comes), I have just pasted pipeline script directly in the jenkins pipeline script console.

          ashisharma888 Ashish Sharma added a comment - markewaite Just to close the loop here, the use case we have is not resolved using multi branch pipeline as well as it can help to select which branch to run pipeline in but again can't solve the polling challenge I have. So to be able to get positive polling results for our case (Poll for a specific tag on new commit, and trigger build from the tag once the new commit comes), I have just pasted pipeline script directly in the jenkins pipeline script console.

          This issue does not seem to be related to Job DSL. Can we close the issue?

          daspilker Daniel Spilker added a comment - This issue does not seem to be related to Job DSL. Can we close the issue?
          stanislaw_kodzis Stanisław added a comment -

          daspilker the bug is not solved at all, why you want to close it?

          We are still waiting for a fix or workaround

          stanislaw_kodzis Stanisław added a comment - daspilker the bug is not solved at all, why you want to close it? We are still waiting for a fix or workaround

          People

            daspilker Daniel Spilker
            yrsurya suryatej yaramada
            Votes:
            6 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated: