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

Cannot get the repositories from the git plugin via the API

      I'm trying to write a plugin that needs information from SCM plugins.

      I'm having trouble extracting information from the Git plugin. I think it has some bugs that are causing it to not report data even though there's a great good deal of code in there to generate the answers.

      Specifically, I can't find any incantation of scm/api/json that returns useful data in the repositories attribute. It seems to be an empty list. JENKINS-14588 reports that the 'branches' field is also empty. I'm curious if the root cause is similar for both or if they're separate issues.

      {
      "browser" : null,
      "type" : "hudson.plugins.git.GitSCM",
      "branches" : [
      {

      }
      ],
      "mergeOptions" :

      { "mergeRemote" : null, "mergeTarget" : null, "remoteBranchName" : null }

      ,
      "repositories" : [
      {

      }
      ],
      "userRemoteConfigs" : [

      { "name" : "", "refspec" : "", "url" : "ssh://git-server:29418/projectname" }

      ]
      }

          [JENKINS-16558] Cannot get the repositories from the git plugin via the API

          Mark Waite added a comment -

          The XML API with depth 4 returns:

          <scm _class="hudson.plugins.git.GitSCM">
            <browser _class="hudson.plugins.git.browser.GithubWeb"/>
            <type>hudson.plugins.git.GitSCM</type>
            <branche>
              <name>*/master</name>
            </branche>
            <mergeOptions>
              <fastForwardMode>--ff</fastForwardMode>
              <mergeStrategy>default</mergeStrategy>
            </mergeOptions>
            <userRemoteConfig>
              <name>origin</name>
              <url>https://github.com/jenkinsci/git-client-plugin.git</url>
            </userRemoteConfig>
          </scm>
          

          That's all that I plan to do on this issue.

          Mark Waite added a comment - The XML API with depth 4 returns: <scm _class="hudson.plugins.git.GitSCM"> <browser _class="hudson.plugins.git.browser.GithubWeb"/> <type>hudson.plugins.git.GitSCM</type> <branche> <name>*/master</name> </branche> <mergeOptions> <fastForwardMode>--ff</fastForwardMode> <mergeStrategy>default</mergeStrategy> </mergeOptions> <userRemoteConfig> <name>origin</name> <url>https://github.com/jenkinsci/git-client-plugin.git</url> </userRemoteConfig> </scm> That's all that I plan to do on this issue.

            Unassigned Unassigned
            jdmarshall Jason Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: