klesh commented on code in PR #2215:
URL: https://github.com/apache/incubator-devlake/pull/2215#discussion_r904678620
##########
plugins/github/tasks/milestone_converter.go:
##########
@@ -0,0 +1,98 @@
+package tasks
+
+import (
+ "github.com/apache/incubator-devlake/models/common"
+ "github.com/apache/incubator-devlake/models/domainlayer"
+ "github.com/apache/incubator-devlake/models/domainlayer/didgen"
+ "github.com/apache/incubator-devlake/models/domainlayer/ticket"
+ "github.com/apache/incubator-devlake/plugins/core"
+ githubModels "github.com/apache/incubator-devlake/plugins/github/models"
+ "github.com/apache/incubator-devlake/plugins/helper"
+ "reflect"
+)
+
+var ConvertMilestonesMeta = core.SubTaskMeta{
+ Name: "convertMilestones",
+ EntryPoint: ConvertMilestones,
+ EnabledByDefault: true,
+ Description: "Convert tool layer table github_milestones into
domain layer table milestones",
+}
+
+type MilestoneConverterModel struct {
+ common.RawDataOrigin
+ githubModels.GithubMilestone
+ GithubId int
+}
+
+func ConvertMilestones(taskCtx core.SubTaskContext) error {
+ //db := taskCtx.GetDb()
+ data := taskCtx.GetData().(*GithubTaskData)
+ repoId := data.Repo.GithubId
+ connectionId := data.Repo.ConnectionId
+ rows, err := taskCtx.GetDal().Raw(`
Review Comment:
Any particular reason to use `Raw` instead of `Cursor` like other converter?
And I think should convert only those belonging to the current repo
--
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]