You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d7bec9d
Browse filesBrowse the repository at this point in the historyBrowse files
authored
GitHub Runner Scaler: Respect paging for jobs (#7973)
* Add failing test
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* Fetch multiple pages if available
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* Add Changgelog-entry
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* Update CHANGELOG.md
Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
* Cache job-pages instead of Jobs, so we can make sure, that the caching can be used for all pages instead of only the first one.
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* Merge-fixes
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* Add a maximum for pages to fetch
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* Update CHANGELOG.md
Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
* GitHub Runner Scaler: Add optional maxPages trigger parameter and raise pagination log level
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* GitHub Runner Scaler: Fix test build, validate maxPages, add changelog entry
- Add missing githubDefaultMaxPages constant referenced by tests
(test package failed to compile without it).
- Validate that maxPages is >= 1 in parseGitHubRunnerMetadata so a
misconfigured value fails fast instead of silently limiting
pagination to a single page.
- Add a CHANGELOG.md entry for #7969 under Fixes.
- Add a regression test for the maxPages validation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* Remove max-pages truncation for repositories
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
* Update CHANGELOG.md
Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
---------
Signed-off-by: Jan Grävell <jan.graevell@prodyna.com>
Signed-off-by: Jan Grävell <141423264+jangraevell-pd@users.noreply.github.com>
Signed-off-by: Rick Brouwer <rickbrouwer@gmail.com>
Co-authored-by: Rick Brouwer <rickbrouwer@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
// GitHub returned fewer than a full page, so there are no more jobs left to fetch
761
+
iflen(jobs) <githubJobsPerPage {
762
+
break
763
+
}
764
+
765
+
ifpage>=s.metadata.MaxPages {
766
+
s.logger.Info(fmt.Sprintf("Reached max page limit (%d) while fetching jobs for workflow run %d in repo %s, results may be incomplete", s.metadata.MaxPages, workflowRunID, repoName))
767
+
break
768
+
}
769
+
770
+
page++
771
+
}
772
+
773
+
returnallJobs, nil
723
774
}
724
775
725
776
// getWorkflowRuns returns a list of workflow runs for a given repository
@@ -849,22 +900,29 @@ func (s *githubRunnerScaler) pruneCaches(currentRepos []string) {
0 commit comments