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

GitHub App to support credentials with multiple organizations

      We are trying to use same app on Jobs across orgs and is not working as we need to maintain duplicate credentials for multiple organization.

      Maintaining same credentials for multiple orgs seems duplicate to me, is there any chance we can avoid this?

      Our use case is, since it is internal (GitHub Enterprise) bot, it is pretty open and we don't even know who would invite this bot to their organization, and this bot does takes care of creating Jenkins job through DSL scripts, which is using the standard credentials. So it is very hard to keep creating credentials on the fly for every org that this bot is being invited to.

      Thanks a bunch for all the help on maintaining this awesome plugin. Let me know your thoughts please.

      Related discussion on PR: https://github.com/jenkinsci/github-branch-source-plugin/pull/290#discussion_r415168275

          [JENKINS-62220] GitHub App to support credentials with multiple organizations

          Naresh Rayapati created issue -
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-57351 [ JENKINS-57351 ]

          Hutson Betts added a comment -

          My company uses Jenkins in a similar fashion as the company described by nrayapati

          We deployed a single Jenkins GitHub App, which may be installed by any organization on our GHE instance. There are several hundred such organizations.

          We allow our engineers to create jobs as needed within their own Jenkins folders while leveraging the single/shared GitHub App Credential.

          Since any engineer can install our GitHub App on their organization, and any engineer can create an organization, we would be in the situation of needing to create a Credential for every organization as it's created.

          Therefore, I too would like to see support for a single global Credential to work for jobs across multiple organizations.

          Hutson Betts added a comment - My company uses Jenkins in a similar fashion as the company described by nrayapati We deployed a single Jenkins GitHub App, which may be installed by any organization on our GHE instance. There are several hundred such organizations. We allow our engineers to create jobs as needed within their own Jenkins folders while leveraging the single/shared GitHub App Credential. Since any engineer can install our GitHub App on their organization, and any engineer can create an organization, we would be in the situation of needing to create a Credential for every organization as it's created. Therefore, I too would like to see support for a single global Credential to work for jobs across multiple organizations.
          Naresh Rayapati made changes -
          Description Original: We are trying to use same app on Jobs across orgs and is not working as we need to maintain duplicate credentials for multiple organization.

          Maintaining same credentials for multiple orgs seems duplicate to me, is there any chance we can avoid this?

          Our use case is, since it is internal (GitHub Enterprise) bot, it is pretty open and we don't even know who would invite this bot to their organization, and this bot does takes care of creating Jenkins job through DSL scripts, which is using the standard credentials. So it is very hard to keep creating credentials on the fly for every org that this bot is being invited to.

          Thanks a bunch for all the help on maintaining this awesome plugin. Let me know your thoughts I can log a follow up JIRA.

          Related discussion on PR: https://github.com/jenkinsci/github-branch-source-plugin/pull/290#discussion_r415168275
          New: We are trying to use same app on Jobs across orgs and is not working as we need to maintain duplicate credentials for multiple organization.

          Maintaining same credentials for multiple orgs seems duplicate to me, is there any chance we can avoid this?

          Our use case is, since it is internal (GitHub Enterprise) bot, it is pretty open and we don't even know who would invite this bot to their organization, and this bot does takes care of creating Jenkins job through DSL scripts, which is using the standard credentials. So it is very hard to keep creating credentials on the fly for every org that this bot is being invited to.

          Thanks a bunch for all the help on maintaining this awesome plugin. Let me know your thoughts please.

          Related discussion on PR: https://github.com/jenkinsci/github-branch-source-plugin/pull/290#discussion_r415168275

          Leo Quote added a comment -

          I think we can get org name from repo configure instead of credential config , that will fix this.

          Leo Quote added a comment - I think we can get org name from repo configure instead of credential config , that will fix this.

          We have the exact same situation and now running into problems, since the Jenkins Master is delivered by us with a "built-in" GitHub App Credential to be used against the GitHub Enterprise. The problem can be bypassed when making the repository public, which is not intended for all repositories.

          I think the the following issue is related: https://issues.jenkins-ci.org/browse/JENKINS-62594

          Sergei Waigant added a comment - We have the exact same situation and now running into problems, since the Jenkins Master is delivered by us with a "built-in" GitHub App Credential to be used against the GitHub Enterprise. The problem can be bypassed when making the repository public, which is not intended for all repositories. I think the the following issue is related:  https://issues.jenkins-ci.org/browse/JENKINS-62594
          Dee Kryvenko made changes -
          Link New: This issue is duplicated by JENKINS-62594 [ JENKINS-62594 ]

          Dee Kryvenko added a comment - - edited

          To add more context, this isn't just a GHE but a GitHub.com issue as well. From the discussion in that PR:

           I presume the common case is for the Jenkins installation to be used on only a single org.

          That assumption was very, very uninformed to say the least. The whole purpose of the GitHub Apps is so that users/orgs can install the Apps dynamically and it wouldn't require to reconfigure backend system that is behind the App - the backend system should be able to discover who is using it and automatically start catering for a new user/org. The key principle behind GitHub Orgs Folders is automatic repositories discoverability, and initial implementation for GitHub App credentials seems to be contradicting to this principle. Of course, as mentioned in another comment on that PR - it is better than nothing. I understand there is certain complexity associated with implementing this feature and I am not criticizing and I am grateful so that we have this feature at all, even with this limitation. I am merely trying to draw attention and demonstrate significance/importance of this request. Having hundreds of orgs installed a single App is a valid and I would imagine pretty common use case.

          Dee Kryvenko added a comment - - edited To add more context, this isn't just a GHE but a GitHub.com issue as well. From the discussion in that PR :  I presume the common case is for the Jenkins installation to be used on only a single org. That assumption was very, very uninformed to say the least. The whole purpose of the GitHub Apps is so that users/orgs can install the Apps dynamically and it wouldn't require to reconfigure backend system that is behind the App - the backend system should be able to discover who is using it and automatically start catering for a new user/org. The key principle behind GitHub Orgs Folders is automatic repositories discoverability, and initial implementation for GitHub App credentials seems to be contradicting to this principle. Of course, as mentioned in another comment on that PR - it is better than nothing. I understand there is certain complexity associated with implementing this feature and I am not criticizing and I am grateful so that we have this feature at all, even with this limitation. I am merely trying to draw attention and demonstrate significance/importance of this request. Having hundreds of orgs installed a single App is a valid and I would imagine pretty common use case.

          Dileep Reddy added a comment -

          This is really a problem. We have to configure multiple credentials for multiple organizations. And everytime, we install on a new org, we need to make sure its credentials are created too.

          This is a problem especially with plugins that need app-only creds (e.g: github-checks plugin).

          Is there a workaround for this?

          Dileep Reddy added a comment - This is really a problem. We have to configure multiple credentials for multiple organizations. And everytime, we install on a new org, we need to make sure its credentials are created too. This is a problem especially with plugins that need app-only creds (e.g: github-checks plugin). Is there a workaround for this?
          Naresh Rayapati made changes -
          Link New: This issue is related to JENKINS-64662 [ JENKINS-64662 ]

            jglick Jesse Glick
            nrayapati Naresh Rayapati
            Votes:
            5 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              Resolved: