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

Jenkins job builds all branches even there is only change on 1 branch

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • _unsorted
    • None

      My jenkins version is : Jenkins 2.401.1

      I have a github repo : repoA, it has many branches, webhook is setup and has been working for a few years ( spray method)

      One jenkins, there job: testJob, it is freestyle project, with GitHub hook trigger for GITScm polling selected,  Source Code Management pointed to this repoA, Branch Specifier is **, it has been working for years.

      there was recent jenkins upgrade and plugin upgrade, 

      Issue:

      I did a change on testBranch1, commit on Github, testJob got poked ( I can see this from log), but the job starts to build all branches, as if the jenkins thinks all branches have been changed. There is only change on 1 branch.

      Some debug info

      GitHubPollLog shows ** 

      Started on Jun 14, 2023, 12:06:18 PM
      Started by event from 10.10..https://..com/github-webhook/ on Wed Jun 14 12:06:18 PDT 2023
      Polling SCM changes on jenkins-child-***
        <---------this is a jenkins child node
      Using strategy: Default
      [poll] Last Built Revision: Revision 11b17b64ff29b5f393bd265673c89e24a4c36739 (origin/testBranch1)

      I changed the jenkins config for Branch Specifier to be testBranch2, then repeat same steps,

      GitHubPollLog shows ** 

      Started on Jun 14, 2023, 1:21:01 PM Started by event from 10.10..

      https://..com/github-webhook/

      on Wed Jun 14 13:21:01 PDT 2023 Using strategy: Default [poll] Last Built Revision: Revision 19d6b1e94302eead2020a09f358360887de1b0b8 (origin/testBranch2) The recommended git tool is: NONE

      Why when branch is defined as any(**, or blank) Jenkins is Polling SCM changes on jenkins child, it may not have the latest info?

       

          [JENKINS-71456] Jenkins job builds all branches even there is only change on 1 branch

          Li created issue -
          Li made changes -
          Description Original: My jenkins version is : [Jenkins 2.401.1|https://www.jenkins.io/]

          I have a github repo : {*}repoA{*}, it has many branches, webhook is setup and has been working for a few years ( spray method)

          One jenkins, there job: {*}testJob{*}, it is freestyle project, with +GitHub hook trigger for GITScm polling+ selected,  Source Code Management pointed to this *repoA,* Branch Specifier is **, it has been working for years.

          there was recent jenkins upgrade and plugin upgrade, 

          *Issue:*

          I did a change on {*}testBranch1{*}, commit on Github, *testJob* got poked ( I can see this from log), but the job starts to build all branches, as if the jenkins thinks all branches have been changed. There is only change on 1 branch.

          *Some debug info*

          *GitHubPollLog* shows ** 

          {color:#4c9aff}Started on Jun 14, 2023, 12:06:18 PM
          Started by event from 10.10.*.*⇒ https://*.*.com/github-webhook/ on Wed Jun 14 12:06:18 PDT 2023
          Polling SCM changes on jenkins-child-***  <---------this is a jenkins child node
          Using strategy: Default
          [poll] Last Built Revision: Revision 11b17b64ff29b5f393bd265673c89e24a4c36739 (origin/testBranch1){color}

          {color:#172b4d}I changed the jenkins config for Branch Specifier to be testBranch2, then repeat same steps,{color}

          {color:#172b4d}*GitHubPollLog* shows ** {color}

          {color:#4c9aff}Started on Jun 14, 2023, 1:21:01 PM Started by event from 10.10.*.* ⇒ {color}

          {color:#4c9aff}*[https://*.*.com/github-webhook/|https://ci-sw.trellisware.com/github-webhook/]*{color}

          {color:#4c9aff} on Wed Jun 14 13:21:01 PDT 2023 Using strategy: Default [poll] Last Built Revision: Revision 19d6b1e94302eead2020a09f358360887de1b0b8 (origin/testBranch2) The recommended git tool is: NONE{color}

          {color:#172b4d}Why when branch is defined as any(**, or blank) Jenkins is Polling SCM changes on jenkins child ( which is the child node running last job)?{color}

           
          New: My jenkins version is : [Jenkins 2.401.1|https://www.jenkins.io/]

          I have a github repo : {*}repoA{*}, it has many branches, webhook is setup and has been working for a few years ( spray method)

          One jenkins, there job: {*}testJob{*}, it is freestyle project, with +GitHub hook trigger for GITScm polling+ selected,  Source Code Management pointed to this *repoA,* Branch Specifier is **, it has been working for years.

          there was recent jenkins upgrade and plugin upgrade, 

          *Issue:*

          I did a change on {*}testBranch1{*}, commit on Github, *testJob* got poked ( I can see this from log), but the job starts to build all branches, as if the jenkins thinks all branches have been changed. There is only change on 1 branch.

          *Some debug info*

          *GitHubPollLog* shows ** 

          {color:#4c9aff}Started on Jun 14, 2023, 12:06:18 PM
          Started by event from 10.10.{*}.{*}⇒ [https://*.*.com/github-webhook/|https://%2A.%2A.com/github-webhook/] on Wed Jun 14 12:06:18 PDT 2023
          {color:#de350b}Polling SCM changes on jenkins-child-***{color}  <---------this is a jenkins child node
          Using strategy: Default
          [poll] Last Built Revision: Revision 11b17b64ff29b5f393bd265673c89e24a4c36739 (origin/testBranch1){color}

          {color:#172b4d}I changed the jenkins config for Branch Specifier to be testBranch2, then repeat same steps,{color}

          {color:#172b4d}*GitHubPollLog* shows ** {color}

          {color:#4c9aff}Started on Jun 14, 2023, 1:21:01 PM Started by event from 10.10.{*}.{*} ⇒ {color}

          {color:#4c9aff}*[https://{*}.{*}.com/github-webhook/|https://ci-sw.trellisware.com/github-webhook/]*{color}

          {color:#4c9aff} on Wed Jun 14 13:21:01 PDT 2023 Using strategy: {color:#de350b}Default [poll] Last Built Revision: Revision{color} 19d6b1e94302eead2020a09f358360887de1b0b8 (origin/testBranch2) The recommended git tool is: NONE{color}

          {color:#172b4d}Why when branch is defined as any(**, or blank) Jenkins is Polling SCM changes on jenkins child, it may not have the latest info?{color}

           
          Li made changes -
          Link New: This issue blocks JENKINS-19022 [ JENKINS-19022 ]
          Li made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            Unassigned Unassigned
            libai567 Li
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: