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

Mercurial triggers broken by duplicate checkout in Multibranch pipeline

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Jenkins 2.99
      Pipeline: Multibranch 2.16
      Bitbucket Plugin 1.1.8
      Mercurial Plugin 2.2
    • Similar Issues:

      Description

      In my multibranch job I see mercurial build data twice as discussed elsewhere. However this breaks the bitbucketPush() and pollSCM trigger, at least on my single instance, build on master setup. The below output from the bitbucket hook log shows the second checkout can't find any new changes and so does not trigger the build.

      [EE594BC60F600AD3DD68DECB293CF28AC8C8D9FF-testrepo] $ hg pull
      pulling from https://bitbucket.org/aphtech/testrepo
      searching for changes
      adding changesets
      adding manifests
      adding file changes
      added 1 changesets with 1 changes to 1 files
      (run 'hg update' to get a working copy)
      Master cache lock released.
      [EE594BC60F600AD3DD68DECB293CF28AC8C8D9FF-testrepo] $ hg log --rev f9086558ba7491029c1dc288c81536bb666b1fd8 --template {node}
      [EE594BC60F600AD3DD68DECB293CF28AC8C8D9FF-testrepo] $ hg log --rev f9086558ba7491029c1dc288c81536bb666b1fd8 --template {rev}
      [EE594BC60F600AD3DD68DECB293CF28AC8C8D9FF-testrepo] $ hg id --branch --rev f9086558ba7491029c1dc288c81536bb666b1fd8
      Acquired master cache lock.
      [EE594BC60F600AD3DD68DECB293CF28AC8C8D9FF-testrepo] $ hg pull
      pulling from https://bitbucket.org/aphtech/testrepo
      searching for changes
      no changes found
      Master cache lock released.
      [EE594BC60F600AD3DD68DECB293CF28AC8C8D9FF-testrepo] $ hg log --rev f9086558ba7491029c1dc288c81536bb666b1fd8 --template {node}
      [EE594BC60F600AD3DD68DECB293CF28AC8C8D9FF-testrepo] $ hg log --rev f9086558ba7491029c1dc288c81536bb666b1fd8 --template {rev}
      [EE594BC60F600AD3DD68DECB293CF28AC8C8D9FF-testrepo] $ hg id --branch --rev f9086558ba7491029c1dc288c81536bb666b1fd8
      Done. Took 2.2 sec
      No changes
      

      My base Jenkinsfile is pretty basic

      pipeline {
          agent any
          
          triggers {
      		bitbucketPush()
      	}
      
      	stages {
      		stage("Build Data") {
      			steps {
      				sh 'echo yay'
      			}
      		}
          }
      }
      

      I've tried with `checkout scm`, `skipDefaultCheckout()`, and inside a docker agent instead of master but cannot get rid of the second repo

      Steps to reproduce

      1. Make a multibranch job from a mercurial repo on bitbucket
      2. Let it do the initial build, mercurial build data should be duplicated
      3. # Add bitbucket-hook/ url to bitbucket webhooks
      4. Try to trigger via push or pollSCM

      This bug makes multibranch almost unusable

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              thelq Leon Blakey
            • Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: