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

Pipeline branches SCM polling properties for multibranch has broken behaviour.

    Details

    • Similar Issues:

      Description

      We're attempting to configure a pipeline multibranch folder such that 'default' is always built but feature branches are only built daily. We did this by suppressing automatic SCM triggering for all branches except 'default', then configuring a separate pollSCM in the jenkinsfile for each branch.

      However we're seeing issues where feature branches that have changes are not built for days while sometimes a branch will be triggered many times for the same changeset.

      Multiple jobs for the same changeset are triggered. The first by "Branch indexing" and the later ones by "Started by an SCM change". The logs show "Dependent changes detected"

      No other polling is configured.

      Removing the pipelineTriggers/pollSCM property seems to stop repeat builds (but won't give you daily builds)

      Our Jenkinsfile starts with this:

      def alwaysBuild = (env.BRANCH_NAME == "default" || env.BRANCH_NAME ==~ /CompanyName-.*/);
      properties([overrideIndexTriggers(alwaysBuild), pipelineTriggers([pollSCM('@daily')])]);
      

      Multibranch folder is configured with properties overrides:

      • "named branches get different properties"
        exceptions:
        "default": no properties
        "us*,d*,ts*": Suppess automatic SCM triggering.

      And every commit will notify jenkins via

      curl -v  http://jenkins:8080/mercurial/notifyCommit?url=ssh://hg@scm01/sw-source
      

        Attachments

          Issue Links

            Activity

            sonneveldsmartward Nick Sonneveld created issue -
            sonneveldsmartward Nick Sonneveld made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-38443 [ JENKINS-38443 ]
            sonneveldsmartward Nick Sonneveld made changes -
            Description We're attempting to configure a pipeline multibranch folder such that 'default' is always built but feature branches are only built daily.

            However we're seeing issues where feature branches that have changes are not built for days while sometimes a branch will be triggered many times for the same changeset.

            Multiple jobs for the same changeset are triggered. The first by "Branch indexing" and the later ones by "Started by an SCM change". The logs show "Dependent changes detected"

            No other polling is configured.


            Our Jenkinsfile starts with this:

            {noformat}
            def alwaysBuild = (env.BRANCH_NAME == "default" || env.BRANCH_NAME ==~ /CompanyName-.*/);
            properties([overrideIndexTriggers(alwaysBuild), pipelineTriggers([pollSCM('@daily')])]);
            {noformat}



            Multibranch folder is configured with properties overrides:

            - "named branches get different properties"
             exceptions:
             "default": no properties
             "us*,d*,ts*": Suppess automatic SCM triggering.


            And every commit will notify jenkins via

            {noformat}
            curl -v http://jenkins:8080/mercurial/notifyCommit?url=ssh://hg@scm01/sw-source
            {noformat}
            We're attempting to configure a pipeline multibranch folder such that 'default' is always built but feature branches are only built daily. We did this by suppressing automatic SCM triggering for all branches except 'default', then configuring a separate pollSCM in the jenkinsfile for each branch.

            However we're seeing issues where feature branches that have changes are not built for days while sometimes a branch will be triggered many times for the same changeset.

            Multiple jobs for the same changeset are triggered. The first by "Branch indexing" and the later ones by "Started by an SCM change". The logs show "Dependent changes detected"

            No other polling is configured.

            Removing the pipelineTriggers/pollSCM property seems to stop repeat builds (but won't give you daily builds)

            Our Jenkinsfile starts with this:

            {noformat}
            def alwaysBuild = (env.BRANCH_NAME == "default" || env.BRANCH_NAME ==~ /CompanyName-.*/);
            properties([overrideIndexTriggers(alwaysBuild), pipelineTriggers([pollSCM('@daily')])]);
            {noformat}



            Multibranch folder is configured with properties overrides:

            - "named branches get different properties"
             exceptions:
             "default": no properties
             "us*,d*,ts*": Suppess automatic SCM triggering.


            And every commit will notify jenkins via

            {noformat}
            curl -v http://jenkins:8080/mercurial/notifyCommit?url=ssh://hg@scm01/sw-source
            {noformat}
            jglick Jesse Glick made changes -
            Component/s pipeline [ 21692 ]
            Component/s workflow-multibranch-plugin [ 21465 ]
            Labels multibranch
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Incomplete [ 4 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                sonneveldsmartward Nick Sonneveld
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: