You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ly...@apache.org on 2025/05/06 08:13:36 UTC

(incubator-devlake) branch main updated: fix(tapd): fix panic when executing extractStoryCategories (#8425)

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 e7bf7a183 fix(tapd): fix panic when executing extractStoryCategories (#8425)
e7bf7a183 is described below

commit e7bf7a1838e67212fcc35de7d011b7bbd58734ce
Author: Lynwee <15...@qq.com>
AuthorDate: Tue May 6 16:13:32 2025 +0800

    fix(tapd): fix panic when executing extractStoryCategories (#8425)
    
    * fix(tapd): fix panic when executing extractStoryCategories
    
    * style(github): format codes
---
 backend/plugins/github/api/remote_data.go     | 148 +++++++++++++-------------
 backend/plugins/tapd/models/story_category.go |   4 +-
 2 files changed, 76 insertions(+), 76 deletions(-)

diff --git a/backend/plugins/github/api/remote_data.go b/backend/plugins/github/api/remote_data.go
index 640e437f8..f6599e78c 100644
--- a/backend/plugins/github/api/remote_data.go
+++ b/backend/plugins/github/api/remote_data.go
@@ -161,82 +161,82 @@ type GithubAppRepo struct {
 		Type              string `json:"type"`
 		SiteAdmin         bool   `json:"site_admin"`
 	} `json:"owner"`
-	Private             bool      `json:"private"`
-	HTMLURL             string    `json:"html_url"`
-	Description         string    `json:"description"`
-	Fork                bool      `json:"fork"`
-	URL                 string    `json:"url"`
-	ArchiveURL          string    `json:"archive_url"`
-	AssigneesURL        string    `json:"assignees_url"`
-	BlobsURL            string    `json:"blobs_url"`
-	BranchesURL         string    `json:"branches_url"`
-	CollaboratorsURL    string    `json:"collaborators_url"`
-	CommentsURL         string    `json:"comments_url"`
-	CommitsURL          string    `json:"commits_url"`
-	CompareURL          string    `json:"compare_url"`
-	ContentsURL         string    `json:"contents_url"`
-	ContributorsURL     string    `json:"contributors_url"`
-	DeploymentsURL      string    `json:"deployments_url"`
-	DownloadsURL        string    `json:"downloads_url"`
-	EventsURL           string    `json:"events_url"`
-	ForksURL            string    `json:"forks_url"`
-	GitCommitsURL       string    `json:"git_commits_url"`
-	GitRefsURL          string    `json:"git_refs_url"`
-	GitTagsURL          string    `json:"git_tags_url"`
-	GitURL              string    `json:"git_url"`
-	IssueCommentURL     string    `json:"issue_comment_url"`
-	IssueEventsURL      string    `json:"issue_events_url"`
-	IssuesURL           string    `json:"issues_url"`
-	KeysURL             string    `json:"keys_url"`
-	LabelsURL           string    `json:"labels_url"`
-	LanguagesURL        string    `json:"languages_url"`
-	MergesURL           string    `json:"merges_url"`
-	MilestonesURL       string    `json:"milestones_url"`
-	NotificationsURL    string    `json:"notifications_url"`
-	PullsURL            string    `json:"pulls_url"`
-	ReleasesURL         string    `json:"releases_url"`
-	SSHURL              string    `json:"ssh_url"`
-	StargazersURL       string    `json:"stargazers_url"`
-	StatusesURL         string    `json:"statuses_url"`
-	SubscribersURL      string    `json:"subscribers_url"`
-	SubscriptionURL     string    `json:"subscription_url"`
-	TagsURL             string    `json:"tags_url"`
-	TeamsURL            string    `json:"teams_url"`
-	TreesURL            string    `json:"trees_url"`
-	CloneURL            string    `json:"clone_url"`
-	MirrorURL           string    `json:"mirror_url"`
-	HooksURL            string    `json:"hooks_url"`
-	SvnURL              string    `json:"svn_url"`
-	Homepage            string    `json:"homepage"`
-	Language            any       `json:"language"`
-	ForksCount          int       `json:"forks_count"`
-	StargazersCount     int       `json:"stargazers_count"`
-	WatchersCount       int       `json:"watchers_count"`
-	Size                int       `json:"size"`
-	DefaultBranch       string    `json:"default_branch"`
-	OpenIssuesCount     int       `json:"open_issues_count"`
-	IsTemplate          bool      `json:"is_template"`
-	Topics              []string  `json:"topics"`
-	HasIssues           bool      `json:"has_issues"`
-	HasProjects         bool      `json:"has_projects"`
-	HasWiki             bool      `json:"has_wiki"`
-	HasPages            bool      `json:"has_pages"`
-	HasDownloads        bool      `json:"has_downloads"`
-	Archived            bool      `json:"archived"`
-	Disabled            bool      `json:"disabled"`
-	Visibility          string    `json:"visibility"`
+	Private             bool       `json:"private"`
+	HTMLURL             string     `json:"html_url"`
+	Description         string     `json:"description"`
+	Fork                bool       `json:"fork"`
+	URL                 string     `json:"url"`
+	ArchiveURL          string     `json:"archive_url"`
+	AssigneesURL        string     `json:"assignees_url"`
+	BlobsURL            string     `json:"blobs_url"`
+	BranchesURL         string     `json:"branches_url"`
+	CollaboratorsURL    string     `json:"collaborators_url"`
+	CommentsURL         string     `json:"comments_url"`
+	CommitsURL          string     `json:"commits_url"`
+	CompareURL          string     `json:"compare_url"`
+	ContentsURL         string     `json:"contents_url"`
+	ContributorsURL     string     `json:"contributors_url"`
+	DeploymentsURL      string     `json:"deployments_url"`
+	DownloadsURL        string     `json:"downloads_url"`
+	EventsURL           string     `json:"events_url"`
+	ForksURL            string     `json:"forks_url"`
+	GitCommitsURL       string     `json:"git_commits_url"`
+	GitRefsURL          string     `json:"git_refs_url"`
+	GitTagsURL          string     `json:"git_tags_url"`
+	GitURL              string     `json:"git_url"`
+	IssueCommentURL     string     `json:"issue_comment_url"`
+	IssueEventsURL      string     `json:"issue_events_url"`
+	IssuesURL           string     `json:"issues_url"`
+	KeysURL             string     `json:"keys_url"`
+	LabelsURL           string     `json:"labels_url"`
+	LanguagesURL        string     `json:"languages_url"`
+	MergesURL           string     `json:"merges_url"`
+	MilestonesURL       string     `json:"milestones_url"`
+	NotificationsURL    string     `json:"notifications_url"`
+	PullsURL            string     `json:"pulls_url"`
+	ReleasesURL         string     `json:"releases_url"`
+	SSHURL              string     `json:"ssh_url"`
+	StargazersURL       string     `json:"stargazers_url"`
+	StatusesURL         string     `json:"statuses_url"`
+	SubscribersURL      string     `json:"subscribers_url"`
+	SubscriptionURL     string     `json:"subscription_url"`
+	TagsURL             string     `json:"tags_url"`
+	TeamsURL            string     `json:"teams_url"`
+	TreesURL            string     `json:"trees_url"`
+	CloneURL            string     `json:"clone_url"`
+	MirrorURL           string     `json:"mirror_url"`
+	HooksURL            string     `json:"hooks_url"`
+	SvnURL              string     `json:"svn_url"`
+	Homepage            string     `json:"homepage"`
+	Language            any        `json:"language"`
+	ForksCount          int        `json:"forks_count"`
+	StargazersCount     int        `json:"stargazers_count"`
+	WatchersCount       int        `json:"watchers_count"`
+	Size                int        `json:"size"`
+	DefaultBranch       string     `json:"default_branch"`
+	OpenIssuesCount     int        `json:"open_issues_count"`
+	IsTemplate          bool       `json:"is_template"`
+	Topics              []string   `json:"topics"`
+	HasIssues           bool       `json:"has_issues"`
+	HasProjects         bool       `json:"has_projects"`
+	HasWiki             bool       `json:"has_wiki"`
+	HasPages            bool       `json:"has_pages"`
+	HasDownloads        bool       `json:"has_downloads"`
+	Archived            bool       `json:"archived"`
+	Disabled            bool       `json:"disabled"`
+	Visibility          string     `json:"visibility"`
 	PushedAt            *time.Time `json:"pushed_at"`
 	CreatedAt           *time.Time `json:"created_at"`
 	UpdatedAt           *time.Time `json:"updated_at"`
-	AllowRebaseMerge    bool      `json:"allow_rebase_merge"`
-	TemplateRepository  any       `json:"template_repository"`
-	TempCloneToken      string    `json:"temp_clone_token"`
-	AllowSquashMerge    bool      `json:"allow_squash_merge"`
-	AllowAutoMerge      bool      `json:"allow_auto_merge"`
-	DeleteBranchOnMerge bool      `json:"delete_branch_on_merge"`
-	AllowMergeCommit    bool      `json:"allow_merge_commit"`
-	SubscribersCount    int       `json:"subscribers_count"`
-	NetworkCount        int       `json:"network_count"`
+	AllowRebaseMerge    bool       `json:"allow_rebase_merge"`
+	TemplateRepository  any        `json:"template_repository"`
+	TempCloneToken      string     `json:"temp_clone_token"`
+	AllowSquashMerge    bool       `json:"allow_squash_merge"`
+	AllowAutoMerge      bool       `json:"allow_auto_merge"`
+	DeleteBranchOnMerge bool       `json:"delete_branch_on_merge"`
+	AllowMergeCommit    bool       `json:"allow_merge_commit"`
+	SubscribersCount    int        `json:"subscribers_count"`
+	NetworkCount        int        `json:"network_count"`
 	License             struct {
 		Key     string `json:"key"`
 		Name    string `json:"name"`
@@ -251,7 +251,7 @@ type GithubAppRepo struct {
 }
 
 type GithubAppRepoResult struct {
-	TotalCount   int `json:"total_count"`
+	TotalCount   int             `json:"total_count"`
 	Repositories []GithubAppRepo `json:"repositories"`
 }
 
diff --git a/backend/plugins/tapd/models/story_category.go b/backend/plugins/tapd/models/story_category.go
index 31ea0d108..b33c188a5 100644
--- a/backend/plugins/tapd/models/story_category.go
+++ b/backend/plugins/tapd/models/story_category.go
@@ -23,10 +23,10 @@ import (
 
 type TapdStoryCategory struct {
 	ConnectionId uint64          `gorm:"primaryKey"`
-	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          `json:"name" gorm:"type:varchar(255)"`
 	Description  string          `json:"description"`
-	ParentId     uint64          `json:"parent_id,string"`
+	ParentId     int64           `json:"parent_id,string"`
 	Created      *common.CSTTime `json:"created"`
 	Modified     *common.CSTTime `json:"modified"`
 	common.NoPKModel