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

Git plugin should populate 'scmName' property in api output

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None

      I marked this as an improvement instead of a bug because I am not sure if 'scmName' is designed to show the information I'm looking for.

      I am trying to figure out how best to do custom build tags for multi-repo builds, based on some internal business rules we have for tag name and content. One thing I noticed while looking at build results through the API is that the 'scmName' property under 'buildsByBranchName' is not populated, even if I give each repo a name under advanced, or have 'unique scm name' selected in my job config. This is true w/ both the multi-scm config and when using the git plugin directly, so I think it's a git plugin 'issue'.

      I think it would be easier to match output to repo if the scmName property reflected the custom name I put in the job config. Or if another property displayed that information. See below for an example of what I'm looking at.

      {
      "buildsByBranchName" : {
      "rel1.00" : {
      "buildNumber" : 38,
      "buildResult" : null,
      "marked" : {
      "SHA1" : "34e051320e481dd2b8a175d36ef5a2dd5d3fa5ad",
      "branch" : [

      { "SHA1" : "34e051320e481dd2b8a175d36ef5a2dd5d3fa5ad", "name" : "rel1.00" }

      ]
      },
      "revision" : {
      "SHA1" : "34e051320e481dd2b8a175d36ef5a2dd5d3fa5ad",
      "branch" : [

      { "SHA1" : "34e051320e481dd2b8a175d36ef5a2dd5d3fa5ad", "name" : "rel1.00" }

      ]
      }
      }
      },
      "lastBuiltRevision" : {
      "SHA1" : "34e051320e481dd2b8a175d36ef5a2dd5d3fa5ad",
      "branch" : [

      { "SHA1" : "34e051320e481dd2b8a175d36ef5a2dd5d3fa5ad", "name" : "rel1.00" }

      ]
      },
      "remoteUrls" : [
      "ssh://user@git.company.com/project.git"
      ],
      "scmName" : ""
      },

          [JENKINS-24718] Git plugin should populate 'scmName' property in api output

          Will Saxon added a comment -

          The description on this issue is incorrect. The scmName is populated, it just doesn't get returned with the particular Run being queried. If I set an scmName when I set up the job, the first build run has the scmName, but if I change the scmName and run the job again, subsequent runs keep the original scmName.

          Will Saxon added a comment - The description on this issue is incorrect. The scmName is populated, it just doesn't get returned with the particular Run being queried. If I set an scmName when I set up the job, the first build run has the scmName, but if I change the scmName and run the job again, subsequent runs keep the original scmName.

          Jamil Ahmed added a comment -

          So the scmName that appears in the API response is supposed to be the "Custom SCM Name" in job's configure page? I have a Custom SCM Name set for one of my repos, but it doesn't show up anywhere in the response.

          Jamil Ahmed added a comment - So the scmName that appears in the API response is supposed to be the "Custom SCM Name" in job's configure page? I have a Custom SCM Name set for one of my repos, but it doesn't show up anywhere in the response.

            Unassigned Unassigned
            wsaxon Will Saxon
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: