This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch release-v0.21
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v0.21 by this push:
new 154d4f5da fix(tapd): change iteration_id's type from uint64 to int64
(#7334) (#7336)
154d4f5da is described below
commit 154d4f5da07da99cea6a99dfff5126af834771f9
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Apr 16 17:48:36 2024 +0800
fix(tapd): change iteration_id's type from uint64 to int64 (#7334) (#7336)
* fix(tapd): change iteration_id's type from uint64 to int64
* fix(tapd): fix test
Co-authored-by: Lynwee <[email protected]>
---
backend/plugins/tapd/models/bug.go | 2 +-
backend/plugins/tapd/models/bug_changelog.go | 4 ++--
backend/plugins/tapd/models/changelog.go | 4 ++--
backend/plugins/tapd/models/iteration.go | 4 ++--
backend/plugins/tapd/models/iteration_bug.go | 2 +-
backend/plugins/tapd/models/iteration_story.go | 2 +-
backend/plugins/tapd/models/iteration_task.go | 2 +-
backend/plugins/tapd/models/story.go | 2 +-
backend/plugins/tapd/models/story_changelog.go | 8 ++++----
backend/plugins/tapd/models/task.go | 2 +-
backend/plugins/tapd/models/task_changelog.go | 8 ++++----
backend/plugins/tapd/tasks/bug_changelog_converter.go | 4 ++--
backend/plugins/tapd/tasks/shared.go | 2 +-
backend/plugins/tapd/tasks/shared_test.go | 4 ++--
backend/plugins/tapd/tasks/story_changelog_converter.go | 4 ++--
backend/plugins/tapd/tasks/task_changelog_converter.go | 4 ++--
16 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/backend/plugins/tapd/models/bug.go
b/backend/plugins/tapd/models/bug.go
index b06b8b8ff..0a4c8f934 100644
--- a/backend/plugins/tapd/models/bug.go
+++ b/backend/plugins/tapd/models/bug.go
@@ -35,7 +35,7 @@ type TapdBug struct {
Begin *common.CSTTime `json:"begin"`
Due *common.CSTTime `json:"due"`
Priority string `json:"priority" gorm:"type:varchar(255)"`
- IterationId uint64 `json:"iteration_id,string"`
+ IterationId int64 `json:"iteration_id,string"`
Source string `json:"source" gorm:"type:varchar(255)"`
Module string `json:"module" gorm:"type:varchar(255)"`
ReleaseId uint64 `json:"release_id,string"`
diff --git a/backend/plugins/tapd/models/bug_changelog.go
b/backend/plugins/tapd/models/bug_changelog.go
index 3a1186eb7..8b4302b86 100644
--- a/backend/plugins/tapd/models/bug_changelog.go
+++ b/backend/plugins/tapd/models/bug_changelog.go
@@ -41,8 +41,8 @@ type TapdBugChangelogItem struct {
Field string `json:"field" gorm:"primaryKey;"`
ValueBeforeParsed string `json:"value_before_parsed"`
ValueAfterParsed string `json:"value_after_parsed"`
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
common.NoPKModel
}
diff --git a/backend/plugins/tapd/models/changelog.go
b/backend/plugins/tapd/models/changelog.go
index 039ca121f..4a13852da 100644
--- a/backend/plugins/tapd/models/changelog.go
+++ b/backend/plugins/tapd/models/changelog.go
@@ -31,8 +31,8 @@ type ChangelogTmp struct {
FieldName string
FromValue string
ToValue string
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
CreatedDate time.Time
common.RawDataOrigin
}
diff --git a/backend/plugins/tapd/models/iteration.go
b/backend/plugins/tapd/models/iteration.go
index 540ac5a21..16a8f86c0 100644
--- a/backend/plugins/tapd/models/iteration.go
+++ b/backend/plugins/tapd/models/iteration.go
@@ -23,7 +23,7 @@ import (
type TapdIteration struct {
ConnectionId uint64 `gorm:"primaryKey;type:BIGINT NOT NULL"`
- Id uint64 `gorm:"primaryKey;type:BIGINT NOT
NULL;autoIncrement:false" json:"id,string"`
+ Id int64 `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 *common.CSTTime `json:"startdate"`
@@ -46,7 +46,7 @@ type TapdWorkspaceIteration struct {
common.NoPKModel
ConnectionId uint64 `gorm:"primaryKey"`
WorkspaceId uint64 `gorm:"primaryKey"`
- IterationId uint64 `gorm:"primaryKey"`
+ IterationId int64 `gorm:"primaryKey"`
}
func (TapdIteration) TableName() string {
diff --git a/backend/plugins/tapd/models/iteration_bug.go
b/backend/plugins/tapd/models/iteration_bug.go
index 0d86bc981..6883f99de 100644
--- a/backend/plugins/tapd/models/iteration_bug.go
+++ b/backend/plugins/tapd/models/iteration_bug.go
@@ -24,7 +24,7 @@ import (
type TapdIterationBug struct {
common.NoPKModel
ConnectionId uint64 `gorm:"primaryKey"`
- IterationId uint64 `gorm:"primaryKey"`
+ IterationId int64 `gorm:"primaryKey"`
WorkspaceId uint64 `gorm:"primaryKey"`
BugId uint64 `gorm:"primaryKey"`
ResolutionDate *common.CSTTime
diff --git a/backend/plugins/tapd/models/iteration_story.go
b/backend/plugins/tapd/models/iteration_story.go
index 775c7c81c..76024cec4 100644
--- a/backend/plugins/tapd/models/iteration_story.go
+++ b/backend/plugins/tapd/models/iteration_story.go
@@ -24,7 +24,7 @@ import (
type TapdIterationStory struct {
common.NoPKModel
ConnectionId uint64 `gorm:"primaryKey"`
- IterationId uint64 `gorm:"primaryKey"`
+ IterationId int64 `gorm:"primaryKey"`
WorkspaceId uint64 `gorm:"primaryKey"`
StoryId uint64 `gorm:"primaryKey"`
diff --git a/backend/plugins/tapd/models/iteration_task.go
b/backend/plugins/tapd/models/iteration_task.go
index be0a12bf4..0c65ac46c 100644
--- a/backend/plugins/tapd/models/iteration_task.go
+++ b/backend/plugins/tapd/models/iteration_task.go
@@ -24,7 +24,7 @@ import (
type TapdIterationTask struct {
common.NoPKModel
ConnectionId uint64 `gorm:"primaryKey"`
- IterationId uint64 `gorm:"primaryKey"`
+ IterationId int64 `gorm:"primaryKey"`
WorkspaceId uint64 `gorm:"primaryKey"`
TaskId uint64 `gorm:"primaryKey"`
diff --git a/backend/plugins/tapd/models/story.go
b/backend/plugins/tapd/models/story.go
index 53e7c2cdd..76f24252b 100644
--- a/backend/plugins/tapd/models/story.go
+++ b/backend/plugins/tapd/models/story.go
@@ -39,7 +39,7 @@ type TapdStory struct {
Size int16 `json:"size,string"`
Priority string `gorm:"type:varchar(255)"
json:"priority"`
Developer string `gorm:"type:varchar(255)"
json:"developer"`
- IterationId uint64 `json:"iteration_id,string"`
+ IterationId int64 `json:"iteration_id,string"`
TestFocus string `json:"test_focus"
gorm:"type:varchar(255)"`
Type string `json:"type" gorm:"type:varchar(255)"`
Source string `json:"source" gorm:"type:varchar(255)"`
diff --git a/backend/plugins/tapd/models/story_changelog.go
b/backend/plugins/tapd/models/story_changelog.go
index 64d9f371b..ed559af7f 100644
--- a/backend/plugins/tapd/models/story_changelog.go
+++ b/backend/plugins/tapd/models/story_changelog.go
@@ -47,8 +47,8 @@ type TapdStoryChangelogItemRes struct {
ValueAfterParsed json.RawMessage `json:"value_after_parsed"`
ValueBefore json.RawMessage `json:"value_before"`
ValueAfter json.RawMessage `json:"value_after"`
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
common.NoPKModel
}
@@ -58,8 +58,8 @@ type TapdStoryChangelogItem struct {
Field string `json:"field"
gorm:"primaryKey;type:varchar(255)"`
ValueBeforeParsed string `json:"value_before_parsed"`
ValueAfterParsed string `json:"value_after_parsed"`
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
common.NoPKModel
}
diff --git a/backend/plugins/tapd/models/task.go
b/backend/plugins/tapd/models/task.go
index bd285c467..b10f94bae 100644
--- a/backend/plugins/tapd/models/task.go
+++ b/backend/plugins/tapd/models/task.go
@@ -36,7 +36,7 @@ type TapdTask struct {
Begin *common.CSTTime `json:"begin"`
Due *common.CSTTime `json:"due"`
Priority string `gorm:"type:varchar(255)"
json:"priority"`
- IterationId uint64 `json:"iteration_id,string"`
+ IterationId int64 `json:"iteration_id,string"`
Completed *common.CSTTime `json:"completed"`
Effort float32 `json:"effort,string"`
EffortCompleted float32 `json:"effort_completed,string"`
diff --git a/backend/plugins/tapd/models/task_changelog.go
b/backend/plugins/tapd/models/task_changelog.go
index b6c50daac..7d0f45481 100644
--- a/backend/plugins/tapd/models/task_changelog.go
+++ b/backend/plugins/tapd/models/task_changelog.go
@@ -46,8 +46,8 @@ type TapdTaskChangelogItem struct {
Field string `json:"field"
gorm:"primaryKey;type:varchar(255)"`
ValueBeforeParsed string `json:"value_before_parsed"`
ValueAfterParsed string `json:"value_after_parsed"`
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
common.NoPKModel
}
@@ -59,8 +59,8 @@ type TapdTaskChangelogItemRes struct {
ValueAfterParsed json.RawMessage `json:"value_after_parsed"`
ValueBefore json.RawMessage `json:"value_before"`
ValueAfter json.RawMessage `json:"value_after"`
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
common.NoPKModel
}
diff --git a/backend/plugins/tapd/tasks/bug_changelog_converter.go
b/backend/plugins/tapd/tasks/bug_changelog_converter.go
index 3d87497b3..0ec3699c0 100644
--- a/backend/plugins/tapd/tasks/bug_changelog_converter.go
+++ b/backend/plugins/tapd/tasks/bug_changelog_converter.go
@@ -46,8 +46,8 @@ type BugChangelogItemResult struct {
ChangelogId uint64 `gorm:"primaryKey;type:BIGINT NOT NULL"`
ValueBeforeParsed string `json:"value_before"`
ValueAfterParsed string `json:"value_after"`
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
common.NoPKModel
}
diff --git a/backend/plugins/tapd/tasks/shared.go
b/backend/plugins/tapd/tasks/shared.go
index 25487b9bc..3f6986557 100644
--- a/backend/plugins/tapd/tasks/shared.go
+++ b/backend/plugins/tapd/tasks/shared.go
@@ -98,7 +98,7 @@ func GetTotalPagesFromResponse(r *http.Response, args
*api.ApiCollectorArgs) (in
}
// parseIterationChangelog function is used to parse the iteration changelog
-func parseIterationChangelog(taskCtx plugin.SubTaskContext, old string, new
string) (iterationFromId uint64, iterationToId uint64, err errors.Error) {
+func parseIterationChangelog(taskCtx plugin.SubTaskContext, old string, new
string) (iterationFromId int64, iterationToId int64, err errors.Error) {
data := taskCtx.GetData().(*TapdTaskData)
db := taskCtx.GetDal()
diff --git a/backend/plugins/tapd/tasks/shared_test.go
b/backend/plugins/tapd/tasks/shared_test.go
index 96835069f..6763d5b58 100644
--- a/backend/plugins/tapd/tasks/shared_test.go
+++ b/backend/plugins/tapd/tasks/shared_test.go
@@ -64,8 +64,8 @@ func TestParseIterationChangelog(t *testing.T) {
}).Return(nil).Once()
// Test case 2: success scenario
iterationFromId, iterationToId, err := parseIterationChangelog(mockCtx,
"old", "new")
- assert.Equal(t, uint64(1), iterationFromId)
- assert.Equal(t, uint64(2), iterationToId)
+ assert.Equal(t, int64(1), iterationFromId)
+ assert.Equal(t, int64(2), iterationToId)
assert.Nil(t, err)
}
diff --git a/backend/plugins/tapd/tasks/story_changelog_converter.go
b/backend/plugins/tapd/tasks/story_changelog_converter.go
index c075d2f59..a51b106a5 100644
--- a/backend/plugins/tapd/tasks/story_changelog_converter.go
+++ b/backend/plugins/tapd/tasks/story_changelog_converter.go
@@ -49,8 +49,8 @@ type StoryChangelogItemResult struct {
Field string `json:"field"
gorm:"primaryKey;type:varchar(255)"`
ValueBeforeParsed string `json:"value_before"`
ValueAfterParsed string `json:"value_after"`
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
common.NoPKModel
}
diff --git a/backend/plugins/tapd/tasks/task_changelog_converter.go
b/backend/plugins/tapd/tasks/task_changelog_converter.go
index d92c8c991..d82e642aa 100644
--- a/backend/plugins/tapd/tasks/task_changelog_converter.go
+++ b/backend/plugins/tapd/tasks/task_changelog_converter.go
@@ -50,8 +50,8 @@ type TaskChangelogItemResult struct {
Field string `json:"field"
gorm:"primaryKey;type:varchar(255)"`
ValueBeforeParsed string `json:"value_before"`
ValueAfterParsed string `json:"value_after"`
- IterationIdFrom uint64
- IterationIdTo uint64
+ IterationIdFrom int64
+ IterationIdTo int64
common.NoPKModel
}