You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2023/09/12 10:46:59 UTC

[incubator-devlake] branch feat#5841-4 updated: fix: cobra command timeAfter and some ci issues

This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch feat#5841-4
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/feat#5841-4 by this push:
     new 5326b8a7c fix: cobra command timeAfter and some ci issues
5326b8a7c is described below

commit 5326b8a7c0ed7ce99c8ddb9f3d83f20b4ce09ff2
Author: abeizn <zi...@merico.dev>
AuthorDate: Tue Sep 12 18:46:48 2023 +0800

    fix: cobra command timeAfter and some ci issues
---
 backend/core/runner/directrun.go                        | 15 +++++++++++++--
 backend/plugins/bamboo/bamboo.go                        |  3 ++-
 backend/plugins/bitbucket/bitbucket.go                  |  3 ++-
 backend/plugins/circleci/circleci.go                    |  3 ++-
 backend/plugins/customize/customize.go                  |  4 +++-
 backend/plugins/dbt/dbt.go                              |  3 ++-
 backend/plugins/dora/dora.go                            |  3 ++-
 backend/plugins/feishu/feishu.go                        |  4 +++-
 backend/plugins/gitee/gitee.go                          |  3 ++-
 backend/plugins/github/github.go                        |  3 ++-
 backend/plugins/github_graphql/plugin_main.go           |  3 ++-
 backend/plugins/gitlab/gitlab.go                        |  3 ++-
 backend/plugins/icla/plugin_main.go                     |  3 ++-
 backend/plugins/jenkins/jenkins.go                      |  3 ++-
 backend/plugins/jira/jira.go                            |  3 ++-
 backend/plugins/pagerduty/pager_duty.go                 |  3 ++-
 backend/plugins/refdiff/refdiff.go                      |  3 ++-
 backend/plugins/slack/slack.go                          |  3 ++-
 backend/plugins/sonarqube/sonarqube.go                  |  3 ++-
 backend/plugins/starrocks/starrocks.go                  |  3 ++-
 backend/plugins/tapd/tapd.go                            |  5 ++---
 backend/plugins/teambition/teambition.go                |  3 ++-
 backend/plugins/trello/trello.go                        |  3 ++-
 backend/plugins/zentao/zentao.go                        |  3 ++-
 backend/server/services/blueprint.go                    |  1 -
 backend/server/services/blueprint_makeplan_v200_test.go |  3 +--
 backend/server/services/remote/run/run.go               |  2 +-
 27 files changed, 63 insertions(+), 31 deletions(-)

