You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "klesh (via GitHub)" <gi...@apache.org> on 2023/02/23 06:27:37 UTC

[GitHub] [incubator-devlake] klesh commented on a diff in pull request #4493: refactor(tapd): adopts timeAfter

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


##########
backend/plugins/tapd/tasks/story_bug_collector.go:
##########
@@ -47,8 +47,8 @@ func CollectStoryBugs(taskCtx plugin.SubTaskContext) errors.Error {
 		dal.From(&models.TapdStory{}),
 		dal.Where("_tool_tapd_stories.connection_id = ? and _tool_tapd_stories.workspace_id = ? ", data.Options.ConnectionId, data.Options.WorkspaceId),
 	}
-	if collectorWithState.CreatedDateAfter != nil {
-		clauses = append(clauses, dal.Where("created > ?", *collectorWithState.CreatedDateAfter))
+	if collectorWithState.TimeAfter != nil {

Review Comment:
   I don't think this is needed since the `Stories` has been filtered.
   



##########
backend/plugins/tapd/tasks/story_commit_collector.go:
##########
@@ -49,8 +49,8 @@ func CollectStoryCommits(taskCtx plugin.SubTaskContext) errors.Error {
 		dal.From(&models.TapdStory{}),
 		dal.Where("_tool_tapd_stories.connection_id = ? and _tool_tapd_stories.workspace_id = ? ", data.Options.ConnectionId, data.Options.WorkspaceId),
 	}
-	if collectorWithState.CreatedDateAfter != nil {
-		clauses = append(clauses, dal.Where("created > ?", *collectorWithState.CreatedDateAfter))
+	if collectorWithState.TimeAfter != nil {

Review Comment:
   Same as above



##########
backend/plugins/tapd/tasks/iteration_collector.go:
##########
@@ -52,10 +52,10 @@ func CollectIterations(taskCtx plugin.SubTaskContext) errors.Error {
 			query.Set("page", fmt.Sprintf("%v", reqData.Pager.Page))
 			query.Set("limit", fmt.Sprintf("%v", reqData.Pager.Size))
 			query.Set("order", "created asc")
-			if data.CreatedDateAfter != nil {
-				query.Set("created",
+			if data.TimeAfter != nil {
+				query.Set("modified",
 					fmt.Sprintf(">%s",
-						data.CreatedDateAfter.In(data.Options.CstZone).Format("2006-01-02")))
+						data.TimeAfter.In(data.Options.CstZone).Format("2006-01-02")))

Review Comment:
   Only `date`, no `time`? what an elegant API!!!



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