jenkinsci / jenkinsci/github-branch-source-plugin

[JENKINS-49187] Use the GitHub Search API rather than the GitHub Repository API

Open
#1,162 0 comments 0 reactions 0 assignees View on GitHub
component:github-branch-source-plugin enhancement imported-jira-issue performance priority:minor resolution:unresolved
Dominant language
Java
Stars
217
Forks
398
Avg merge
30m
Merged PRs (30d)
1

Description

For listing repositories for an organization, I believe the current approach is to iterate through the organization's whole repository list using the listRepositories method while applying the user's defined filter on the result. Even with the configurable steps available, this may not scale well for large organisations with many repositories and regularly hit the API rate limit.

I believe that this can be improved by instead using the searchRepositories method as this uses GHRepositorySearchBuilder which implements GitHub's v3 search API rather than the repository API.

With the search API you can then achieve the same desired result by performing filtering using the query parameters available, but using this API would greatly reduce the amount of API calls necessary to return the repositories for an organisation, for example:

 

/search/repositories?q=org:orgName nameFilter

 

---
Originally reported by danjford, imported from: Use the GitHub Search API rather than the GitHub Repository API


  • status: Open
  • priority: Minor
  • component(s): github-branch-source-plugin
  • label(s): performance
  • resolution: Unresolved
  • votes: 1
  • watchers: 4
  • imported: 2025-12-02

Raw content of original issue

For listing repositories for an organization, I believe the current approach is to iterate through the organization's whole repository list using the listRepositories method while applying the user's defined filter on the result. Even with the configurable steps available, this may not scale well for large organisations with many repositories and regularly hit the API rate limit.

I believe that this can be improved by instead using the searchRepositories method as this uses GHRepositorySearchBuilder which implements GitHub's v3 search API rather than the repository API.

With the search API you can then achieve the same desired result by performing filtering using the query parameters available, but using this API would greatly reduce the amount of API calls necessary to return the repositories for an organisation, for example:

 



/search/repositories?q=org:orgName nameFilter


 

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.