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

Retrieve more items from the REST API per call #442

Open
variableresistor opened this issue Jan 7, 2025 · 1 comment
Open

Retrieve more items from the REST API per call #442

variableresistor opened this issue Jan 7, 2025 · 1 comment
Labels
enhancement An issue or pull request introducing new functionality to the project. triage needed An issue that needs to be reviewed by a member of the team.

Comments

@variableresistor
Copy link
Contributor

Feature Idea Summary

Add support for varying page sizes using the per_page parameter.

Feature Idea Additional Details

We have a large number of repos, and it's far faster to retrieve as many as possible in a single request. GitHub's REST API supports the per_page parameter that allows us to retrieve up to 100 items (for the endpoints I checked), defaulting to 30 items.

Requested Assignment

I can do it, but it seems a bit complex, based on Invoke-GHRestMethodMultipleResult. So I might have to have guidance as far as the standards I need to follow in this function.

Operating System

All

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.4.6
PSEdition                      Core
GitCommitId                    7.4.6
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module Version

Running: 0.17.0
Installed: 0.17.0

@variableresistor variableresistor added enhancement An issue or pull request introducing new functionality to the project. triage needed An issue that needs to be reviewed by a member of the team. labels Jan 7, 2025
@variableresistor
Copy link
Contributor Author

Maybe add a setting "perPage" and default it to 0. Then implement the parameter on a case-by-case basis:

$perPage = Get-GitHubConfiguration -Name 'PerPage'
if ($perPage -gt 0) { $getParams += "per_page=$perPage" }

In GitHubRepositories.ps1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An issue or pull request introducing new functionality to the project. triage needed An issue that needs to be reviewed by a member of the team.
Projects
None yet
Development

No branches or pull requests

1 participant