diff --git a/backend/core/runner/directrun.go b/backend/core/runner/directrun.go
index 7578d8f39..8d596651d 100644
--- a/backend/core/runner/directrun.go
+++ b/backend/core/runner/directrun.go
@@ -26,6 +26,7 @@ import (
 	"os/signal"
 	"runtime"
 	"syscall"
+	"time"
 
 	"github.com/apache/incubator-devlake/core/models"
 	"github.com/apache/incubator-devlake/core/models/migrationscripts"
@@ -47,7 +48,7 @@ func RunCmd(cmd *cobra.Command) {
 // args: command line arguments
 // pluginTask: specific built-in plugin, for example: feishu, jira...
 // options: plugin config
-func DirectRun(cmd *cobra.Command, args []string, pluginTask plugin.PluginTask, options map[string]interface{}) {
+func DirectRun(cmd *cobra.Command, args []string, pluginTask plugin.PluginTask, options map[string]interface{}, timeAfter string) {
 	basicRes := CreateAppBasicRes()
 	tasks, err := cmd.Flags().GetStringSlice("subtasks")
 	if err != nil {
@@ -84,13 +85,23 @@ func DirectRun(cmd *cobra.Command, args []string, pluginTask plugin.PluginTask,
 		Options:  options,
 		Subtasks: tasks,
 	}
+	parsedTimeAfter := time.Time{}
+	syncPolicy := models.SyncPolicy{}
+	if timeAfter != "" {
+		parsedTimeAfter, err = time.Parse(time.RFC3339, timeAfter)
+		if err != nil {
+			panic(err)
+		}
+		syncPolicy.TimeAfter = &parsedTimeAfter
+	}
+
 	err = RunPluginSubTasks(
 		ctx,
 		basicRes,
 		task,
 		pluginTask,
 		nil,
-		nil,
+		&syncPolicy,
 	)
 	if err != nil {
 		panic(err)
diff --git a/backend/plugins/bamboo/bamboo.go b/backend/plugins/bamboo/bamboo.go
index c89d0bc63..effef5a65 100644
--- a/backend/plugins/bamboo/bamboo.go
+++ b/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")
 	deploymentPattern := bambooCmd.Flags().StringP("deployment", "", "", "deployment pattern")
 	productionPattern := bambooCmd.Flags().StringP("production", "", "", "production pattern")
 	_ = bambooCmd.MarkFlagRequired("project-key")
@@ -42,7 +43,7 @@ func main() {
 				"deploymentPattern": *deploymentPattern,
 				"productionPattern": *productionPattern,
 			},
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(bambooCmd)
 }
diff --git a/backend/plugins/bitbucket/bitbucket.go b/backend/plugins/bitbucket/bitbucket.go
index 6c73f06cf..c578cd3d1 100644
--- a/backend/plugins/bitbucket/bitbucket.go
+++ b/backend/plugins/bitbucket/bitbucket.go
@@ -31,6 +31,7 @@ func main() {
 	cmd := &cobra.Command{Use: "bitbucket"}
 	connectionId := cmd.Flags().Uint64P("connectionId", "c", 0, "bitbucket connection id")
 	fullName := cmd.Flags().StringP("fullName", "n", "", "bitbucket id: owner/repo")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	deploymentPattern := cmd.Flags().StringP("deployment", "", "", "deployment pattern")
 	productionPattern := cmd.Flags().StringP("production", "", "", "production pattern")
 	_ = cmd.MarkFlagRequired("connectionId")
@@ -44,7 +45,7 @@ func main() {
 				"deploymentPattern": *deploymentPattern,
 				"productionPattern": *productionPattern,
 			},
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/circleci/circleci.go b/backend/plugins/circleci/circleci.go
index 7466bd490..cf63d5a30 100644
--- a/backend/plugins/circleci/circleci.go
+++ b/backend/plugins/circleci/circleci.go
@@ -31,12 +31,13 @@ func main() {
 	cmd := &cobra.Command{Use: "CircleCi"}
 	connectionId := cmd.Flags().Uint64P("connection", "c", 0, "CircleCi connection id")
 	projectSlug := cmd.Flags().StringP("project", "p", "", "CircleCi project slug")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 
 	cmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"connectionId": *connectionId,
 			"projectSlug":  *projectSlug,
-		})
+		}, *timeAfter)
 	}
 
 	runner.RunCmd(cmd)
diff --git a/backend/plugins/customize/customize.go b/backend/plugins/customize/customize.go
index 1211b39e3..e4771424b 100644
--- a/backend/plugins/customize/customize.go
+++ b/backend/plugins/customize/customize.go
@@ -29,6 +29,8 @@ var PluginEntry impl.Customize //nolint
 // standalone mode for debugging
 func main() {
 	cmd := &cobra.Command{Use: "customize"}
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
+
 	cmd.Run = func(c *cobra.Command, args []string) {
 		runner.DirectRun(c, args, PluginEntry, map[string]interface{}{"transformationRules": []tasks.MappingRules{{
 			Table:         "issues",
@@ -36,7 +38,7 @@ func main() {
 			RawDataParams: "{\"ConnectionId\":1,\"BoardId\":8}",
 			Mapping:       map[string]string{"x_test": "fields.timespent"},
 		}},
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/dbt/dbt.go b/backend/plugins/dbt/dbt.go
index 7cc225245..5c875a528 100644
--- a/backend/plugins/dbt/dbt.go
+++ b/backend/plugins/dbt/dbt.go
@@ -51,6 +51,7 @@ func main() {
 	projectVars["event_min_id"] = "7581"
 	projectVars["event_max_id"] = "7582"
 	dbtCmd.Flags().StringToStringVarP(&projectVars, "projectVars", "v", projectVars, "dbt provides variables to provide data to models for compilation.")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 
 	dbtCmd.Run = func(cmd *cobra.Command, args []string) {
 		projectVarsConvert := make(map[string]interface{}, len(projectVars))
@@ -76,7 +77,7 @@ func main() {
 			"defer":          *deferFlag,
 			"noDefer":        *noDefer,
 			"fullRefresh":    *fullRefresh,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(dbtCmd)
 }
diff --git a/backend/plugins/dora/dora.go b/backend/plugins/dora/dora.go
index a4ee412d3..a0b9a198a 100644
--- a/backend/plugins/dora/dora.go
+++ b/backend/plugins/dora/dora.go
@@ -31,11 +31,12 @@ func main() {
 	cmd := &cobra.Command{Use: "dora"}
 
 	projectName := cmd.Flags().StringP("projectName", "p", "", "project name")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 
 	cmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"projectName": *projectName,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/feishu/feishu.go b/backend/plugins/feishu/feishu.go
index c5c055c94..f203735aa 100644
--- a/backend/plugins/feishu/feishu.go
+++ b/backend/plugins/feishu/feishu.go
@@ -30,13 +30,15 @@ func main() {
 	cmd := &cobra.Command{Use: "feishu"}
 	connectionId := cmd.Flags().Uint64P("connectionId", "c", 0, "feishu connection id")
 	numOfDaysToCollect := cmd.Flags().IntP("numOfDaysToCollect", "n", 8, "feishu collect days")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
+
 	_ = cmd.MarkFlagRequired("connectionId")
 	_ = cmd.MarkFlagRequired("numOfDaysToCollect")
 	cmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"connectionId":       *connectionId,
 			"numOfDaysToCollect": *numOfDaysToCollect,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/gitee/gitee.go b/backend/plugins/gitee/gitee.go
index 9fbc67207..060734002 100644
--- a/backend/plugins/gitee/gitee.go
+++ b/backend/plugins/gitee/gitee.go
@@ -30,6 +30,7 @@ func main() {
 	connectionId := cmd.Flags().Uint64P("connectionId", "c", 0, "gitee connection id")
 	owner := cmd.Flags().StringP("owner", "o", "", "gitee owner")
 	repo := cmd.Flags().StringP("repo", "r", "", "gitee repo")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	_ = cmd.MarkFlagRequired("connectionId")
 	_ = cmd.MarkFlagRequired("owner")
 	_ = cmd.MarkFlagRequired("repo")
@@ -58,7 +59,7 @@ func main() {
 			"issueTypeBug":         *issueTypeBug,
 			"issueTypeIncident":    *issueTypeIncident,
 			"issueTypeRequirement": *issueTypeRequirement,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/github/github.go b/backend/plugins/github/github.go
index de811aadf..70d2c7830 100644
--- a/backend/plugins/github/github.go
+++ b/backend/plugins/github/github.go
@@ -32,6 +32,7 @@ func main() {
 	connectionId := cmd.Flags().Uint64P("connectionId", "c", 0, "github connection id")
 	owner := cmd.Flags().StringP("owner", "o", "", "github owner")
 	repo := cmd.Flags().StringP("repo", "r", "", "github repo")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	_ = cmd.MarkFlagRequired("connectionId")
 	_ = cmd.MarkFlagRequired("owner")
 	_ = cmd.MarkFlagRequired("repo")
@@ -66,7 +67,7 @@ func main() {
 				"deploymentPattern":    *deploymentPattern,
 				"productionPattern":    *productionPattern,
 			},
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/github_graphql/plugin_main.go b/backend/plugins/github_graphql/plugin_main.go
index 3f1777979..af79257b0 100644
--- a/backend/plugins/github_graphql/plugin_main.go
+++ b/backend/plugins/github_graphql/plugin_main.go
@@ -32,6 +32,7 @@ func main() {
 	connectionId := cmd.Flags().Uint64P("connectionId", "c", 0, "github connection id")
 	owner := cmd.Flags().StringP("owner", "o", "", "github owner")
 	repo := cmd.Flags().StringP("repo", "r", "", "github repo")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	_ = cmd.MarkFlagRequired("connectionId")
 	_ = cmd.MarkFlagRequired("owner")
 	_ = cmd.MarkFlagRequired("repo")
@@ -41,7 +42,7 @@ func main() {
 			"connectionId": *connectionId,
 			"owner":        *owner,
 			"repo":         *repo,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/gitlab/gitlab.go b/backend/plugins/gitlab/gitlab.go
index 86f3bac9d..9c65a96c5 100644
--- a/backend/plugins/gitlab/gitlab.go
+++ b/backend/plugins/gitlab/gitlab.go
@@ -31,6 +31,7 @@ func main() {
 	cmd := &cobra.Command{Use: "gitlab"}
 	projectId := cmd.Flags().IntP("project-id", "p", 0, "gitlab project id")
 	connectionId := cmd.Flags().Uint64P("connection-id", "c", 0, "gitlab connection id")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	_ = cmd.MarkFlagRequired("project-id")
 	_ = cmd.MarkFlagRequired("connection-id")
 
@@ -62,7 +63,7 @@ func main() {
 				"deploymentPattern":    *deploymentPattern,
 				"productionPattern":    *productionPattern,
 			},
-		})
+		}, *timeAfter)
 	}
 
 	runner.RunCmd(cmd)
diff --git a/backend/plugins/icla/plugin_main.go b/backend/plugins/icla/plugin_main.go
index b7183ed76..3af83c70a 100644
--- a/backend/plugins/icla/plugin_main.go
+++ b/backend/plugins/icla/plugin_main.go
@@ -29,8 +29,9 @@ var PluginEntry impl.Icla //nolint
 // standalone mode for debugging
 func main() {
 	cmd := &cobra.Command{Use: "icla"}
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	cmd.Run = func(cmd *cobra.Command, args []string) {
-		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{})
+		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/jenkins/jenkins.go b/backend/plugins/jenkins/jenkins.go
index 7b0c59523..fff9039b9 100644
--- a/backend/plugins/jenkins/jenkins.go
+++ b/backend/plugins/jenkins/jenkins.go
@@ -30,13 +30,14 @@ func main() {
 	connectionId := jenkinsCmd.Flags().Uint64P("connection", "c", 1, "jenkins connection id")
 	jobFullName := jenkinsCmd.Flags().StringP("jobFullName", "j", "", "jenkins job full name")
 	deployTagPattern := jenkinsCmd.Flags().String("deployTagPattern", "(?i)deploy", "deploy tag name")
+	timeAfter := jenkinsCmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 
 	jenkinsCmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"connectionId":     *connectionId,
 			"jobFullName":      *jobFullName,
 			"deployTagPattern": *deployTagPattern,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(jenkinsCmd)
 }
diff --git a/backend/plugins/jira/jira.go b/backend/plugins/jira/jira.go
index fdb2dfa61..f22cc9179 100644
--- a/backend/plugins/jira/jira.go
+++ b/backend/plugins/jira/jira.go
@@ -30,6 +30,7 @@ func main() {
 	cmd := &cobra.Command{Use: "jira"}
 	connectionId := cmd.Flags().Uint64P("connection", "c", 0, "jira connection id")
 	boardId := cmd.Flags().Uint64P("board", "b", 0, "jira board id")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	_ = cmd.MarkFlagRequired("connection")
 	_ = cmd.MarkFlagRequired("board")
 
@@ -37,7 +38,7 @@ func main() {
 		runner.DirectRun(c, args, PluginEntry, map[string]interface{}{
 			"connectionId": *connectionId,
 			"boardId":      *boardId,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/pagerduty/pager_duty.go b/backend/plugins/pagerduty/pager_duty.go
index 57c0f9dd8..34145fbd2 100644
--- a/backend/plugins/pagerduty/pager_duty.go
+++ b/backend/plugins/pagerduty/pager_duty.go
@@ -29,6 +29,7 @@ var PluginEntry impl.PagerDuty //nolint
 // standalone mode for debugging
 func main() {
 	cmd := &cobra.Command{Use: "pagerduty"}
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 
 	// TODO add your cmd flag if necessary
 	// yourFlag := cmd.Flags().IntP("yourFlag", "y", 8, "TODO add description here")
@@ -37,7 +38,7 @@ func main() {
 	cmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			// TODO add more custom params here
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/refdiff/refdiff.go b/backend/plugins/refdiff/refdiff.go
index 2c246f19b..5891e8aae 100644
--- a/backend/plugins/refdiff/refdiff.go
+++ b/backend/plugins/refdiff/refdiff.go
@@ -38,6 +38,7 @@ func main() {
 	tagsOrder := refdiffCmd.Flags().StringP("tags-order", "d", "", "tags order")
 
 	projectName := refdiffCmd.Flags().StringP("project-name", "P", "", "project name")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 
 	// _ = refdiffCmd.MarkFlagRequired("repo-id")
 	//_ = refdiffCmd.MarkFlagRequired("new-ref")
@@ -59,7 +60,7 @@ func main() {
 			"tagsLimit":   *tagsLimit,
 			"tagsOrder":   *tagsOrder,
 			"projectName": *projectName,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(refdiffCmd)
 }
diff --git a/backend/plugins/slack/slack.go b/backend/plugins/slack/slack.go
index 01355bb29..19734bf96 100644
--- a/backend/plugins/slack/slack.go
+++ b/backend/plugins/slack/slack.go
@@ -29,11 +29,12 @@ var PluginEntry impl.Slack
 func main() {
 	cmd := &cobra.Command{Use: "slack"}
 	connectionId := cmd.Flags().Uint64P("connectionId", "c", 0, "slack connection id")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	_ = cmd.MarkFlagRequired("connectionId")
 	cmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"connectionId": *connectionId,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/sonarqube/sonarqube.go b/backend/plugins/sonarqube/sonarqube.go
index 64b9363f3..739ca2a76 100644
--- a/backend/plugins/sonarqube/sonarqube.go
+++ b/backend/plugins/sonarqube/sonarqube.go
@@ -30,6 +30,7 @@ func main() {
 	cmd := &cobra.Command{Use: "sonarqube"}
 	connectionId := cmd.Flags().Uint64P("connectionId", "c", 0, "sonarqube connection id")
 	projectKey := cmd.Flags().StringP("projectKey", "p", "", "sonarqube projectKey")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	_ = cmd.MarkFlagRequired("connectionId")
 	//_ = cmd.MarkFlagRequired("projectKey")
 
@@ -37,7 +38,7 @@ func main() {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"connectionId": *connectionId,
 			"projectKey":   *projectKey,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/starrocks/starrocks.go b/backend/plugins/starrocks/starrocks.go
index a6c10dd55..2912bddff 100644
--- a/backend/plugins/starrocks/starrocks.go
+++ b/backend/plugins/starrocks/starrocks.go
@@ -50,6 +50,7 @@ func main() {
 	_ = cmd.MarkFlagRequired("batch_size")
 	extra := cmd.Flags().StringP("extra", "e", "", "StarRocks create table sql extra")
 	orderBy := cmd.Flags().StringP("order_by", "o", "", "Source tables order by, default is primary key")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	cmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"source_type":   sourceType,
@@ -66,7 +67,7 @@ func main() {
 			"batch_size":    batchSize,
 			"extra":         extra,
 			"order_by":      orderBy,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/tapd/tapd.go b/backend/plugins/tapd/tapd.go
index 4d61d67ef..c7d88316c 100644
--- a/backend/plugins/tapd/tapd.go
+++ b/backend/plugins/tapd/tapd.go
@@ -32,7 +32,7 @@ func main() {
 	workspaceId := cmd.Flags().Uint64P("workspace", "w", 0, "tapd workspace id")
 	companyId := cmd.Flags().Uint64P("company", "o", 0, "tapd company id")
 	pageSize := cmd.Flags().Uint64P("pageSize", "p", 0, "tapd page size")
-	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-05-06T07:08:09Z")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	err := cmd.MarkFlagRequired("connection")
 	if err != nil {
 		panic(err)
@@ -47,9 +47,8 @@ func main() {
 			"connectionId": *connectionId,
 			"workspaceId":  *workspaceId,
 			"companyId":    *companyId,
-			"timeAfter":    *timeAfter,
 			"pageSize":     *pageSize,
-		})
+		}, *timeAfter)
 		//
 		// cfg := config.GetConfig()
 		// log := logger.Global.Nested(cmd.Use)
diff --git a/backend/plugins/teambition/teambition.go b/backend/plugins/teambition/teambition.go
index fde97b831..86b4b26c6 100644
--- a/backend/plugins/teambition/teambition.go
+++ b/backend/plugins/teambition/teambition.go
@@ -31,12 +31,13 @@ func main() {
 	cmd := &cobra.Command{Use: "teambition"}
 	connectionId := cmd.Flags().Uint64P("connection", "c", 0, "teambition connection id")
 	projectId := cmd.Flags().StringP("project", "p", "", "teambition project id")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 
 	cmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"connectionId": *connectionId,
 			"projectId":    *projectId,
-		})
+		}, *timeAfter)
 	}
 
 	runner.RunCmd(cmd)
diff --git a/backend/plugins/trello/trello.go b/backend/plugins/trello/trello.go
index f2510de1c..d82067006 100644
--- a/backend/plugins/trello/trello.go
+++ b/backend/plugins/trello/trello.go
@@ -30,13 +30,14 @@ func main() {
 	cmd := &cobra.Command{Use: "trello"}
 	connectionId := cmd.Flags().Uint64P("connection", "c", 0, "trello connection id")
 	boardId := cmd.Flags().StringP("board", "b", "", "trello board id")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 	_ = cmd.MarkFlagRequired("connection")
 	_ = cmd.MarkFlagRequired("board")
 	cmd.Run = func(c *cobra.Command, args []string) {
 		runner.DirectRun(c, args, PluginEntry, map[string]interface{}{
 			"connectionId": *connectionId,
 			"boardId":      *boardId,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/plugins/zentao/zentao.go b/backend/plugins/zentao/zentao.go
index fcbbeaa55..fb1713c82 100644
--- a/backend/plugins/zentao/zentao.go
+++ b/backend/plugins/zentao/zentao.go
@@ -33,13 +33,14 @@ func main() {
 	connectionId := cmd.Flags().Uint64P("connectionId", "c", 0, "zentao connection id")
 	productId := cmd.Flags().IntP("productId", "o", 8, "product id")
 	projectId := cmd.Flags().IntP("projectId", "p", 8, "project id")
+	timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
 
 	cmd.Run = func(cmd *cobra.Command, args []string) {
 		runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
 			"connectionId": *connectionId,
 			"productId":    *productId,
 			"projectId":    *projectId,
-		})
+		}, *timeAfter)
 	}
 	runner.RunCmd(cmd)
 }
diff --git a/backend/server/services/blueprint.go b/backend/server/services/blueprint.go
index 3d7e67c2e..8971fd75c 100644
--- a/backend/server/services/blueprint.go
+++ b/backend/server/services/blueprint.go
@@ -267,7 +267,6 @@ func ReloadBlueprints(c *cron.Cron) errors.Error {
 }
 
 func createPipelineByBlueprint(blueprint *models.Blueprint, syncPolicy *models.SyncPolicy) (*models.Pipeline, errors.Error) {
-
 	var plan models.PipelinePlan
 	var err errors.Error
 	if blueprint.Mode == models.BLUEPRINT_MODE_NORMAL {
diff --git a/backend/server/services/blueprint_makeplan_v200_test.go b/backend/server/services/blueprint_makeplan_v200_test.go
index 646996d4d..22b53b532 100644
--- a/backend/server/services/blueprint_makeplan_v200_test.go
+++ b/backend/server/services/blueprint_makeplan_v200_test.go
@@ -36,7 +36,6 @@ func TestMakePlanV200(t *testing.T) {
 	githubName := "TestMakePlanV200-github" // mimic github
 	// mock github plugin as a data source plugin
 	githubConnId := uint64(1)
-	syncPolicy := &coreModels.SyncPolicy{}
 	githubScopes := []*coreModels.BlueprintScope{
 		{ScopeId: "github:GithubRepo:1:123"},
 		{ScopeId: "github:GithubRepo:1:321"},
@@ -56,7 +55,7 @@ func TestMakePlanV200(t *testing.T) {
 		&ticket.Board{DomainEntity: domainlayer.DomainEntity{Id: "github:GithubRepo:1:123"}, Name: "apache/incubator-devlake"},
 	}
 	github := new(mockplugin.CompositeDataSourcePluginBlueprintV200)
-	github.On("MakeDataSourcePipelinePlanV200", githubConnId, githubScopes, syncPolicy).Return(githubOutputPlan, githubOutputScopes, nil)
+	github.On("MakeDataSourcePipelinePlanV200", githubConnId, githubScopes).Return(githubOutputPlan, githubOutputScopes, nil)
 
 	// mock dora plugin as a metric plugin
 	doraName := "TestMakePlanV200-dora"
diff --git a/backend/server/services/remote/run/run.go b/backend/server/services/remote/run/run.go
index 81c656bc1..d9b2c63eb 100644
--- a/backend/server/services/remote/run/run.go
+++ b/backend/server/services/remote/run/run.go
@@ -59,7 +59,7 @@ func main() {
 		}
 
 		options["connectionId"] = *connectionId
-		runner.DirectRun(cmd, args, plugin, options)
+		runner.DirectRun(cmd, args, plugin, options, "")
 	}
 	runner.RunCmd(cmd)
 }