Apply the Github app filter before instead of after getting data in the integration
K
Kevin Puventhiranathan
We have over 14k+ repos in our Port inventory at the moment.
Only about a 1/4 are active (not archived).
If we set the query in the selector to ".repo.archived == false", the GitHub integration pulls all repos, and then filters at the point of mapping.
The list organization repos in the REST API (doc) doesn't support using the archive filter.
But the search api (REST, GraphQL) allows active repos to be fetched using the following query:
archived: false
:- https://docs.github.com/en/rest/search/search?versionId=free-pro-team%40latest&productId=search-github&restPage=searching-on-github%2Csearching-for-repositories&apiVersion=2022-11-28#search-repositories
- https://docs.github.com/en/graphql/reference/queries#search
We would like the filter to apply before and not after (like it currently does).
It would make the github integration faster and reduce load.
M
Marcel Rossouw
Have you tried adding something like this in the query selector? we used this to remove pull-requests from archived repo's already in the catalog, so perhaps it can then remove those archived repo's (it's a workaround at best)
(if .head?.repo?.archived then false else true end)