GitHub Importer Organization Filter is Limited to Only 25 Organizations
Summary
When importing repositories from GitHub, the Organization filter tab only displays organizations from the first page of results (maximum 25). If a user belongs to more than 25 organizations, there's no way to filter by organizations that aren't displayed in the initial results. This makes it impossible for users to filter by organizations beyond the first 25, even though the repositories themselves are properly fetched and displayed in the importer.
Steps to reproduce
- Start a new project import from GitHub (Create new > Import project > GitHub)
- Authorize with GitHub using OAuth or a Personal Access Token belonging to a user that is a member of more than 25 organizations
- Try to use Organizations filter dropdown and notice that not all organizations are available for selection in that dropdown.
- Note that repositories from all organizations are correctly displayed and can be imported, but cannot be filtered by organizations beyond the first 25 because we are making a request with default pagination:
"https://github.example.com/api/v3/user/orgs?per_page=25"
Example Project
What is the current bug behavior?
When a user is a member of more than 25 GitHub organizations, the Organization filter in the GitHub importer only displays the first page of organizations (up to 25) and doesn't allow filtering by the rest of the orgs.
What is the expected correct behavior?
The Organization filter should support pagination to allow users to browse through all their organizations and conveniently select projects for import.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
Workaround
Use GitHub Import API.