Hotfix/4631 (#4690)
* fix: decrease page size for github graphql job collector (#4682)
* fix: change pr collector detail input (#4687)
* fix: change pr collector detail input
* fix: for review
diff --git a/backend/plugins/github/tasks/pr_collector.go b/backend/plugins/github/tasks/pr_collector.go
index 4456a9d..d22a47d 100644
--- a/backend/plugins/github/tasks/pr_collector.go
+++ b/backend/plugins/github/tasks/pr_collector.go
@@ -44,7 +44,7 @@
}
type SimpleGithubPr struct {
- GithubId int64
+ Number int64
}
type SimpleGithubApiPr struct {
@@ -102,7 +102,7 @@
BuildInputIterator: func() (helper.Iterator, errors.Error) {
// select pull id from database
cursor, err := db.Cursor(
- dal.Select("github_id"),
+ dal.Select("number"),
dal.From(&models.GithubPullRequest{}),
dal.Where(
"repo_id = ? AND connection_id = ? AND state != 'closed'",
@@ -115,7 +115,7 @@
return helper.NewDalCursorIterator(db, cursor, reflect.TypeOf(SimpleGithubPr{}))
},
FinalizableApiCollectorCommonArgs: helper.FinalizableApiCollectorCommonArgs{
- UrlTemplate: "repos/{{ .Params.Name }}/pulls/{{ .Input.GithubId }}",
+ UrlTemplate: "repos/{{ .Params.Name }}/pulls/{{ .Input.Number }}",
ResponseParser: func(res *http.Response) ([]json.RawMessage, errors.Error) {
body, err := io.ReadAll(res.Body)
if err != nil {
diff --git a/backend/plugins/github_graphql/tasks/job_collector.go b/backend/plugins/github_graphql/tasks/job_collector.go
index 9374a55..8d3a1d2 100644
--- a/backend/plugins/github_graphql/tasks/job_collector.go
+++ b/backend/plugins/github_graphql/tasks/job_collector.go
@@ -140,7 +140,7 @@
err = collectorWithState.InitGraphQLCollector(helper.GraphqlCollectorArgs{
Input: iterator,
- InputStep: 60,
+ InputStep: 20,
Incremental: incremental,
GraphqlClient: data.GraphqlClient,
BuildQuery: func(reqData *helper.GraphqlRequestData) (interface{}, map[string]interface{}, error) {