Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pagination for repository listing #4

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

theztefan
Copy link
Collaborator

Add pagination to the repository listing function to handle organizations with bigger number of repositories.

This change improves the API calls for orgs with smaller number of repos as well as it increases the repositories per page pages (of 100).

@theztefan theztefan requested a review from Copilot February 11, 2025 17:08
@theztefan theztefan self-assigned this Feb 11, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request implements pagination for the repository listing function so that organizations with many repositories can be handled efficiently. Key changes include:

  • Introducing pagination parameters (perPage and page) in the repository listing function.
  • Iterating through paginated responses and aggregating repository names.

Changes

File Description
cmd/utils.go Updated ListRepos function to paginate API calls for repository listing

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

cmd/utils.go:90

  • [nitpick] The variable name 'url' might conflict with the standard library package name 'url'; consider renaming it to 'requestURL' or a similarly descriptive name to improve clarity.
url := fmt.Sprintf("orgs/%s/repos?per_page=%d&page=%d", org, perPage, page)

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@theztefan theztefan merged commit ffde748 into main Feb 11, 2025
3 checks passed
@theztefan theztefan deleted the theztefan/repos-pagination branch February 11, 2025 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant