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

zhangliang2022 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 5f6762ada fix: e2e test failed on latest gorm (#5312)
5f6762ada is described below

commit 5f6762adafcf6a4eaf1302942208bd76f1c719bb
Author: Klesh Wong <[email protected]>
AuthorDate: Tue May 30 15:14:18 2023 +0800

    fix: e2e test failed on latest gorm (#5312)
    
    * fix: e2e test failed on latest gorm
    
    * fix: unit test
---
 backend/helpers/e2ehelper/data_flow_tester.go      |  3 +--
 backend/plugins/github_graphql/impl/impl.go        |  4 ++--
 .../plugins/pagerduty/tasks/incidents_converter.go | 18 ++++++++++--------
 backend/plugins/tapd/models/bug.go                 |  2 +-
 backend/plugins/tapd/models/bug_changelog.go       |  2 +-
 backend/plugins/tapd/models/bug_commit.go          |  5 +++--
 backend/plugins/tapd/models/bug_custom_field.go    |  2 +-
 backend/plugins/tapd/models/iteration.go           |  4 ++--
 backend/plugins/tapd/models/story.go               |  2 +-
 backend/plugins/tapd/models/story_category.go      |  2 +-
 backend/plugins/tapd/models/story_changelog.go     |  3 ++-
 backend/plugins/tapd/models/story_commits.go       |  5 +++--
 backend/plugins/tapd/models/story_custom_field.go  |  2 +-
 backend/plugins/tapd/models/task.go                |  2 +-
 backend/plugins/tapd/models/task_changelog.go      |  3 ++-
 backend/plugins/tapd/models/task_commits.go        |  5 +++--
 backend/plugins/tapd/models/task_custom_field.go   |  2 +-
 backend/plugins/tapd/models/workitem_type.go       |  2 +-
 backend/plugins/tapd/models/worklog.go             |  2 +-
 backend/plugins/tapd/models/workspace.go           |  3 ++-
 backend/plugins/zentao/models/account.go           |  4 ++--
 backend/plugins/zentao/models/bug.go               |  2 +-
 backend/plugins/zentao/models/changelog.go         |  4 ++--
 backend/plugins/zentao/models/department.go        |  2 +-
 backend/plugins/zentao/models/execution.go         |  2 +-
 backend/plugins/zentao/models/product.go           |  2 +-
 backend/plugins/zentao/models/project.go           |  2 +-
 backend/plugins/zentao/models/story.go             |  2 +-
 backend/plugins/zentao/models/task.go              |  2 +-
 .../services/blueprint_makeplan_v200_test.go       |  2 +-
 docker-compose-dev.yml                             | 22 +++++++++++-----------
 31 files changed, 63 insertions(+), 56 deletions(-)

diff --git a/backend/helpers/e2ehelper/data_flow_tester.go 
b/backend/helpers/e2ehelper/data_flow_tester.go
index 6ea736412..fca165a47 100644
--- a/backend/helpers/e2ehelper/data_flow_tester.go
+++ b/backend/helpers/e2ehelper/data_flow_tester.go
@@ -20,7 +20,6 @@ package e2ehelper
 import (
        "context"
        "database/sql"
-       "encoding/json"
        "fmt"
        "os"
        "strconv"
@@ -134,7 +133,7 @@ func (t *DataFlowTester) ImportCsvIntoRawTable(csvRelPath 
string, rawTableName s
        // load rows and insert into target table
        for csvIter.HasNext() {
                toInsertValues := csvIter.Fetch()
-               toInsertValues[`data`] = 
json.RawMessage(toInsertValues[`data`].(string))
+               toInsertValues[`data`] = []byte(toInsertValues[`data`].(string))
                result := t.Db.Table(rawTableName).Create(toInsertValues)
                if result.Error != nil {
                        panic(result.Error)
diff --git a/backend/plugins/github_graphql/impl/impl.go 
b/backend/plugins/github_graphql/impl/impl.go
index 68008164b..9ed1251e5 100644
--- a/backend/plugins/github_graphql/impl/impl.go
+++ b/backend/plugins/github_graphql/impl/impl.go
@@ -188,10 +188,10 @@ func (p GithubGraphql) PrepareTaskData(taskCtx 
plugin.TaskContext, options map[s
        })
 
        regexEnricher := helper.NewRegexEnricher()
-       if err = regexEnricher.TryAdd(devops.DEPLOYMENT, op.DeploymentPattern); 
err != nil {
+       if err = regexEnricher.TryAdd(devops.DEPLOYMENT, 
op.ScopeConfig.DeploymentPattern); err != nil {
                return nil, errors.BadInput.Wrap(err, "invalid value for 
`deploymentPattern`")
        }
-       if err = regexEnricher.TryAdd(devops.PRODUCTION, op.ProductionPattern); 
err != nil {
+       if err = regexEnricher.TryAdd(devops.PRODUCTION, 
op.ScopeConfig.ProductionPattern); err != nil {
                return nil, errors.BadInput.Wrap(err, "invalid value for 
`productionPattern`")
        }
 
diff --git a/backend/plugins/pagerduty/tasks/incidents_converter.go 
b/backend/plugins/pagerduty/tasks/incidents_converter.go
index bc7293d0e..7547bf5c5 100644
--- a/backend/plugins/pagerduty/tasks/incidents_converter.go
+++ b/backend/plugins/pagerduty/tasks/incidents_converter.go
@@ -19,6 +19,9 @@ package tasks
 
 import (
        "fmt"
+       "reflect"
+       "time"
+
        "github.com/apache/incubator-devlake/core/dal"
        "github.com/apache/incubator-devlake/core/errors"
        "github.com/apache/incubator-devlake/core/models/common"
@@ -28,8 +31,6 @@ import (
        "github.com/apache/incubator-devlake/core/plugin"
        "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
        "github.com/apache/incubator-devlake/plugins/pagerduty/models"
-       "reflect"
-       "time"
 )
 
 var ConvertIncidentsMeta = plugin.SubTaskMeta{
@@ -44,7 +45,7 @@ type (
        // IncidentWithUser struct that represents the joined query result
        IncidentWithUser struct {
                common.NoPKModel
-               *models.Incident
+               models.Incident
                *models.User
                AssignedAt time.Time
        }
@@ -78,15 +79,14 @@ func ConvertIncidents(taskCtx plugin.SubTaskContext) 
errors.Error {
                Convert: func(inputRow interface{}) ([]interface{}, 
errors.Error) {
                        combined := inputRow.(*IncidentWithUser)
                        incident := combined.Incident
-                       user := combined.User
                        if seen, ok := seenIncidents[incident.Number]; ok {
                                if combined.AssignedAt.Before(seen.AssignedAt) {
                                        // skip this one (it's an older 
assignee)
                                        return nil, nil
                                }
                        }
-                       status := getStatus(incident)
-                       leadTime, resolutionDate := getTimes(incident)
+                       status := getStatus(&incident)
+                       leadTime, resolutionDate := getTimes(&incident)
                        domainIssue := &ticket.Issue{
                                DomainEntity: domainlayer.DomainEntity{
                                        Id: 
idGen.Generate(data.Options.ConnectionId, incident.Number),
@@ -102,8 +102,10 @@ func ConvertIncidents(taskCtx plugin.SubTaskContext) 
errors.Error {
                                UpdatedDate:     &incident.UpdatedDate,
                                LeadTimeMinutes: leadTime,
                                Priority:        string(incident.Urgency),
-                               AssigneeId:      user.Id,
-                               AssigneeName:    user.Name,
+                       }
+                       if combined.User != nil {
+                               domainIssue.AssigneeId = combined.User.Id
+                               domainIssue.AssigneeName = combined.User.Name
                        }
                        seenIncidents[incident.Number] = combined
                        boardIssue := &ticket.BoardIssue{
diff --git a/backend/plugins/tapd/models/bug.go 
b/backend/plugins/tapd/models/bug.go
index e5d3a328f..91089fe83 100644
--- a/backend/plugins/tapd/models/bug.go
+++ b/backend/plugins/tapd/models/bug.go
@@ -24,7 +24,7 @@ import (
 
 type TapdBug struct {
        ConnectionId uint64 `gorm:"primaryKey"`
-       Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+       Id           uint64 `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        EpicKey      string
        Title        string          `json:"title" gorm:"type:varchar(255)"`
        Description  string          `json:"description"`
diff --git a/backend/plugins/tapd/models/bug_changelog.go 
b/backend/plugins/tapd/models/bug_changelog.go
index 8bf9aa443..b5c655760 100644
--- a/backend/plugins/tapd/models/bug_changelog.go
+++ b/backend/plugins/tapd/models/bug_changelog.go
@@ -25,7 +25,7 @@ import (
 type TapdBugChangelog struct {
        ConnectionId uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
        WorkspaceId  uint64          `gorm:"type:BIGINT  NOT NULL"`
-       Id           uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       Id           uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        BugId        uint64          `json:"bug_id,string"`
        Author       string          `json:"author" gorm:"type:varchar(255)"`
        Field        string          `gorm:"primaryKey;type:varchar(255)" 
json:"field"`
diff --git a/backend/plugins/tapd/models/bug_commit.go 
b/backend/plugins/tapd/models/bug_commit.go
index d541e4b4f..7b872dae7 100644
--- a/backend/plugins/tapd/models/bug_commit.go
+++ b/backend/plugins/tapd/models/bug_commit.go
@@ -18,14 +18,15 @@ limitations under the License.
 package models
 
 import (
+       "time"
+
        "github.com/apache/incubator-devlake/core/models/common"
        helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
-       "time"
 )
 
 type TapdBugCommit struct {
        ConnectionId uint64 `gorm:"primaryKey"`
-       Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+       Id           uint64 `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
 
        UserId          string          `json:"user_id" 
gorm:"type:varchar(255)"`
        HookUserName    string          `json:"hook_user_name" 
gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/bug_custom_field.go 
b/backend/plugins/tapd/models/bug_custom_field.go
index f92c5d629..779302d6f 100644
--- a/backend/plugins/tapd/models/bug_custom_field.go
+++ b/backend/plugins/tapd/models/bug_custom_field.go
@@ -23,7 +23,7 @@ import (
 
 type TapdBugCustomFields struct {
        ConnectionId uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id           uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       Id           uint64 `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        WorkspaceId  uint64 `json:"workspace_id,string"`
        EntryType    string `json:"entry_type" gorm:"type:varchar(255)"`
        CustomField  string `json:"custom_field" gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/iteration.go 
b/backend/plugins/tapd/models/iteration.go
index 3863a4b3c..f91fd004c 100644
--- a/backend/plugins/tapd/models/iteration.go
+++ b/backend/plugins/tapd/models/iteration.go
@@ -23,8 +23,8 @@ import (
 )
 
 type TapdIteration struct {
-       ConnectionId uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id           uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       ConnectionId uint64          `gorm:"primaryKey;type:BIGINT NOT NULL"`
+       Id           uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        Name         string          `gorm:"type:varchar(255)" json:"name"`
        WorkspaceId  uint64          `json:"workspace_id,string"`
        Startdate    *helper.CSTTime `json:"startdate"`
diff --git a/backend/plugins/tapd/models/story.go 
b/backend/plugins/tapd/models/story.go
index 6e7d22328..adbff64de 100644
--- a/backend/plugins/tapd/models/story.go
+++ b/backend/plugins/tapd/models/story.go
@@ -24,7 +24,7 @@ import (
 
 type TapdStory struct {
        ConnectionId    uint64          `gorm:"primaryKey"`
-       Id              uint64          `gorm:"primaryKey;type:BIGINT" 
json:"id,string"`
+       Id              uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        WorkitemTypeId  uint64          `json:"workitem_type_id,string"`
        Name            string          `gorm:"type:varchar(255)" json:"name"`
        Description     string          `json:"description"`
diff --git a/backend/plugins/tapd/models/story_category.go 
b/backend/plugins/tapd/models/story_category.go
index 8f5ce1a10..1c7673f94 100644
--- a/backend/plugins/tapd/models/story_category.go
+++ b/backend/plugins/tapd/models/story_category.go
@@ -24,7 +24,7 @@ import (
 
 type TapdStoryCategory struct {
        ConnectionId uint64          `gorm:"primaryKey"`
-       Id           uint64          `gorm:"primaryKey;type:BIGINT" 
json:"id,string"`
+       Id           uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        Name         string          `json:"name" gorm:"type:varchar(255)"`
        Description  string          `json:"description"`
        ParentId     uint64          `json:"parent_id,string"`
diff --git a/backend/plugins/tapd/models/story_changelog.go 
b/backend/plugins/tapd/models/story_changelog.go
index eecb40e6f..8dee17081 100644
--- a/backend/plugins/tapd/models/story_changelog.go
+++ b/backend/plugins/tapd/models/story_changelog.go
@@ -19,13 +19,14 @@ package models
 
 import (
        "encoding/json"
+
        "github.com/apache/incubator-devlake/core/models/common"
        helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
 )
 
 type TapdStoryChangelog struct {
        ConnectionId   uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id             uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       Id             uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        WorkspaceId    uint64          `json:"workspace_id,string"`
        WorkitemTypeId uint64          `json:"workitem_type_id,string"`
        Creator        string          `json:"creator" gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/story_commits.go 
b/backend/plugins/tapd/models/story_commits.go
index b8cead653..1f471273a 100644
--- a/backend/plugins/tapd/models/story_commits.go
+++ b/backend/plugins/tapd/models/story_commits.go
@@ -18,14 +18,15 @@ limitations under the License.
 package models
 
 import (
+       "time"
+
        "github.com/apache/incubator-devlake/core/models/common"
        helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
-       "time"
 )
 
 type TapdStoryCommit struct {
        ConnectionId uint64 `gorm:"primaryKey"`
-       Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+       Id           uint64 `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
 
        UserId          string          `json:"user_id" 
gorm:"type:varchar(255)"`
        HookUserName    string          `json:"hook_user_name" 
gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/story_custom_field.go 
b/backend/plugins/tapd/models/story_custom_field.go
index dd54763c6..f4b6a736d 100644
--- a/backend/plugins/tapd/models/story_custom_field.go
+++ b/backend/plugins/tapd/models/story_custom_field.go
@@ -23,7 +23,7 @@ import (
 
 type TapdStoryCustomFields struct {
        ConnectionId uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id           uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       Id           uint64 `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        WorkspaceId  uint64 `json:"workspace_id,string"`
        EntryType    string `json:"entry_type" gorm:"type:varchar(255)"`
        CustomField  string `json:"custom_field" gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/task.go 
b/backend/plugins/tapd/models/task.go
index ab6e67c9d..4fc416b52 100644
--- a/backend/plugins/tapd/models/task.go
+++ b/backend/plugins/tapd/models/task.go
@@ -24,7 +24,7 @@ import (
 
 type TapdTask struct {
        ConnectionId    uint64          `gorm:"primaryKey"`
-       Id              uint64          `gorm:"primaryKey;type:BIGINT" 
json:"id,string"`
+       Id              uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        Name            string          `gorm:"type:varchar(255)" json:"name"`
        Description     string          `json:"description"`
        WorkspaceId     uint64          `json:"workspace_id,string"`
diff --git a/backend/plugins/tapd/models/task_changelog.go 
b/backend/plugins/tapd/models/task_changelog.go
index da898c6a7..4ce71df58 100644
--- a/backend/plugins/tapd/models/task_changelog.go
+++ b/backend/plugins/tapd/models/task_changelog.go
@@ -19,13 +19,14 @@ package models
 
 import (
        "encoding/json"
+
        "github.com/apache/incubator-devlake/core/models/common"
        helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
 )
 
 type TapdTaskChangelog struct {
        ConnectionId   uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id             uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       Id             uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        WorkspaceId    uint64          `json:"workspace_id,string"`
        WorkitemTypeId uint64          `json:"workitem_type_id,string"`
        Creator        string          `json:"creator" gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/task_commits.go 
b/backend/plugins/tapd/models/task_commits.go
index 49c065fe3..f0ae0572f 100644
--- a/backend/plugins/tapd/models/task_commits.go
+++ b/backend/plugins/tapd/models/task_commits.go
@@ -18,14 +18,15 @@ limitations under the License.
 package models
 
 import (
+       "time"
+
        "github.com/apache/incubator-devlake/core/models/common"
        helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
-       "time"
 )
 
 type TapdTaskCommit struct {
        ConnectionId uint64 `gorm:"primaryKey"`
-       Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+       Id           uint64 `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
 
        UserId          string          `json:"user_id" 
gorm:"type:varchar(255)"`
        HookUserName    string          `json:"hook_user_name" 
gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/task_custom_field.go 
b/backend/plugins/tapd/models/task_custom_field.go
index 49165f814..3d825700d 100644
--- a/backend/plugins/tapd/models/task_custom_field.go
+++ b/backend/plugins/tapd/models/task_custom_field.go
@@ -23,7 +23,7 @@ import (
 
 type TapdTaskCustomFields struct {
        ConnectionId uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id           uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       Id           uint64 `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        WorkspaceId  uint64 `json:"workspace_id,string"`
        EntryType    string `json:"entry_type" gorm:"type:varchar(255)"`
        CustomField  string `json:"custom_field" gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/workitem_type.go 
b/backend/plugins/tapd/models/workitem_type.go
index 558504b1c..53b2aefd6 100644
--- a/backend/plugins/tapd/models/workitem_type.go
+++ b/backend/plugins/tapd/models/workitem_type.go
@@ -24,7 +24,7 @@ import (
 
 type TapdWorkitemType struct {
        ConnectionId   uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id             uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       Id             uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        WorkspaceId    uint64          `json:"workspace_id,string"`
        EntityType     string          `gorm:"type:varchar(255)" 
json:"entity_type"`
        Name           string          `gorm:"type:varchar(255)" json:"name"`
diff --git a/backend/plugins/tapd/models/worklog.go 
b/backend/plugins/tapd/models/worklog.go
index 4bd692fbb..cac635d3d 100644
--- a/backend/plugins/tapd/models/worklog.go
+++ b/backend/plugins/tapd/models/worklog.go
@@ -24,7 +24,7 @@ import (
 
 type TapdWorklog struct {
        ConnectionId uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id           uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" 
json:"id,string"`
+       Id           uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        WorkspaceId  uint64          `json:"workspace_id,string"`
        EntityType   string          `gorm:"type:varchar(255)" 
json:"entity_type"`
        EntityId     uint64          `json:"entity_id,string"`
diff --git a/backend/plugins/tapd/models/workspace.go 
b/backend/plugins/tapd/models/workspace.go
index 661edc14f..151fa1c7b 100644
--- a/backend/plugins/tapd/models/workspace.go
+++ b/backend/plugins/tapd/models/workspace.go
@@ -19,6 +19,7 @@ package models
 
 import (
        "fmt"
+
        "github.com/apache/incubator-devlake/core/models/common"
        "github.com/apache/incubator-devlake/core/plugin"
        helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
@@ -26,7 +27,7 @@ import (
 
 type ApiTapdWorkspace struct {
        ConnectionId         uint64          `gorm:"primaryKey;type:BIGINT  NOT 
NULL"`
-       Id                   uint64          `gorm:"primaryKey;type:BIGINT" 
json:"id,string"`
+       Id                   uint64          `gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" json:"id,string"`
        Name                 string          `gorm:"type:varchar(255)" 
json:"name"`
        PrettyName           string          `gorm:"type:varchar(255)" 
json:"pretty_name"`
        Category             string          `gorm:"type:varchar(255)" 
json:"category"`
diff --git a/backend/plugins/zentao/models/account.go 
b/backend/plugins/zentao/models/account.go
index 306f495ca..f289bb5db 100644
--- a/backend/plugins/zentao/models/account.go
+++ b/backend/plugins/zentao/models/account.go
@@ -23,8 +23,8 @@ import (
 
 type ZentaoAccount struct {
        common.NoPKModel
-       ConnectionId uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       ID           int64  `json:"id" gorm:"primaryKey;type:BIGINT  NOT NULL" `
+       ConnectionId uint64 `gorm:"primaryKey;type:BIGINT NOT NULL"`
+       ID           int64  `json:"id" gorm:"primaryKey;type:BIGINT NOT 
NULL;autoIncrement:false" `
        Account      string `json:"account" gorm:"type:varchar(100);index"`
        Avatar       string `json:"avatar" gorm:"type:varchar(255)"`
        Realname     string `json:"realname" gorm:"type:varchar(100);index"`
diff --git a/backend/plugins/zentao/models/bug.go 
b/backend/plugins/zentao/models/bug.go
index 740bcb0b2..664910121 100644
--- a/backend/plugins/zentao/models/bug.go
+++ b/backend/plugins/zentao/models/bug.go
@@ -93,7 +93,7 @@ type ZentaoBugRes struct {
 type ZentaoBug struct {
        common.NoPKModel
        ConnectionId   uint64              `gorm:"primaryKey;type:BIGINT  NOT 
NULL"`
-       ID             int64               `json:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL"`
+       ID             int64               `json:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL;autoIncrement:false"`
        Project        int64               `json:"project"`
        Product        int64               `json:"product"`
        Injection      int                 `json:"injection"`
diff --git a/backend/plugins/zentao/models/changelog.go 
b/backend/plugins/zentao/models/changelog.go
index 152b0bdff..ef7693847 100644
--- a/backend/plugins/zentao/models/changelog.go
+++ b/backend/plugins/zentao/models/changelog.go
@@ -26,7 +26,7 @@ import (
 type ZentaoChangelog struct {
        common.NoPKModel `json:"-"`
        ConnectionId     uint64    `json:"connectionId" 
mapstructure:"connectionId" gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id               int64     `json:"id" mapstructure:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL"`
+       Id               int64     `json:"id" mapstructure:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL;autoIncrement:false"`
        ObjectId         int       `json:"objectId" mapstructure:"objectId" 
gorm:"index; NOT NULL"`
        Execution        int       `json:"execution" mapstructure:"execution" `
        Actor            string    `json:"actor" mapstructure:"actor" `
@@ -49,7 +49,7 @@ func (ZentaoChangelog) TableName() string {
 type ZentaoChangelogDetail struct {
        common.NoPKModel `json:"-"`
        ConnectionId     uint64 `json:"connectionId" 
mapstructure:"connectionId" gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id               int64  `json:"id" mapstructure:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL"`
+       Id               int64  `json:"id" mapstructure:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL;autoIncrement:false"`
        ChangelogId      int64  `json:"changelogId" mapstructure:"changelogId" 
gorm:"primaryKey;type:BIGINT  NOT NULL"`
        Field            string `json:"field" mapstructure:"field"`
        Old              string `json:"old" mapstructure:"old"`
diff --git a/backend/plugins/zentao/models/department.go 
b/backend/plugins/zentao/models/department.go
index 0c52a655e..945e6c959 100644
--- a/backend/plugins/zentao/models/department.go
+++ b/backend/plugins/zentao/models/department.go
@@ -23,7 +23,7 @@ import (
 
 type ZentaoDepartment struct {
        ConnectionId uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       ID           int64  `json:"id" gorm:"primaryKey;type:BIGINT  NOT NULL" `
+       ID           int64  `json:"id" gorm:"primaryKey;type:BIGINT  NOT 
NULL;autoIncrement:false" `
        Name         string `json:"name" gorm:"type:varchar(100);index"`
        Parent       int64  `json:"parent" gorm:"type:BIGINT  NOT NULL"`
        Path         string `json:"path" gorm:"type:varchar(100)"`
diff --git a/backend/plugins/zentao/models/execution.go 
b/backend/plugins/zentao/models/execution.go
index d1e4b524b..e439ba4ed 100644
--- a/backend/plugins/zentao/models/execution.go
+++ b/backend/plugins/zentao/models/execution.go
@@ -160,7 +160,7 @@ type ZentaoExecutionRes struct {
 
 type ZentaoExecution struct {
        ConnectionId   uint64              `gorm:"primaryKey;type:BIGINT  NOT 
NULL"`
-       Id             int64               `json:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL"`
+       Id             int64               `json:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL;autoIncrement:false"`
        Project        int64               `json:"project"`
        Model          string              `json:"model"`
        Type           string              `json:"type"`
diff --git a/backend/plugins/zentao/models/product.go 
b/backend/plugins/zentao/models/product.go
index 521286294..c27f02d1c 100644
--- a/backend/plugins/zentao/models/product.go
+++ b/backend/plugins/zentao/models/product.go
@@ -115,7 +115,7 @@ func (res ZentaoProductRes) ConvertApiScope() 
plugin.ToolLayerScope {
 type ZentaoProduct struct {
        common.NoPKModel `json:"-"`
        ConnectionId     uint64 `json:"connectionId" 
mapstructure:"connectionId" gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id               int64  `json:"id" mapstructure:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL"`
+       Id               int64  `json:"id" mapstructure:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL;autoIncrement:false"`
        Program          int    `json:"program" mapstructure:"program"`
        Name             string `json:"name" mapstructure:"name"`
        Code             string `json:"code" mapstructure:"code"`
diff --git a/backend/plugins/zentao/models/project.go 
b/backend/plugins/zentao/models/project.go
index 827c53f57..f5fbceb5a 100644
--- a/backend/plugins/zentao/models/project.go
+++ b/backend/plugins/zentao/models/project.go
@@ -28,7 +28,7 @@ import (
 type ZentaoProject struct {
        common.NoPKModel `json:"-"`
        ConnectionId     uint64              `json:"connectionid" 
mapstructure:"connectionid" gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       Id               int64               `json:"id" mapstructure:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL"`
+       Id               int64               `json:"id" mapstructure:"id" 
gorm:"primaryKey;type:BIGINT  NOT NULL;autoIncrement:false"`
        Project          int64               `json:"project" 
mapstructure:"project"`
        Model            string              `json:"model" mapstructure:"model"`
        Type             string              `json:"type" mapstructure:"type"`
diff --git a/backend/plugins/zentao/models/story.go 
b/backend/plugins/zentao/models/story.go
index c1c71f5c1..274fec596 100644
--- a/backend/plugins/zentao/models/story.go
+++ b/backend/plugins/zentao/models/story.go
@@ -82,7 +82,7 @@ type ZentaoStoryRes struct {
 type ZentaoStory struct {
        common.NoPKModel
        ConnectionId uint64  `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       ID           int64   `json:"id" gorm:"primaryKey;type:BIGINT  NOT NULL" 
`
+       ID           int64   `json:"id" gorm:"primaryKey;type:BIGINT  NOT 
NULL;autoIncrement:false" `
        Product      int64   `json:"product"`
        Branch       int     `json:"branch"`
        Version      int     `json:"version"`
diff --git a/backend/plugins/zentao/models/task.go 
b/backend/plugins/zentao/models/task.go
index 0b78b3261..43a20be93 100644
--- a/backend/plugins/zentao/models/task.go
+++ b/backend/plugins/zentao/models/task.go
@@ -94,7 +94,7 @@ type ZentaoTaskRes struct {
 type ZentaoTask struct {
        common.NoPKModel
        ConnectionId  uint64  `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-       ID            int64   `json:"id" gorm:"primaryKey;type:BIGINT  NOT 
NULL"`
+       ID            int64   `json:"id" gorm:"primaryKey;type:BIGINT  NOT 
NULL;autoIncrement:false"`
        Project       int64   `json:"project"`
        Parent        int64   `json:"parent"`
        Execution     int64   `json:"execution"`
diff --git a/backend/server/services/blueprint_makeplan_v200_test.go 
b/backend/server/services/blueprint_makeplan_v200_test.go
index 7563f98c2..743c67742 100644
--- a/backend/server/services/blueprint_makeplan_v200_test.go
+++ b/backend/server/services/blueprint_makeplan_v200_test.go
@@ -102,7 +102,7 @@ func TestMakePlanV200(t *testing.T) {
                doraName: nil,
        }
 
-       plan, scopes, err := genPlanJsonV200(projectName, syncPolicy, sources, 
metrics)
+       plan, scopes, err := genPlanJsonV200(projectName, syncPolicy, sources, 
metrics, false)
        assert.Nil(t, err)
 
        assert.Equal(t, expectedPlan, plan)
diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml
index 76be6a6b0..beae68982 100644
--- a/docker-compose-dev.yml
+++ b/docker-compose-dev.yml
@@ -33,17 +33,17 @@ services:
       --skip-log-bin
 
 
-  # postgres:
-  #   image: postgres:14.2
-  #   volumes:
-  #     - postgres-storage:/var/lib/postgresql
-  #   restart: always
-  #   ports:
-  #     - 127.0.0.1:5432:5432
-  #   environment:
-  #     POSTGRES_DB: lake
-  #     POSTGRES_USER: merico
-  #     POSTGRES_PASSWORD: merico
+  postgres:
+    image: postgres:14.2
+    volumes:
+      - postgres-storage:/var/lib/postgresql
+    restart: always
+    ports:
+      - 127.0.0.1:5432:5432
+    environment:
+      POSTGRES_DB: lake
+      POSTGRES_USER: merico
+      POSTGRES_PASSWORD: merico
 
   grafana:
     image: mericodev/devlake-dashboard:latest

Reply via email to