runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.68k stars 1.05k forks source link

Multiple GH apps should work with 1 Atlantis instance. #1229

Open nishkrishnan opened 3 years ago

nishkrishnan commented 3 years ago

GH app support is written in a way which only supports 1 installation and 1 app id on a given instance. This is not very flexible and if Atlantis can support multiple VCS providers at once it should be able to support multiple gh apps as well.

I can look into adding this feature when I get some time.

acastle commented 3 years ago

@nishkrishnan am I understanding correctly that the ask here is to support different credentials on a repository by repository basis?

nishkrishnan commented 3 years ago

i think a good example here is that let's say an organization is running public github and github enterprise. To support repos in both, you'd need to either have a github app created on both platforms OR configure webhooks on both platforms.

Currently with the former, we'd need separate atlantis instances but with the latter a single atlantis instance can be used.

So we'd need to do the following: 1) support more than just one set of credentials for a given instance 2) use the installation id sent in the event, instead of querying for it, which would also as a bonus allow more than one installation of the app

unRob commented 3 years ago

This is a great idea @nishkrishnan! Do you have any suggestions of how we'd go about configuring atlantis for this use case? I bailed at attempting to address mutliple github apps in the PR that added the integration but would love to see a more flexible approach land in a future release, and will gladly help nurse along a PR.

john-tipper commented 4 months ago

Please see my PR #4579 which I think goes a long way to supporting this. Please let me know what you think @nishkrishnan @acastle @unRob.

laughedelic commented 3 months ago

I think that #4579 is a great feature, but it's different from this request. It's not always possible to use a single app installed in multiple organizations. If users want to keep their app private, they can install it only in the organization it is created in (making it public is a security concern; someone else might be able to install it).