Multiple GH apps should work with 1 Atlantis instance.
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.
@nishkrishnan am I understanding correctly that the ask here is to support different credentials on a repository by repository basis?
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:
- support more than just one set of credentials for a given instance
- 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
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.
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.
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).
Adding to this issue, Github now supports enterprise scoped apps: https://github.blog/changelog/2024-10-22-enterprises-can-create-github-apps-for-use-within-the-enterprise/
That being said, even with the referenced PRs, you can't run Atlantis with a single app installed in multiple organizations, as Atlantis will only use a single gh-installation-id. So the only solution right now is to have multiple Atlantis instances with a GH App each.