fix(repo): limit the commit status fields returned by repo search (#40377)

The web repo search response embedded the whole commit status model
although the dashboard only uses its state and target URL. It now
returns just those two fields.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
bircniandwxiaoguang authored and GitHub committed 2026-11-15 11:27:05 +00:00
1 parent 2b30d077b8
commit 0a66642da0
5 files changed
+74 -11

No files matched your search

+2 -2
View File
@@ -39,7 +39,7 @@ type CommitStatus struct {
RepoID int64 `xorm:"UNIQUE(repo_sha_index)"`
SHA string `xorm:"VARCHAR(64) NOT NULL INDEX UNIQUE(repo_sha_index)"`
Index int64 `xorm:"INDEX UNIQUE(repo_sha_index)"`
Repo *repo_model.Repository `xorm:"-"`
Repo *repo_model.Repository `xorm:"-" json:"-"`
State commitstatus.CommitStatusState `xorm:"VARCHAR(7) NOT NULL"`
// TargetURL points to the commit status page reported by a CI system
@@ -49,7 +49,7 @@ type CommitStatus struct {
Description string `xorm:"TEXT"`
ContextHash string `xorm:"VARCHAR(64) index"`
Context string `xorm:"TEXT"`
Creator *user_model.User `xorm:"-"`
Creator *user_model.User `xorm:"-" json:"-"`
CreatorID int64
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`