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

'github' credentialId doesn't work when creating GitHub org folder

    Details

    • Epic Link:
    • Sprint:
      pannonian, iapetus
    • Similar Issues:

      Description

      As reported by Cliff Meyers:

      I've been working on the Github Creation API and have the first simplest flow wired up for creating an org folder. I am encountering a problem although I found the workaround for it. I wanted to run it by you to see what you think.

      First the UI calls this endpoint to get the credential that I previously created:
      http://localhost:8080/jenkins/blue/rest/organizations/jenkins/scm/github/

      It returns an object like this (omitting _class and _links)

      {
          "credentialId": "github",
          "id": "github",
          "uri": "https://api.github.com"
      }
      

      Then I make a call to fetch the orgs which works fine:
      http://localhost:8080/jenkins/blue/rest/organizations/jenkins/scm/github/organizations/?credentialId=github

      Then when I make the creation call I send an object like this:

      {
          "name": "cliffmeyers",
          "$class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubPipelineCreateRequest",
          "scmConfig": {
              "uri": "https://api.github.com",
              "config": {
                  "orgName": "cliffmeyers",
                  "repos": []
              }
          }
      }
      

      This works fine. However if I add the credentialId: 'github' to this it fails saying invalid credential.

        Attachments

          Issue Links

            Activity

            Hide
            vivek Vivek Pandey added a comment -

            Cliff MeyersGithubScmNavigator does lookup for credentials bit differently that how the 'github' credential is created by blueocean. So when GitHubScmNavigator does a lookup for 'github' credentialId, null is returned. Fix is in progress.

            Show
            vivek Vivek Pandey added a comment - Cliff Meyers GithubScmNavigator does lookup for credentials bit differently that how the 'github' credential is created by blueocean. So when GitHubScmNavigator does a lookup for 'github' credentialId, null is returned. Fix is in progress.

              People

              • Assignee:
                vivek Vivek Pandey
                Reporter:
                vivek Vivek Pandey
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: