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

git-client CLI implementation does not propogate username

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • git-client-plugin
    • None
    • git-plugin 2.3.5
      git-client-plugin 1.17.1
      git on slave 2.4.6

      I add the advanced behavior for submodules, and it fails to clone, as the slave does not use the correct credentials or username to clone the submodule

      In addition, just to clone the base project, I am forced to use the username@ format of the ssh protocol, because the project does not specify this user from the credentials.

      It probably needs to be inserted into the commands on the git-client plugin, though I am not sure exactly how to do this. The work-around solution for this is to modify the ssh_config on the host such that it knows the correct username/port/credentials for that hostname, but this is not very useful if i have to go customize tens or hundreds of slaves.

          [JENKINS-29604] git-client CLI implementation does not propogate username

          Jacob Keller created issue -
          Manoj Kumar made changes -
          Assignee Original: Nicolas De Loof [ ndeloof ] New: Manoj Kumar [ manojoshi ]
          Mark Waite made changes -
          Link New: This issue duplicates JENKINS-20941 [ JENKINS-20941 ]

          Mark Waite added a comment - - edited

          Could you further explain what you mean when you say:

          In addition, just to clone the base project, I am forced to use the username@ format of the ssh protocol, because the project does not specify this user from the credentials.

          Does that mean that you're not using the Jenkins credentials system to manage the credentials for the git repository? If not, why not?

          If that is not what it means, can you please explain further?

          Mark Waite added a comment - - edited Could you further explain what you mean when you say: In addition, just to clone the base project, I am forced to use the username@ format of the ssh protocol, because the project does not specify this user from the credentials. Does that mean that you're not using the Jenkins credentials system to manage the credentials for the git repository? If not, why not? If that is not what it means, can you please explain further?

          Jacob Keller added a comment - - edited

          Is there something special I need to do for credentials that is git specific? I'm already using the Jenkins credentials for the ssh keys. It propogates the SSH key itself just fine, but I don't think the username gets propagated...

          Edit: this occurs with submodules specifically, as I am able to pass user@ to the ssh URL when I format it ie:

          ssh://user@host:port/path/to/repo

          Regards,
          Jake

          Jacob Keller added a comment - - edited Is there something special I need to do for credentials that is git specific? I'm already using the Jenkins credentials for the ssh keys. It propogates the SSH key itself just fine, but I don't think the username gets propagated... Edit: this occurs with submodules specifically, as I am able to pass user@ to the ssh URL when I format it ie: ssh://user@host:port/path/to/repo Regards, Jake

          Jacob Keller added a comment -

          I found the issue in the CLI Git client implementation. The code correctly sets up the SSH key file and an http passphrase, but does not correctly store the username and forward it.

          Thus, as long as the local username matches the remote username things work as expected, but in the case where local username does not match, it does not get correctly setup. I have prepared a pull request on git-client-plugin which I will submit shortly to resolve this.

          Jacob Keller added a comment - I found the issue in the CLI Git client implementation. The code correctly sets up the SSH key file and an http passphrase, but does not correctly store the username and forward it. Thus, as long as the local username matches the remote username things work as expected, but in the case where local username does not match, it does not get correctly setup. I have prepared a pull request on git-client-plugin which I will submit shortly to resolve this.
          Jacob Keller made changes -
          Assignee Original: Manoj Kumar [ manojoshi ] New: Jacob Keller [ jekeller ]
          Jacob Keller made changes -
          Summary Original: git plugin submodule does not propogate credentials and username New: git-client CLI implementation does not propogate username
          Jacob Keller made changes -
          Component/s New: git-client-plugin [ 17423 ]
          Component/s Original: git-plugin [ 15543 ]

          Jacob Keller added a comment -

          See https://github.com/jenkinsci/git-client-plugin/pull/176 for a pull request that fixes the issue.

          Jacob Keller added a comment - See https://github.com/jenkinsci/git-client-plugin/pull/176 for a pull request that fixes the issue.

            jekeller Jacob Keller
            jekeller Jacob Keller
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: