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

[REGRESSION] Git Submodules having a name different to their path in working tree, failing to checkout

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • git-plugin
    • Jenkins 2.17, Git Plugin 3.0.0, Git Client Plugin 2.0.0

      I tried to use somehow simplified names for some submodules having more complex path in worktree, ending up in a broken build, as git plugin tries to update-init them using their name instead of their path. leading to a unknown submodule error.

          [JENKINS-37495] [REGRESSION] Git Submodules having a name different to their path in working tree, failing to checkout

          Florian Manschwetus created issue -
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Andrew Bayer made changes -
          Labels Original: git workflow New: git pipeline workflow
          Andrew Bayer made changes -
          Labels Original: git pipeline workflow New: git pipeline

          Mark Waite added a comment -

          I've confirmed this is a bug and have placed a test case for it into my private Jenkins bug verification repository. I won't be able to investigate it for quite a while, but am willing to share the bug verification sample job with others if it will help them investigate a possible fix.

          Mark Waite added a comment - I've confirmed this is a bug and have placed a test case for it into my private Jenkins bug verification repository. I won't be able to investigate it for quite a while, but am willing to share the bug verification sample job with others if it will help them investigate a possible fix.

          Works fine with:

          • Git client plugin 1.19.6
          • Git plugin 2.4.4

          Failed with:

          • Git client plugin 2.0.0
          • Git plugin 3.0.0

          After downgrading Git plugin to 2.4.4 problem still exists.
          After downgrading Git client plugin to 1.19.6 problem has gone.

          Serhii Stasiuk added a comment - Works fine with: Git client plugin 1.19.6 Git plugin 2.4.4 Failed with: Git client plugin 2.0.0 Git plugin 3.0.0 After downgrading Git plugin to 2.4.4 problem still exists. After downgrading Git client plugin to 1.19.6 problem has gone.

          I ran into the same problem.
          I had to downgrade to Git plugin 2.6.0 and Git client plugin 1.21.0.

          From .gitmodules

          [submodule "liflg_library-boost"]
                  path = test/3rd-party-libraries/library-boost
                  url = git@bitbucket.org:liflg/library-boost.git
          

          With Git plugin 2.6.0 and Git client plugin 1.21.0, it looks like this and works:

          Resetting working tree
           > git reset --hard # timeout=10
           > git clean -fdx # timeout=10
           > git submodule foreach --recursive git reset --hard # timeout=10
           > git submodule foreach git clean -fdx # timeout=10
           > git remote # timeout=10
           > git submodule init # timeout=10
           > git submodule sync # timeout=10
           > git config --get remote.origin.url # timeout=10
           > git submodule update
          

          With Git plugin 3.0.0 and Git client plugin 2.0.0, it looks like this and does not work:

           Resetting working tree
           > git reset --hard # timeout=10
           > git clean -fdx # timeout=10
           > git submodule foreach --recursive git reset --hard # timeout=10
           > git submodule foreach git clean -fdx # timeout=10
           > git remote # timeout=10
           > git submodule init # timeout=10
           > git submodule sync # timeout=10
           > git config --get remote.origin.url # timeout=10
           > git config --get-regexp ^submodule # timeout=10
           > git config --get submodule.liflg_library-boost.url # timeout=10
           > git submodule update liflg_library-boost
          FATAL: Command "git submodule update liflg_library-boost" returned status code 1:
          stdout: 
          stderr: error: pathspec 'liflg_library-boost' did not match any file(s) known to git.
          

          As stated in the initial report, the problem seems to be it's using the name of the submodule instead of the path or just the general approach, like with the older versions of the Git/Git client plugins.

          Steffen Pankratz added a comment - I ran into the same problem. I had to downgrade to Git plugin 2.6.0 and Git client plugin 1.21.0. From .gitmodules [submodule "liflg_library-boost"] path = test/3rd-party-libraries/library-boost url = git@bitbucket.org:liflg/library-boost.git With Git plugin 2.6.0 and Git client plugin 1.21.0, it looks like this and works: Resetting working tree > git reset --hard # timeout=10 > git clean -fdx # timeout=10 > git submodule foreach --recursive git reset --hard # timeout=10 > git submodule foreach git clean -fdx # timeout=10 > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update With Git plugin 3.0.0 and Git client plugin 2.0.0, it looks like this and does not work: Resetting working tree > git reset --hard # timeout=10 > git clean -fdx # timeout=10 > git submodule foreach --recursive git reset --hard # timeout=10 > git submodule foreach git clean -fdx # timeout=10 > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git config --get-regexp ^submodule # timeout=10 > git config --get submodule.liflg_library-boost.url # timeout=10 > git submodule update liflg_library-boost FATAL: Command "git submodule update liflg_library-boost" returned status code 1: stdout: stderr: error: pathspec 'liflg_library-boost' did not match any file(s) known to git. As stated in the initial report, the problem seems to be it's using the name of the submodule instead of the path or just the general approach, like with the older versions of the Git/Git client plugins.
          Mark Waite made changes -
          Comment [ Thanks. Since a work around is available, I'll leave the detailed investigation of this for another time. ]
          Mark Waite made changes -
          Assignee New: Mark Waite [ markewaite ]

          Mark Waite added a comment - - edited

          I believe that the root cause of this regression is the change in deaf40377 which loops over the listed modules to initialize them. That area of the plugin especially suffers from a lack of automated tests. I'll add tests as part of investigating this bug. Until the bug can be fixed, users will need to continue to use git plugin 2.6.0 and git client plugin 1.21.0.

          Mark Waite added a comment - - edited I believe that the root cause of this regression is the change in deaf40377 which loops over the listed modules to initialize them. That area of the plugin especially suffers from a lack of automated tests. I'll add tests as part of investigating this bug. Until the bug can be fixed, users will need to continue to use git plugin 2.6.0 and git client plugin 1.21.0.

            markewaite Mark Waite
            manschwetus Florian Manschwetus
            Votes:
            11 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: