Getting `repository_selection` for an installation


#1

Would it be possible to add the repository_selection key, found in installation repositories added/removed webhooks, into the integration_installation webhook, and the response to GET /integration/installations/<installation-id>?

In our integration, we want to automatically enable our app on all of the repos selected if they were manually selected, but let the user make the selection if they gave us permission to all repos. We’d also like to know when to show a “don’t see the repo you’re looking for” link, based on the above.


#2

Hey again, @greysteil :wave:

That’s an interesting idea – I see how having that field in those other places would be useful for your use-case. I’ll open an internal issue so that the team can consider this and we’ll followup here as soon as there’s any news.

Thanks for the feedback! :cake:


#3

Hi,

The project I’m working on also would benefit from knowing whether an installation was installed for a manual set of repos, or on all repos. This way the user can quickly figure out whether he needs to read through the list of installed repos for the one they are interested, or whether he can be confident his repo is integrated (since they’re all integrated).

As @greysteil mentioned, the repository_selection key found on the InstallationRepositoriesEvent is what we’re after.

Ideally that value would be made available on the InstallationEvent webhook, which makes sense to me.

I think another place where this info might be relevant & useful would be on the Integration List Repositories endpoint.

Thanks :slight_smile:


#4

Thanks for expressing interest, @matthieualouis – I’ve passed this along to the team as well. :+1:


#5

@greysteil @matthieualouis You should now see the repository_selection field in more webhook payloads and API responses, as you suggested. Let me know if there’s any other place you’d like to see them or if we missed anything. And thanks again for the feedback!


#6

:heart:


#7

@izuzak I can see repositories_added being sent in the installation_repositories::added webhook, which is sent when one changes the repositories an already installed app can access.

This information however is still missing in the installation::created webhook, which is sent when an app is first installed.

All we can see is installation.repository_selection: selected, which indicates the app doesn’t have access to all repositories, but a choice was made. The webhook does not tell which ones were enabled.

Hope this can be added as well!
Thanks


#8

Thanks for the suggestion, @flaviocopes – I’ll ask the team to see if we can add that as well. We’ll followup here as soon as there any news.

And for now, you can get that information via the API.


#9

Hey @greysteil, @matthieualouis, and @flaviocopes !

Our team just pushed out an update that adds an Array of repositories that were installed when a GitHub App installation was created to the webhook payload. Also, the repository_selection field is available in that payload.

We hope that you find these updates helpful. If you have any thoughts or questions for us – feel free to reach out! :v: