Skip to content

Commit

Permalink
fix(tapd): change iteration_id's type from uint64 to int64 (#7334) (#…
Browse files Browse the repository at this point in the history
…7336)

* fix(tapd): change iteration_id's type from uint64 to int64

* fix(tapd): fix test

Co-authored-by: Lynwee <[email protected]>
  • Loading branch information
github-actions[bot] and d4x1 authored Apr 16, 2024
1 parent 88fc8db commit 154d4f5
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion backend/plugins/tapd/models/bug.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 2 additions & 2 deletions backend/plugins/tapd/models/bug_changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions backend/plugins/tapd/models/changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions backend/plugins/tapd/models/iteration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/tapd/models/iteration_bug.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/tapd/models/iteration_story.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/tapd/models/iteration_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/tapd/models/story.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"`
Expand Down
8 changes: 4 additions & 4 deletions backend/plugins/tapd/models/story_changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/tapd/models/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
8 changes: 4 additions & 4 deletions backend/plugins/tapd/models/task_changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions backend/plugins/tapd/tasks/bug_changelog_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion backend/plugins/tapd/tasks/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions backend/plugins/tapd/tasks/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions backend/plugins/tapd/tasks/story_changelog_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions backend/plugins/tapd/tasks/task_changelog_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 154d4f5

Please sign in to comment.