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

Jenkins doesn't always build the git branch we asked

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      The project is here : https://github.com/exoportal/exogtn
      We have 2 main branches : master = 3.1.x and 3.2.x branch
      I have several jenkins jobs for each branch
      Several times we noticed that in jobs configured for 3.1.x (master) , jenkins built sources from 3.2.x
      I attach a screenshot of my configuration of this job : https://ci.exoplatform.org/job/gatein-portal-3.1.x-exo-pkg
      Branch specifier is set to origin/master.
      If we look at the history of its builds :
      https://ci.exoplatform.org/job/gatein-portal-3.1.x-exo-pkg/67/ => 3.2.x

      logs
      Checkout:workspace / /home/swfhudson/data/jobs/gatein-portal-3.1.x-exo-pkg/workspace - hudson.remoting.LocalChannel@129a4ed
      Using strategy: Default
      Last Built Revision: Revision c5e0dadd718190ac5048291cae5ecbbd9afc73fe (origin/master)
      Checkout:workspace / /home/swfhudson/data/jobs/gatein-portal-3.1.x-exo-pkg/workspace - hudson.remoting.LocalChannel@129a4ed
      Fetching changes from 1 remote Git repository
      Fetching upstream changes from git://github.com/exoportal/exogtn.git
      Pruning obsolete local branches
      Commencing build of Revision e9a51a044611c9add919d74f7271d8eab0125b44 (origin/master)
      Checking out Revision e9a51a044611c9add919d74f7271d8eab0125b44 (origin/master)
      Cleaning workspace
      No emails were triggered.
      

      https://ci.exoplatform.org/job/gatein-portal-3.1.x-exo-pkg/68/ => 3.1.x

      logs
      Checkout:workspace / /home/swfhudson/data/jobs/gatein-portal-3.1.x-exo-pkg/workspace - hudson.remoting.LocalChannel@129a4ed
      Using strategy: Default
      Last Built Revision: Revision e9a51a044611c9add919d74f7271d8eab0125b44 (origin/master)
      Checkout:workspace / /home/swfhudson/data/jobs/gatein-portal-3.1.x-exo-pkg/workspace - hudson.remoting.LocalChannel@129a4ed
      Fetching changes from 1 remote Git repository
      Fetching upstream changes from git://github.com/exoportal/exogtn.git
      Pruning obsolete local branches
      Commencing build of Revision 692f33bbeafe2643a5874ed1f5ff26ed49b3f78f (origin/master)
      Checking out Revision 692f33bbeafe2643a5874ed1f5ff26ed49b3f78f (origin/master)
      Cleaning workspace
      

      https://ci.exoplatform.org/job/gatein-portal-3.1.x-exo-pkg/69/ => 3.2.x

      logs
      Checkout:workspace / /home/swfhudson/data/jobs/gatein-portal-3.1.x-exo-pkg/workspace - hudson.remoting.LocalChannel@129a4ed
      Using strategy: Default
      Last Built Revision: Revision 692f33bbeafe2643a5874ed1f5ff26ed49b3f78f (origin/master)
      Checkout:workspace / /home/swfhudson/data/jobs/gatein-portal-3.1.x-exo-pkg/workspace - hudson.remoting.LocalChannel@129a4ed
      Fetching changes from 1 remote Git repository
      Fetching upstream changes from git://github.com/exoportal/exogtn.git
      Pruning obsolete local branches
      Commencing build of Revision e9a51a044611c9add919d74f7271d8eab0125b44 (origin/master)
      Checking out Revision e9a51a044611c9add919d74f7271d8eab0125b44 (origin/master)
      Cleaning workspace
      No emails were triggered.
      

      https://ci.exoplatform.org/job/gatein-portal-3.1.x-exo-pkg/70/ => 3.1.x

      logs
      Checkout:workspace / /home/swfhudson/data/jobs/gatein-portal-3.1.x-exo-pkg/workspace - hudson.remoting.LocalChannel@129a4ed
      Using strategy: Default
      Last Built Revision: Revision e9a51a044611c9add919d74f7271d8eab0125b44 (origin/master)
      Checkout:workspace / /home/swfhudson/data/jobs/gatein-portal-3.1.x-exo-pkg/workspace - hudson.remoting.LocalChannel@129a4ed
      Fetching changes from 1 remote Git repository
      Fetching upstream changes from git://github.com/exoportal/exogtn.git
      Pruning obsolete local branches
      Commencing build of Revision 692f33bbeafe2643a5874ed1f5ff26ed49b3f78f (origin/master)
      Checking out Revision 692f33bbeafe2643a5874ed1f5ff26ed49b3f78f (origin/master)
      Cleaning workspace
      No emails were triggered.
      

      Perhaps we have a wrong usage of git in this project, as I didn't yet noticed such issue for others git projects we have but It is a big issue for us to not be able to build the good branch

        Attachments

          Issue Links

            Activity

            Hide
            edovale edovale added a comment -

            I am also seeing this problem with version 1.1.10.
            I think the branch selected is the one that was last committed to although I have no hard probe of this.

            Show
            edovale edovale added a comment - I am also seeing this problem with version 1.1.10. I think the branch selected is the one that was last committed to although I have no hard probe of this.
            Hide
            abayer Andrew Bayer added a comment -

            I'm going to assign this to kevinsawicki, since I think he's responsible for the buildchooser changes, which are probably the origin of this problem.

            Show
            abayer Andrew Bayer added a comment - I'm going to assign this to kevinsawicki, since I think he's responsible for the buildchooser changes, which are probably the origin of this problem.
            Hide
            kevinsawicki Kevin Sawicki added a comment -

            Just to confirm, you don't see this issue with the 1.1.9 version of the git-plugin? It is only occurring with the 1.1.10 version?

            Show
            kevinsawicki Kevin Sawicki added a comment - Just to confirm, you don't see this issue with the 1.1.9 version of the git-plugin? It is only occurring with the 1.1.10 version?
            Hide
            edovale edovale added a comment -

            I can't give you certainty on that statement. All I know is we started seen the issue 2 days ago. I updated the plugin probably over the weekend. I will downgrade and let you know if we see the problem again.

            Show
            edovale edovale added a comment - I can't give you certainty on that statement. All I know is we started seen the issue 2 days ago. I updated the plugin probably over the weekend. I will downgrade and let you know if we see the problem again.
            Hide
            aheritier Arnaud Héritier added a comment -

            I downgraded to 1.1.9, ~12 hours ago and for now I didn't see the problem back.
            I'll inform you if it will be always the case in 24h

            Show
            aheritier Arnaud Héritier added a comment - I downgraded to 1.1.9, ~12 hours ago and for now I didn't see the problem back. I'll inform you if it will be always the case in 24h
            Hide
            peterp Peter Pawlowski added a comment - - edited

            We just encountered this same issue with version 1.1.10 – it was very confusing. Basically our job is supposed to track a branch called "8.0" but instead it was checking out the head of the default branch (which we call "development"), even though it said it was checking out origin/8.0.

            We fixed this problem by disabling the "Wipe out workspace before build" option in our job configuration. It appears from your output ("Cleaning workspace") that you also have this option enabled.

            We verified that when we enabled this option on another job, it caused the broken behavior.

            Show
            peterp Peter Pawlowski added a comment - - edited We just encountered this same issue with version 1.1.10 – it was very confusing. Basically our job is supposed to track a branch called "8.0" but instead it was checking out the head of the default branch (which we call "development"), even though it said it was checking out origin/8.0. We fixed this problem by disabling the "Wipe out workspace before build" option in our job configuration. It appears from your output ("Cleaning workspace") that you also have this option enabled. We verified that when we enabled this option on another job, it caused the broken behavior.
            Hide
            edovale edovale added a comment -

            I our case, the jobs were we saw this problem were not wiping out the workspace.

            Show
            edovale edovale added a comment - I our case, the jobs were we saw this problem were not wiping out the workspace.
            Hide
            docwhat Christian Höltje added a comment -

            So when you went to git, clicked the second "Advanced" button the "Wipe out workspace before build" was not checked?

            Did you have any other options checked that aren't set by default?

            Show
            docwhat Christian Höltje added a comment - So when you went to git, clicked the second "Advanced" button the "Wipe out workspace before build" was not checked? Did you have any other options checked that aren't set by default?
            Hide
            aheritier Arnaud Héritier added a comment -

            I activated the option "Clean after checkout" and "Prune branches" after having discovered the issue and it didn't help.

            Show
            aheritier Arnaud Héritier added a comment - I activated the option "Clean after checkout" and "Prune branches" after having discovered the issue and it didn't help.
            Hide
            abayer Andrew Bayer added a comment -

            This is fixed in the emergency 1.1.11 release. We rolled back changes to DefaultBuildChooser that broke horribly in any case where you weren't using "**" as the branch spec. Yeesh.

            Show
            abayer Andrew Bayer added a comment - This is fixed in the emergency 1.1.11 release. We rolled back changes to DefaultBuildChooser that broke horribly in any case where you weren't using "**" as the branch spec. Yeesh.
            Hide
            aheritier Arnaud Héritier added a comment -

            For now I didn't reproduce this error with 1.1.11
            thx

            Show
            aheritier Arnaud Héritier added a comment - For now I didn't reproduce this error with 1.1.11 thx

              People

              • Assignee:
                kevinsawicki Kevin Sawicki
                Reporter:
                aheritier Arnaud Héritier
              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: