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 04:21:49 UTC

[incubator-devlake] branch release-v0.18 updated: fix(zentao): fix null started_date fields in sprints table (#6058)

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

abeizn pushed a commit to branch release-v0.18
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.18 by this push:
     new c39cc3a09 fix(zentao): fix null started_date fields in sprints table (#6058)
c39cc3a09 is described below

commit c39cc3a0996fa075b440db2053fd0c1e171cae8d
Author: Lynwee <li...@merico.dev>
AuthorDate: Tue Sep 12 12:21:45 2023 +0800

    fix(zentao): fix null started_date fields in sprints table (#6058)
---
 backend/plugins/zentao/e2e/snapshot_tables/execution_sprint.csv | 2 +-
 backend/plugins/zentao/tasks/execution_convertor.go             | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/backend/plugins/zentao/e2e/snapshot_tables/execution_sprint.csv b/backend/plugins/zentao/e2e/snapshot_tables/execution_sprint.csv
index 0270d8c14..db9071d0c 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/execution_sprint.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/execution_sprint.csv
@@ -5,5 +5,5 @@ zentao:ZentaoExecution:1:194,新建一个迭代,完成之后检查sprints表,h
 zentao:ZentaoExecution:1:266,新建迭代然后关闭,https://zentao.demo.haogs.cn/execution-view-266.html,CLOSED,2023-09-07T00:00:00.000+00:00,2023-09-13T00:00:00.000+00:00,2023-09-07T02:15:31.000+00:00,zentao:ZentaoProject:1:192
 zentao:ZentaoExecution:1:267,建一个计划未来开始迭代,https://zentao.demo.haogs.cn/execution-view-267.html,FUTURE,2023-09-09T00:00:00.000+00:00,2023-09-22T00:00:00.000+00:00,,zentao:ZentaoProject:1:192
 zentao:ZentaoExecution:1:268,起始-截止都是结束时间,https://zentao.demo.haogs.cn/execution-view-268.html,FUTURE,2023-09-04T00:00:00.000+00:00,2023-09-05T00:00:00.000+00:00,,zentao:ZentaoProject:1:192
-zentao:ZentaoExecution:1:269,把迭代挂起,https://zentao.demo.haogs.cn/execution-view-269.html,SUSPENDED,,2023-09-20T00:00:00.000+00:00,,zentao:ZentaoProject:1:192
+zentao:ZentaoExecution:1:269,把迭代挂起,https://zentao.demo.haogs.cn/execution-view-269.html,SUSPENDED,2023-09-07T00:00:00.000+00:00,2023-09-20T00:00:00.000+00:00,,zentao:ZentaoProject:1:192
 zentao:ZentaoExecution:1:270,流程扭转--挂起迭代2,https://zentao.demo.haogs.cn/execution-view-270.html,SUSPENDED,2023-09-07T00:00:00.000+00:00,2023-09-20T00:00:00.000+00:00,,zentao:ZentaoProject:1:192
diff --git a/backend/plugins/zentao/tasks/execution_convertor.go b/backend/plugins/zentao/tasks/execution_convertor.go
index 85ab86426..41d80d3bb 100644
--- a/backend/plugins/zentao/tasks/execution_convertor.go
+++ b/backend/plugins/zentao/tasks/execution_convertor.go
@@ -93,15 +93,14 @@ func ConvertExecutions(taskCtx plugin.SubTaskContext) errors.Error {
 				Name:            toolExecution.Name,
 				Url:             fmt.Sprintf("%s/execution-view-%d.html", homePage, toolExecution.Id),
 				Status:          domainStatus,
+				StartedDate:     toolExecution.RealBegan.ToNullableTime(),
 				EndedDate:       toolExecution.PlanEnd.ToNullableTime(),
 				CompletedDate:   toolExecution.ClosedDate.ToNullableTime(),
 				OriginalBoardID: projectIdGen.Generate(toolExecution.ConnectionId, data.Options.ProjectId),
 			}
 
-			if domainStatus == `FUTURE` || domainStatus == `` {
+			if sprint.StartedDate == nil {
 				sprint.StartedDate = toolExecution.PlanBegin.ToNullableTime()
-			} else {
-				sprint.StartedDate = toolExecution.RealBegan.ToNullableTime()
 			}
 
 			boardSprint := &ticket.BoardSprint{