{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/git-client-plugin/issues/180","labels_url":"https://api.github.com/repos/jenkinsci/git-client-plugin/issues/180/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/git-client-plugin/issues/180/comments","events_url":"https://api.github.com/repos/jenkinsci/git-client-plugin/issues/180/events","html_url":"https://github.com/jenkinsci/git-client-plugin/pull/180","id":98859199,"number":180,"title":"(WIP) git-client: teach submoduleUpdate how to pass credentials","user":{"login":"jacob-keller","id":874719,"avatar_url":"https://avatars.githubusercontent.com/u/874719?v=3","gravatar_id":"","url":"https://api.github.com/users/jacob-keller","html_url":"https://github.com/jacob-keller","followers_url":"https://api.github.com/users/jacob-keller/followers","following_url":"https://api.github.com/users/jacob-keller/following{/other_user}","gists_url":"https://api.github.com/users/jacob-keller/gists{/gist_id}","starred_url":"https://api.github.com/users/jacob-keller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacob-keller/subscriptions","organizations_url":"https://api.github.com/users/jacob-keller/orgs","repos_url":"https://api.github.com/users/jacob-keller/repos","events_url":"https://api.github.com/users/jacob-keller/events{/privacy}","received_events_url":"https://api.github.com/users/jacob-keller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"MarkEWaite","id":156685,"avatar_url":"https://avatars.githubusercontent.com/u/156685?v=3","gravatar_id":"","url":"https://api.github.com/users/MarkEWaite","html_url":"https://github.com/MarkEWaite","followers_url":"https://api.github.com/users/MarkEWaite/followers","following_url":"https://api.github.com/users/MarkEWaite/following{/other_user}","gists_url":"https://api.github.com/users/MarkEWaite/gists{/gist_id}","starred_url":"https://api.github.com/users/MarkEWaite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarkEWaite/subscriptions","organizations_url":"https://api.github.com/users/MarkEWaite/orgs","repos_url":"https://api.github.com/users/MarkEWaite/repos","events_url":"https://api.github.com/users/MarkEWaite/events{/privacy}","received_events_url":"https://api.github.com/users/MarkEWaite/received_events","type":"User","site_admin":false},"milestone":null,"comments":46,"created_at":"2015-08-03T23:46:43Z","updated_at":"2015-11-05T16:07:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/git-client-plugin/pulls/180","html_url":"https://github.com/jenkinsci/git-client-plugin/pull/180","diff_url":"https://github.com/jenkinsci/git-client-plugin/pull/180.diff","patch_url":"https://github.com/jenkinsci/git-client-plugin/pull/180.patch"},"body":"Teach the submoduleUpdate call to perform submodule URL lookup, and call\r\n\"submodule update\" separately for each submodule. Lookup the\r\ncredentials, and call it using launchCommandWithCredentials. This\r\nenables submodules to correctly get the SSH or HTTP setup necessary such\r\nthat the Jenkins credentials will be passed into each submodule.\r\n\r\nWe can't just call \"git submodule update\" since it may be possible\r\n(however unlikely!) that each submodule wants to use a separate\r\ncredential. Thus, perform lookup using each URL and run through a\r\nforloop to actually update each submodule instead of depending on the\r\ngit implementation to do this for us.\r\n\r\nJENKINS-20941 - Credentials and Submodules\r\n\r\nNOTE: this depends on a change in the git-plugin to enable setting up default credentials or adding credentials for the submodule URL. I have submitted the pull request to git-plugin which enables advanced extensions for adding credentials to arbitrary URLs or as the default credentials.\r\n\r\nIt would be possible to just run \"git submodule update\" as before if we assume that \"default\" credentials are good enough, and supporting per-submodule credentials is not good. I believe per-module credentials should be supported which is why I went with the given implementation.\r\n\r\nThis patch together with the git-plugin patch do work in my setup, but I haven't yet had time to add more tests for this feature. It passes all of the current tests.\r\n\r\n\r\nHTTP\r\n--\r\nThis series also includes a fix for HTTP authentication that *should* also enable us to remove the clone = init+fetch setup. I believe we have enough tests for that particular change in behavior.\r\n\r\nThe HTTP patch removes use of the git-credential storage and instead just uses a GIT_ASKPASS script that will output username and password when given the suitable prompt. For stdin matching \"Username\" it outputs username, for stdin matching \"Password\" it outputs the password. This is much cleaner, and should even allow git-clone to work as expected without need to create credentials store.\r\n\r\nI should note that the default test for the CSV repostiories found in auth-data requires that the repository contains a README.md which my repositories do not, resulting in test failures for no good reason. This should probably be fixed."},"comment":{"url":"https://api.github.com/repos/jenkinsci/git-client-plugin/issues/comments/154104310","html_url":"https://github.com/jenkinsci/git-client-plugin/pull/180#issuecomment-154104310","issue_url":"https://api.github.com/repos/jenkinsci/git-client-plugin/issues/180","id":154104310,"user":{"login":"codybaxter","id":12971763,"avatar_url":"https://avatars.githubusercontent.com/u/12971763?v=3","gravatar_id":"","url":"https://api.github.com/users/codybaxter","html_url":"https://github.com/codybaxter","followers_url":"https://api.github.com/users/codybaxter/followers","following_url":"https://api.github.com/users/codybaxter/following{/other_user}","gists_url":"https://api.github.com/users/codybaxter/gists{/gist_id}","starred_url":"https://api.github.com/users/codybaxter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codybaxter/subscriptions","organizations_url":"https://api.github.com/users/codybaxter/orgs","repos_url":"https://api.github.com/users/codybaxter/repos","events_url":"https://api.github.com/users/codybaxter/events{/privacy}","received_events_url":"https://api.github.com/users/codybaxter/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T16:07:06Z","updated_at":"2015-11-05T16:07:06Z","body":"I am seeing that issue too. It looks like the useParentCred flag isn't being set or read from the config file. When I updated the config file, I am still having a build failure because it isn't using the parent cred."}}