github-community-projects / github-community-projects/safe-settings

100 result per page not properly set

Open
#740 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
921
Forks
226
Avg merge
18h 3m
Merged PRs (30d)
14

Description

## Problem Description

Only 30 results are transmitted per API calls instead of the 100 it should have been, making this app less efficient overall API calls wise.

From looking at the debug output of the run from GA in my organization, I can clearly see during the call to the installations that the number of calls means that only 30 repos are received per call: https://github.com/github/safe-settings/blob/1fff61ceb5175ffbf882972a58b5b5a678602c5e/lib/settings.js#L485

I think this should be checked on other calls too, it could be that the setting is not working for any of the calls, I see multiple places where the setting is getting specifically set like here:

1. https://github.com/github/safe-settings/blob/1fff61ceb5175ffbf882972a58b5b5a678602c5e/lib/settings.js#L869
2. https://github.com/github/safe-settings/blob/1fff61ceb5175ffbf882972a58b5b5a678602c5e/index.js#L221
3. https://github.com/github/safe-settings/blob/1fff61ceb5175ffbf882972a58b5b5a678602c5e/index.js#L238

The last one should have been the one that affect the installation/repositories call if I understand correctly, but it does not

### What is actually happening
I have 1300~ repos, there was 44 pages to go through
### What is the expected behavior
only up to 14 pages should have been checked
### Error output, if available

```
2025-01-12T12:50:33.8471618Z DEBUG (github): GitHub request: GET https://api.github.com/installation/repositories?page=44 - 200
```

## Context

### Are you using the hosted instance of probot/settings or running your own?
I'm using GA full-sync from self hosted runner
### If running your own instance, are you using it with github.com or GitHub Enterprise?
github.com
#### Version of probot/settings
N/A
#### Version of GitHub Enterprise
N/A

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.