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

When specifying the branch to poll as part of a parameterized build, git-plugin uses last polled branch instead

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • jenkins version: 2.89.3
      git plugin: 3.8.0
      git client plugin version: 2.7.1

      I have the following Jenkins Pipeline job:

      • Build Trigger: "Poll SCM"
      • Parametrized with String parameter "BRANCH", default value "master"
      • Definition is "Pipeline script from SCM" with Branch Specifier "$BRANCH", "Lightweight checkout" unchecked

      Expected behaviour:
      The job polls SCM. When changes are detected in the branch specified in the default value of the BRANCH parameter ("master" in this case), the job is triggered.

      Actual behaviour:
      The job polls SCM, but it ONLY triggers the job when changes are detected in the branch that was last built.

      This causes the following issue:
      After I manually trigger the job with branch "develop", subsequent changes in branch "master" are ignored.

      This issue also manifests itself when Build Trigger: "Build when a change is pushed to BitBucket" is used.

      This seems to be a regression of issue https://issues.jenkins-ci.org/browse/JENKINS-27327

          [JENKINS-50168] When specifying the branch to poll as part of a parameterized build, git-plugin uses last polled branch instead

          Jeroen Smolenaers created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Component/s New: scm-api-plugin [ 18054 ]
          Mark Waite made changes -
          Labels Original: git pipeline regression scm New: git pipeline scm
          Mark Waite made changes -
          Component/s Original: git-client-plugin [ 17423 ]
          Joshua Williams made changes -
          Assignee New: Joshua Williams [ jkwiz ]
          Joshua Williams made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Joshua Williams made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Joshua Williams made changes -
          Link New: This issue relates to JENKINS-27327 [ JENKINS-27327 ]
          Andrew Bayer made changes -
          Component/s Original: scm-api-plugin [ 18054 ]

            jkwiz Joshua Williams
            jeroen_s Jeroen Smolenaers
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: