-
Notifications
You must be signed in to change notification settings - Fork 546
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
fix: circleci plugin pagination #7770
Conversation
@@ -81,7 +82,7 @@ func CollectJobs(taskCtx plugin.SubTaskContext) errors.Error { | |||
Query: func(reqData *api.RequestData) (url.Values, errors.Error) { | |||
query := url.Values{} | |||
if pageToken, ok := reqData.CustomData.(string); ok && pageToken != "" { | |||
query.Set("page_token", reqData.CustomData.(string)) | |||
query.Set("page-token", reqData.CustomData.(string)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think query.Set("page-token", pageToken)
is more concise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed. Additionally as pipelines, workflows & jobs all were using the same ApiCollectorArgs
functions I moved the 3 of them to shared.go
4407157
to
eb7d274
Compare
pr-type/bug-fix
,pr-type/feature-development
, etc.Summary
Fixes CircleCI plugin where pagination of the API responses was not occurring, resulting in incomplete data collection.
page-token
PageSize
ApiCollectorArg
to 20, the default page size. Previously this was defaulting to 0 meaning theGetNextPageCustomData
arg was being ignored due to this within theexec
function.Does this close any open issues?
Closes #7750
Screenshots
Before fix, max 20 rows (per project) present in
_raw_circleci_api_pipelines
(ie. 1 page of results):After fix, now 203 rows from across multiple pages:
Other Information