likyh commented on code in PR #4542:
URL:
https://github.com/apache/incubator-devlake/pull/4542#discussion_r1119797459
##########
backend/plugins/gitlab/tasks/job_collector.go:
##########
@@ -35,16 +49,72 @@ var CollectApiJobsMeta = plugin.SubTaskMeta{
func CollectApiJobs(taskCtx plugin.SubTaskContext) errors.Error {
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx,
RAW_JOB_TABLE)
-
- collector, err := helper.NewApiCollector(helper.ApiCollectorArgs{
+ db := taskCtx.GetDal()
+ collector, err :=
helper.NewStatefulApiCollectorForFinalizableEntity(helper.FinalizableApiCollectorArgs{
RawDataSubTaskArgs: *rawDataSubTaskArgs,
ApiClient: data.ApiClient,
- PageSize: 100,
- Incremental: false,
- UrlTemplate: "projects/{{ .Params.ProjectId }}/jobs",
- Query: GetQuery,
- ResponseParser: GetRawMessageUpdatedAtAfter(data.TimeAfter),
- AfterResponse: ignoreHTTPStatus403, // ignore 403 for
CI/CD disable
+ TimeAfter: data.TimeAfter, // set to nil to disable
timeFilter
+ CollectNewRecordsByList: helper.FinalizableApiCollectorListArgs{
+ PageSize: 100,
+ Concurrency: 10,
+ FinalizableApiCollectorCommonArgs:
helper.FinalizableApiCollectorCommonArgs{
+ UrlTemplate: "projects/{{ .Params.ProjectId
}}/jobs",
+ Query: func(reqData *helper.RequestData,
createdAfter *time.Time) (url.Values, errors.Error) {
+ query := url.Values{}
+ query.Set("with_stats", "true")
Review Comment:
there are no with_stats and sor query.
https://docs.gitlab.com/ee/api/jobs.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]