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

remoteUrls are unordered in build data JSON when multiple git repositories are configured

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin

      When multiple Git repositories are added to the git plugin (not Multiple SCM plugin), the remoteUrls in the build data JSON are unordered (different from the order in which they were configured in the Jenkins job). This is because the remoteUrls are stored in a HashSet in BuildData.java. We can instead store them in a LinkedHashSet and preserve the order.

      This is needed so that we can associate the branch built, origin[x] (where x is the repository index) in lastBuiltRevision with the appropriate repository URL for which there is no provision right now when there are multiple repositories.

      {
      "buildsByBranchName" : {
      "origin/master" : {
      "buildNumber" : 1813,
      "buildResult" : null,
      "revision" :

      { "SHA1" : "a0b422c02d45c71ca6e5317eb3aa6026d0f4ada6", "branch" : [ { "SHA1" : "a0b422c02d45c71ca6e5317eb3aa6026d0f4ada6", "name" : "origin/master" }

      ]
      }
      },
      "origin/mri" : {
      "buildNumber" : 50,
      "buildResult" : null,
      "revision" :

      { "SHA1" : "f68f612f42908af792e831613deb4b6fe43ff513", "branch" : [ { "SHA1" : "f68f612f42908af792e831613deb4b6fe43ff513", "name" : "origin/mri" }

      ]
      }
      }
      },
      "lastBuiltRevision" :

      { "SHA1" : "a0b422c02d45c71ca6e5317eb3aa6026d0f4ada6", "branch" : [ { "SHA1" : "a0b422c02d45c71ca6e5317eb3aa6026d0f4ada6", "name" : "origin1/master" }

      ],
      "remoteUrls" : [
      "https://github.com/repo1.git",
      "https://github.com/repo2.git",
      ]
      }

            Unassigned Unassigned
            pxk5958 Pratith Kanagaraj
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: