klesh commented on code in PR #6094:
URL: 
https://github.com/apache/incubator-devlake/pull/6094#discussion_r1328734767


##########
backend/plugins/github/tasks/pr_commit_collector.go:
##########
@@ -73,20 +73,18 @@ func CollectApiPullRequestCommits(taskCtx 
plugin.SubTaskContext) errors.Error {
                return err
        }
 
-       incremental := collectorWithState.IsIncremental()
-
        clauses := []dal.Clause{
                dal.Select("number, github_id"),
                dal.From(models.GithubPullRequest{}.TableName()),
                dal.Where("repo_id = ? and connection_id=?", 
data.Options.GithubId, data.Options.ConnectionId),
        }
-       // incremental collection, no need to care about the timeFilter since 
it has to be collected by PR
-       if incremental {
+       if collectorWithState.IsIncreamtal && collectorWithState.Since != nil {

Review Comment:
   Same as above



##########
backend/plugins/github/tasks/pr_review_collector.go:
##########
@@ -65,18 +65,18 @@ func CollectApiPullRequestReviews(taskCtx 
plugin.SubTaskContext) errors.Error {
                return err
        }
 
-       incremental := collectorWithState.IsIncremental()
        clauses := []dal.Clause{
                dal.Select("number, github_id"),
                dal.From(models.GithubPullRequest{}.TableName()),
                dal.Where("repo_id = ? and connection_id=?", 
data.Options.GithubId, data.Options.ConnectionId),
        }
-       if incremental {
+       if collectorWithState.IsIncreamtal && collectorWithState.Since != nil {

Review Comment:
   same as above



##########
backend/plugins/github_graphql/tasks/job_collector.go:
##########
@@ -116,17 +116,16 @@ func CollectGraphqlJobs(taskCtx plugin.SubTaskContext) 
errors.Error {
                return err
        }
 
-       incremental := collectorWithState.IsIncremental()
-
        clauses := []dal.Clause{
                dal.Select("check_suite_node_id"),
                dal.From(models.GithubRun{}.TableName()),
                dal.Where("repo_id = ? and connection_id=?", 
data.Options.GithubId, data.Options.ConnectionId),
                dal.Orderby("github_updated_at DESC"),
        }
-       if incremental {
-               clauses = append(clauses, dal.Where("github_updated_at > ?", 
*collectorWithState.LatestState.LatestSuccessStart))
+       if collectorWithState.IsIncreamtal && collectorWithState.Since != nil {

Review Comment:
   same as above



##########
backend/plugins/jenkins/tasks/stage_collector.go:
##########
@@ -67,12 +67,9 @@ func CollectApiStages(taskCtx plugin.SubTaskContext) 
errors.Error {
                dal.Where(`tjb.connection_id = ? and tjb.job_path = ? and 
tjb.job_name = ? and tjb.class = ?`,
                        data.Options.ConnectionId, data.Options.JobPath, 
data.Options.JobName, "WorkflowRun"),
        }
-
-       incremental := collectorWithState.IsIncremental()
-       if incremental && collectorWithState.LatestState.LatestSuccessStart != 
nil {
-               clauses = append(clauses, dal.Where(`tjb.start_time >= ?`, 
collectorWithState.LatestState.LatestSuccessStart))
+       if collectorWithState.IsIncreamtal && collectorWithState.Since != nil {

Review Comment:
   same as above



-- 
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]

Reply via email to