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


##########
backend/core/runner/run_task.go:
##########
@@ -54,8 +54,16 @@ func RunTask(
                return err
        }
        syncPolicy := &models.SyncPolicy{}
-       syncPolicy.SkipOnFail = dbPipeline.SkipOnFail
-       syncPolicy.FullSync = dbPipeline.FullSync
+       blueprint := &models.Blueprint{}

Review Comment:
   This doesn't seem right, Why do we need to access the bp when running a 
Task? Shouldn't we access the `dbPipeline.SyncPolicy` instead?



##########
backend/plugins/bamboo/bamboo.go:
##########
@@ -31,6 +31,7 @@ func main() {
        bambooCmd := &cobra.Command{Use: "bamboo"}
        connectionId := bambooCmd.Flags().Uint64P("Connection-id", "c", 0, 
"bamboo connection id")
        projectKey := bambooCmd.Flags().StringP("project-key", "p", "", "bamboo 
project key")
+       timeAfter := bambooCmd.Flags().StringP("timeAfter", "a", "", "collect 
data that are created after specified time, ie 2006-01-02T15:04:05Z")

Review Comment:
   Same as the above



##########
backend/plugins/ae/ae.go:
##########
@@ -30,12 +30,13 @@ func main() {
        aeCmd := &cobra.Command{Use: "ae"}
        connectionId := aeCmd.Flags().Uint64P("Connection-id", "c", 0, "ae 
connection id")
        projectId := aeCmd.Flags().IntP("project-id", "p", 0, "ae project id")
+       timeAfter := aeCmd.Flags().StringP("timeAfter", "a", "", "collect data 
that are created after specified time, ie 2006-01-02T15:04:05Z")

Review Comment:
   Should be `time-after` instead of `timeAfter` because the previous line is 
using `project-id`



##########
backend/plugins/bitbucket/tasks/api_common.go:
##########
@@ -100,11 +101,12 @@ func GetQueryCreatedAndUpdated(fields string, 
collectorWithState *api.ApiCollect
                }
                query.Set("fields", fields)
                query.Set("sort", "created_on")
+               syncPolicy := collectorWithState.Ctx.TaskContext().SyncPolicy()
                if collectorWithState.IsIncremental() {
                        latestSuccessStart := 
collectorWithState.LatestState.LatestSuccessStart.Format(time.RFC3339)
                        query.Set("q", fmt.Sprintf("updated_on>=%s", 
latestSuccessStart))
-               } else if collectorWithState.TimeAfter != nil {
-                       timeAfter := 
collectorWithState.TimeAfter.Format(time.RFC3339)
+               } else if syncPolicy != nil && syncPolicy.TimeAfter != nil {

Review Comment:
   Doesn't seem correct.
   `collectorWithState.TimeAfter` may be later than `syncPolicy.TimeAfter` 
because of `incremental sync`, the `collectorWithState.TimeAfter` would be 
updated automatically after each data collection while `syncPolicy.TimeAfter` 
can only be updated by the user



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