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

Stored git credentials not used when submodule is updated

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      1. Configure a git project that uses a remote and submodule URL of the form https://
      2. Ensure credentials added to Jenkins
      3. Add advanced submodule behaviors with no options selected
      4. First build (where repo is cloned) pulls the submodule correctly
      5. Subsequent builds fail authorization on the submodule part (possibly submodule update if this is being used)

        Attachments

          Issue Links

            Activity

            Hide
            rogerdpack rogerdpack added a comment -

            Anybody able/getting this to work? I haven't been (user/password) using what I believe are the latest versions :| https://gist.github.com/rdp/291bda289a94eae96fc32a30e6db9497

            Show
            rogerdpack rogerdpack added a comment - Anybody able/getting this to work? I haven't been (user/password) using what I believe are the latest versions :| https://gist.github.com/rdp/291bda289a94eae96fc32a30e6db9497
            Hide
            camerongo Cameron Gocke added a comment -

            rogerdpack yes, it is working fine for me. I installed the 3.0.0 version of the plugin using the Plugin Manager in Jenkins, nothing special. (Note: You have to add the Advanced sub-modules behavior to your SCM config and check the box to "Use credentials from default remote of parent repository".)

            Show
            camerongo Cameron Gocke added a comment - rogerdpack yes, it is working fine for me. I installed the 3.0.0 version of the plugin using the Plugin Manager in Jenkins, nothing special. (Note: You have to add the Advanced sub-modules behavior to your SCM config and check the box to "Use credentials from default remote of parent repository".)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jacob Keller
            Path:
            src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
            http://jenkins-ci.org/commit/git-client-plugin/deaf40377a70f9b6995344fbc54a32e29c61098a
            Log:
            git-client: teach submoduleUpdate how to pass credentials

            Teach the submoduleUpdate call to perform submodule URL lookup, and call
            "submodule update" separately for each submodule. Lookup the
            credentials, and call it using launchCommandWithCredentials. This
            enables submodules to correctly get the SSH or HTTP setup necessary such
            that the Jenkins credentials will be passed into each submodule.

            We can't just call "git submodule update" since it may be possible
            (however unlikely!) that each submodule wants to use a separate
            credential. Thus, perform lookup using each URL and run through a
            forloop to actually update each submodule instead of depending on the
            git implementation to do this for us.

            JENKINS-20941 - Credentials and Submodules

            Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jacob Keller Path: src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/deaf40377a70f9b6995344fbc54a32e29c61098a Log: git-client: teach submoduleUpdate how to pass credentials Teach the submoduleUpdate call to perform submodule URL lookup, and call "submodule update" separately for each submodule. Lookup the credentials, and call it using launchCommandWithCredentials. This enables submodules to correctly get the SSH or HTTP setup necessary such that the Jenkins credentials will be passed into each submodule. We can't just call "git submodule update" since it may be possible (however unlikely!) that each submodule wants to use a separate credential. Thus, perform lookup using each URL and run through a forloop to actually update each submodule instead of depending on the git implementation to do this for us. JENKINS-20941 - Credentials and Submodules Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
            Hide
            markewaite Mark Waite added a comment -

            John Smith, can you explain why you assigned yourself as owner of this resolved bug?

            Is there some problem that you intend to investigate or resolve?

            Show
            markewaite Mark Waite added a comment - John Smith , can you explain why you assigned yourself as owner of this resolved bug? Is there some problem that you intend to investigate or resolve?
            Hide
            creste3 John Smith added a comment -

            Sorry, I definitely did not intend to assign myself as the owner of this bug. I suspect that I accidentally pressed one of the JIRA shortcut keys to assign this to myself. I have since disabled keyboard shortcuts because it appears that I am too clumsy to have them enabled.

            There is a problem related to git credentials and submodules that I intend to resolve, but that work should be done in a separate issue because it is related to git LFS.

            Show
            creste3 John Smith added a comment - Sorry, I definitely did not intend to assign myself as the owner of this bug. I suspect that I accidentally pressed one of the JIRA shortcut keys to assign this to myself. I have since disabled keyboard shortcuts because it appears that I am too clumsy to have them enabled. There is a problem related to git credentials and submodules that I intend to resolve, but that work should be done in a separate issue because it is related to git LFS.

              People

              • Assignee:
                creste3 John Smith
                Reporter:
                boinged Steven Shipton
              • Votes:
                118 Vote for this issue
                Watchers:
                134 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: