You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/12/11 15:11:07 UTC
[GitHub] [incubator-devlake] likyh opened a new pull request, #3904: feat: add time filter for gitlab
likyh opened a new pull request, #3904:
URL: https://github.com/apache/incubator-devlake/pull/3904
### Summary
add options CreatedDateAfter for gitlab
1. update issue/pipeline's incremental collector
2. add incremental for mr's incremental collector
3. let issue/mr/mr_commit/mr_note/ only request data created after CreatedDateAfter
### Does this close any open issues?
Similar like https://github.com/apache/incubator-devlake/issues/3688
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] klesh commented on a diff in pull request #3904: feat: add time filter for gitlab
Posted by GitBox <gi...@apache.org>.
klesh commented on code in PR #3904:
URL: https://github.com/apache/incubator-devlake/pull/3904#discussion_r1045515259
##########
plugins/gitlab/tasks/mr_note_collector.go:
##########
@@ -35,27 +35,30 @@ var CollectApiMrNotesMeta = core.SubTaskMeta{
func CollectApiMergeRequestsNotes(taskCtx core.SubTaskContext) errors.Error {
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_MERGE_REQUEST_NOTES_TABLE)
+ collectorWithState, err := helper.NewApiCollectorWithState(*rawDataSubTaskArgs, data.CreatedDateAfter)
+ if err != nil {
+ return err
+ }
- iterator, err := GetMergeRequestsIterator(taskCtx)
+ iterator, err := GetMergeRequestsIterator(taskCtx, collectorWithState)
if err != nil {
return err
}
defer iterator.Close()
- collector, err := helper.NewApiCollector(helper.ApiCollectorArgs{
- RawDataSubTaskArgs: *rawDataSubTaskArgs,
- ApiClient: data.ApiClient,
- PageSize: 100,
- Incremental: false,
- Input: iterator,
- UrlTemplate: "projects/{{ .Params.ProjectId }}/merge_requests/{{ .Input.Iid }}/notes?system=false",
- Query: GetQuery,
- GetTotalPages: GetTotalPagesFromResponse,
- ResponseParser: GetRawMessageFromResponse,
+ err = collectorWithState.InitCollector(helper.ApiCollectorArgs{
Review Comment:
Same as above
##########
plugins/gitlab/tasks/mr_commit_collector.go:
##########
@@ -35,26 +35,29 @@ var CollectApiMrCommitsMeta = core.SubTaskMeta{
func CollectApiMergeRequestsCommits(taskCtx core.SubTaskContext) errors.Error {
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_MERGE_REQUEST_COMMITS_TABLE)
+ collectorWithState, err := helper.NewApiCollectorWithState(*rawDataSubTaskArgs, data.CreatedDateAfter)
+ if err != nil {
+ return err
+ }
- iterator, err := GetMergeRequestsIterator(taskCtx)
+ iterator, err := GetMergeRequestsIterator(taskCtx, collectorWithState)
if err != nil {
return err
}
- collector, err := helper.NewApiCollector(helper.ApiCollectorArgs{
- RawDataSubTaskArgs: *rawDataSubTaskArgs,
- ApiClient: data.ApiClient,
- PageSize: 100,
- Incremental: false,
- Input: iterator,
- UrlTemplate: "projects/{{ .Params.ProjectId }}/merge_requests/{{ .Input.Iid }}/commits",
- Query: GetQuery,
- GetTotalPages: GetTotalPagesFromResponse,
- ResponseParser: GetRawMessageFromResponse,
+ err = collectorWithState.InitCollector(helper.ApiCollectorArgs{
Review Comment:
Why `collectorWithState.CreatedDateAfter` is not used?
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] likyh commented on a diff in pull request #3904: feat: add time filter for gitlab
Posted by GitBox <gi...@apache.org>.
likyh commented on code in PR #3904:
URL: https://github.com/apache/incubator-devlake/pull/3904#discussion_r1045522034
##########
plugins/gitlab/tasks/mr_commit_collector.go:
##########
@@ -35,26 +35,29 @@ var CollectApiMrCommitsMeta = core.SubTaskMeta{
func CollectApiMergeRequestsCommits(taskCtx core.SubTaskContext) errors.Error {
rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_MERGE_REQUEST_COMMITS_TABLE)
+ collectorWithState, err := helper.NewApiCollectorWithState(*rawDataSubTaskArgs, data.CreatedDateAfter)
+ if err != nil {
+ return err
+ }
- iterator, err := GetMergeRequestsIterator(taskCtx)
+ iterator, err := GetMergeRequestsIterator(taskCtx, collectorWithState)
if err != nil {
return err
}
- collector, err := helper.NewApiCollector(helper.ApiCollectorArgs{
- RawDataSubTaskArgs: *rawDataSubTaskArgs,
- ApiClient: data.ApiClient,
- PageSize: 100,
- Incremental: false,
- Input: iterator,
- UrlTemplate: "projects/{{ .Params.ProjectId }}/merge_requests/{{ .Input.Iid }}/commits",
- Query: GetQuery,
- GetTotalPages: GetTotalPagesFromResponse,
- ResponseParser: GetRawMessageFromResponse,
+ err = collectorWithState.InitCollector(helper.ApiCollectorArgs{
Review Comment:
it is used in `GetMergeRequestsIterator`
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-devlake] klesh merged pull request #3904: feat: add time filter for gitlab
Posted by GitBox <gi...@apache.org>.
klesh merged PR #3904:
URL: https://github.com/apache/incubator-devlake/pull/3904
--
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: commits-unsubscribe@devlake.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org