This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 8f654df2d fix: go lint and import errors (#8300)
8f654df2d is described below
commit 8f654df2d5edb71f32ee5427854bf2b598d9d2cb
Author: Chaojie Yan <[email protected]>
AuthorDate: Fri Feb 21 23:45:12 2025 +0800
fix: go lint and import errors (#8300)
* fix: import errors
* fix: go fmt issues
* fix: missing quote
* fix: skip float accuracy issues
---
.../plugins/zentao/e2e/raw_tables/_raw_zentao_api_task_worklogs.csv | 4 ++--
.../plugins/zentao/e2e/snapshot_tables/_tool_zentao_worklogs.csv | 4 ++--
backend/plugins/zentao/e2e/snapshot_tables/issue_worklogs.csv | 4 ++--
backend/plugins/zentao/e2e/task_worklogs_test.go | 6 +++---
backend/plugins/zentao/tasks/task_worklog_collector.go | 6 +++---
backend/plugins/zentao/tasks/task_worklog_convertor.go | 4 ++--
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git
a/backend/plugins/zentao/e2e/raw_tables/_raw_zentao_api_task_worklogs.csv
b/backend/plugins/zentao/e2e/raw_tables/_raw_zentao_api_task_worklogs.csv
index 0d4bed0d5..41131be4b 100644
--- a/backend/plugins/zentao/e2e/raw_tables/_raw_zentao_api_task_worklogs.csv
+++ b/backend/plugins/zentao/e2e/raw_tables/_raw_zentao_api_task_worklogs.csv
@@ -1,3 +1,3 @@
id,params,data,url,input,created_at
-1,"{""ConnectionId"":1,""ProjectId"":48}","{""id"":106,""objectType"":""task"",""objectID"":135,""product"":"""",""project"":48,""execution"":49,""account"":""devlake"",""work"":""sample
worklog"",""vision"":""rnd"",""date":""2025-02-20"",""left"":5,""consumed"":11.3,""begin"":0,""end"":0,""extra"":null,""order"":0,""deleted"":""0""}",http://iwater.red:8000/api.php/v1/tasks/135/estimate,{"id":135},2025-02-21
06:28:36.902
-2,"{""ConnectionId"":1,""ProjectId"":48}","{""id"":107,""objectType"":""task"",""objectID"":135,""product"":"""",""project"":48,""execution"":49,""account"":""devlake"",""work"":"""",""vision"":""rnd"",""date":""2025-02-20"",""left"":1,""consumed"":4,""begin"":0,""end"":0,""extra"":null,""order"":0,""deleted"":""0""}",http://iwater.red:8000/api.php/v1/tasks/135/estimate,{"id":135},2025-02-21
06:28:37.001
+1,"{""ConnectionId"":1,""ProjectId"":48}","{""id"":106,""objectType"":""task"",""objectID"":135,""product"":"""",""project"":48,""execution"":49,""account"":""devlake"",""work"":""sample
worklog"",""vision"":""rnd"",""date"":""2025-02-20"",""left"":5,""consumed"":11,""begin"":0,""end"":0,""extra"":null,""order"":0,""deleted"":""0""}",http://iwater.red:8000/api.php/v1/tasks/135/estimate,"{""id"":135}",2025-02-21
06:28:36.902
+2,"{""ConnectionId"":1,""ProjectId"":48}","{""id"":107,""objectType"":""task"",""objectID"":135,""product"":"""",""project"":48,""execution"":49,""account"":""devlake"",""work"":"""",""vision"":""rnd"",""date"":""2025-02-20"",""left"":1,""consumed"":4,""begin"":0,""end"":0,""extra"":null,""order"":0,""deleted"":""0""}",http://iwater.red:8000/api.php/v1/tasks/135/estimate,"{""id"":135}",2025-02-21
06:28:37.001
diff --git
a/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_worklogs.csv
b/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_worklogs.csv
index 889258d6c..4cfce3fc1 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_worklogs.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_worklogs.csv
@@ -1,3 +1,3 @@
connection_id,id,object_id,object_type,project,execution,product,account,work,vision,date,left,consumed,begin,end,extra,order,deleted
-1,106,135,task,48,49,,devlake,sample worklog,rnd,2025-02-20,5,11.3,0,0,NULL,0,0
-1,107,135,task,48,49,,devlake,,rnd,2025-02-20,1,4,0,0,NULL,0,0
+1,106,135,task,48,49,,devlake,sample worklog,rnd,2025-02-20,5,11,0,0,,0,0
+1,107,135,task,48,49,,devlake,,rnd,2025-02-20,1,4,0,0,,0,0
diff --git a/backend/plugins/zentao/e2e/snapshot_tables/issue_worklogs.csv
b/backend/plugins/zentao/e2e/snapshot_tables/issue_worklogs.csv
index f6c818e57..2afb729c0 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/issue_worklogs.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/issue_worklogs.csv
@@ -1,3 +1,3 @@
id,author_id,comment,time_spent_minutes,logged_date,started_date,issue_id,_raw_data_params,_raw_data_table,_raw_data_id,_raw_data_remark
-zentao:ZentaoWorklog:1:106,zentao:ZentaoAccount:1:1,sample
worklog,678,2025-02-20T08:00:00.000+00:00,2025-02-20T08:00:00.000+00:00,zentao:ZentaoTask:1:135,"{""ConnectionId"":1,""ProjectId"":48}",_raw_zentao_api_task_worklogs,1,
-zentao:ZentaoWorklog:1:107,zentao:ZentaoAccount:1:1,,240,2025-02-20T08:00:00.000+00:00,2025-02-20T08:00:00.000+00:00,zentao:ZentaoTask:1:135,"{""ConnectionId"":1,""ProjectId"":48}",_raw_zentao_api_task_worklogs,2,
+zentao:ZentaoWorklog:1:106,zentao:ZentaoAccount:1:1,sample
worklog,660,2025-02-20T00:00:00.000+00:00,2025-02-20T00:00:00.000+00:00,zentao:ZentaoTask:1:135,"{""ConnectionId"":1,""ProjectId"":48}",_raw_zentao_api_task_worklogs,1,
+zentao:ZentaoWorklog:1:107,zentao:ZentaoAccount:1:1,,240,2025-02-20T00:00:00.000+00:00,2025-02-20T00:00:00.000+00:00,zentao:ZentaoTask:1:135,"{""ConnectionId"":1,""ProjectId"":48}",_raw_zentao_api_task_worklogs,2,
diff --git a/backend/plugins/zentao/e2e/task_worklogs_test.go
b/backend/plugins/zentao/e2e/task_worklogs_test.go
index 4002e58ad..6d05c6574 100644
--- a/backend/plugins/zentao/e2e/task_worklogs_test.go
+++ b/backend/plugins/zentao/e2e/task_worklogs_test.go
@@ -21,7 +21,7 @@ import (
"testing"
"github.com/apache/incubator-devlake/core/models/common"
-
"github.com/apache/incubator-devlake/core/models/domainlayer/crossdomain"
+ "github.com/apache/incubator-devlake/core/models/domainlayer/ticket"
"github.com/apache/incubator-devlake/helpers/e2ehelper"
"github.com/apache/incubator-devlake/plugins/zentao/impl"
"github.com/apache/incubator-devlake/plugins/zentao/models"
@@ -56,9 +56,9 @@ func TestZentaoTaskWorklogDataFlow(t *testing.T) {
})
// verify task repo commit conversion
- dataflowTester.FlushTabler(&crossdomain.IssueWorklog{})
+ dataflowTester.FlushTabler(&ticket.IssueWorklog{})
dataflowTester.Subtask(tasks.ConvertTaskWorklogsMeta, taskData)
- dataflowTester.VerifyTableWithOptions(&crossdomain.IssueWorklog{},
e2ehelper.TableOptions{
+ dataflowTester.VerifyTableWithOptions(&ticket.IssueWorklog{},
e2ehelper.TableOptions{
CSVRelPath: "./snapshot_tables/issue_worklogs.csv",
IgnoreTypes: []interface{}{common.NoPKModel{}},
})
diff --git a/backend/plugins/zentao/tasks/task_worklog_collector.go
b/backend/plugins/zentao/tasks/task_worklog_collector.go
index 4e40cdd01..4bf610288 100644
--- a/backend/plugins/zentao/tasks/task_worklog_collector.go
+++ b/backend/plugins/zentao/tasks/task_worklog_collector.go
@@ -84,9 +84,9 @@ func CollectTaskWorklogs(taskCtx plugin.SubTaskContext)
errors.Error {
// collect task worklogs
err = apiCollector.InitCollector(api.ApiCollectorArgs{
- Input: iterator,
- ApiClient: data.ApiClient,
- UrlTemplate: "tasks/{{ .Input.Id }}/estimate",
+ Input: iterator,
+ ApiClient: data.ApiClient,
+ UrlTemplate: "tasks/{{ .Input.Id }}/estimate",
Query: func(reqData *api.RequestData) (url.Values,
errors.Error) {
return nil, nil
},
diff --git a/backend/plugins/zentao/tasks/task_worklog_convertor.go
b/backend/plugins/zentao/tasks/task_worklog_convertor.go
index 4a2a1fb72..9fea703b5 100644
--- a/backend/plugins/zentao/tasks/task_worklog_convertor.go
+++ b/backend/plugins/zentao/tasks/task_worklog_convertor.go
@@ -73,8 +73,8 @@ func ConvertTaskWorklogs(taskCtx plugin.SubTaskContext)
errors.Error {
Options: data.Options,
Table: RAW_TASK_WORKLOGS_TABLE,
},
- InputRowType: reflect.TypeOf(models.ZentaoWorklog{}),
- Input: cursor,
+ InputRowType: reflect.TypeOf(models.ZentaoWorklog{}),
+ Input: cursor,
Convert: func(inputRow interface{}) ([]interface{},
errors.Error) {
toolL := inputRow.(*models.ZentaoWorklog)
domainL := &ticket.IssueWorklog{