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

[GitHub] [incubator-devlake] likyh commented on a diff in pull request #4408: feat: jira supports timefilter by updated_date

likyh commented on code in PR #4408:
URL: https://github.com/apache/incubator-devlake/pull/4408#discussion_r1104470725


##########
plugins/jira/tasks/issue_collector.go:
##########
@@ -58,24 +58,23 @@ func CollectIssues(taskCtx core.SubTaskContext) errors.Error {
 			Table store raw data
 		*/
 		Table: RAW_ISSUE_TABLE,
-	}, data.CreatedDateAfter)
+	}, data.CreatedDateAfter, data.UpdatedDateAfter)
 	if err != nil {
 		return err
 	}
 
 	// build jql
 	// IMPORTANT: we have to keep paginated data in a consistence order to avoid data-missing, if we sort issues by
 	//  `updated`, issue will be jumping between pages if it got updated during the collection process
-	createdDateAfter := data.CreatedDateAfter
 	jql := "created is not null ORDER BY created ASC"
-	if createdDateAfter != nil {
-		// prepend a time range criteria if `since` was specified, either by user or from database
-		jql = fmt.Sprintf("created >= '%v' AND %v", createdDateAfter.Format("2006/01/02 15:04"), jql)
-	}
 
 	incremental := collectorWithState.IsIncremental()
 	if incremental {
 		jql = fmt.Sprintf("updated >= '%v' AND %v", collectorWithState.LatestState.LatestSuccessStart.Format("2006/01/02 15:04"), jql)
+	} else if data.UpdatedDateAfter != nil {
+		jql = fmt.Sprintf("updated >= '%v' AND %v", data.UpdatedDateAfter.Format("2006/01/02 15:04"), jql)
+	} else if data.CreatedDateAfter != nil {
+		jql = fmt.Sprintf("created >= '%v' AND %v", data.CreatedDateAfter.Format("2006/01/02 15:04"), jql)

Review Comment:
   The logic changed when `CreatedDateAfter != nil`. It will collect `issue.created< CreatedDateAfter && issue.updated> LatestSuccessStart` now but it won't before.



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