Skip to content

Commit bf66261

Browse files
committed
Merge branch 'main' into ssh-sign
2 parents 3b406a3 + 6d41729 commit bf66261

File tree

466 files changed

+7194
-5931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

466 files changed

+7194
-5931
lines changed

.drone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ steps:
537537

538538
- name: static
539539
pull: always
540-
image: techknowlogick/xgo:go-1.16.x
540+
image: techknowlogick/xgo:go-1.17.x
541541
commands:
542542
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
543543
- export PATH=$PATH:$GOPATH/bin
@@ -633,7 +633,7 @@ steps:
633633

634634
- name: static
635635
pull: always
636-
image: techknowlogick/xgo:go-1.16.x
636+
image: techknowlogick/xgo:go-1.17.x
637637
commands:
638638
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
639639
- export PATH=$PATH:$GOPATH/bin

.eslintrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ignorePatterns:
66

77
parserOptions:
88
sourceType: module
9-
ecmaVersion: 2021
9+
ecmaVersion: latest
1010

1111
plugins:
1212
- eslint-plugin-unicorn
@@ -109,7 +109,7 @@ rules:
109109
github/no-implicit-buggy-globals: [0]
110110
github/no-inner-html: [0]
111111
github/no-innerText: [2]
112-
github/no-then: [2]
112+
github/no-then: [0]
113113
github/no-useless-passive: [2]
114114
github/prefer-observers: [0]
115115
github/require-passive-events: [2]
@@ -384,6 +384,7 @@ rules:
384384
unicorn/no-array-instanceof: [0]
385385
unicorn/no-array-method-this-argument: [2]
386386
unicorn/no-array-push-push: [2]
387+
unicorn/no-await-expression-member: [0]
387388
unicorn/no-console-spaces: [0]
388389
unicorn/no-document-cookie: [2]
389390
unicorn/no-empty-file: [2]
@@ -419,6 +420,7 @@ rules:
419420
unicorn/prefer-array-index-of: [2]
420421
unicorn/prefer-array-some: [2]
421422
unicorn/prefer-at: [0]
423+
unicorn/prefer-code-point: [2]
422424
unicorn/prefer-dataset: [2]
423425
unicorn/prefer-date-now: [2]
424426
unicorn/prefer-default-parameters: [0]

build/generate-images.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ async function main() {
8080
]);
8181
}
8282

83-
main().then(exit).catch(exit); // eslint-disable-line github/no-then
83+
main().then(exit).catch(exit);
8484

build/generate-svg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ async function main() {
5454
]);
5555
}
5656

57-
main().then(exit).catch(exit); // eslint-disable-line github/no-then
57+
main().then(exit).catch(exit);
5858

cmd/admin.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"text/tabwriter"
1515

1616
"code.gitea.io/gitea/models"
17+
asymkey_model "code.gitea.io/gitea/models/asymkey"
1718
"code.gitea.io/gitea/models/db"
1819
"code.gitea.io/gitea/models/login"
1920
user_model "code.gitea.io/gitea/models/user"
@@ -625,7 +626,7 @@ func runRegenerateKeys(_ *cli.Context) error {
625626
if err := initDB(ctx); err != nil {
626627
return err
627628
}
628-
return models.RewriteAllPublicKeys()
629+
return asymkey_model.RewriteAllPublicKeys()
629630
}
630631

631632
func parseOAuth2Config(c *cli.Context) *oauth2.Source {

cmd/migrate_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func migrateAvatars(dstStorage storage.ObjectStorage) error {
102102
}
103103

104104
func migrateRepoAvatars(dstStorage storage.ObjectStorage) error {
105-
return models.IterateRepository(func(repo *models.Repository) error {
105+
return models.IterateRepository(func(repo *repo_model.Repository) error {
106106
_, err := storage.Copy(dstStorage, repo.CustomAvatarRelativePath(), storage.RepoAvatars, repo.CustomAvatarRelativePath())
107107
return err
108108
})

cmd/serv.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"time"
1818

1919
"code.gitea.io/gitea/models"
20+
asymkey_model "code.gitea.io/gitea/models/asymkey"
2021
"code.gitea.io/gitea/models/perm"
2122
"code.gitea.io/gitea/modules/git"
2223
"code.gitea.io/gitea/modules/json"
@@ -129,9 +130,9 @@ func runServ(c *cli.Context) error {
129130
return fail("Internal error", "Failed to check provided key: %v", err)
130131
}
131132
switch key.Type {
132-
case models.KeyTypeDeploy:
133+
case asymkey_model.KeyTypeDeploy:
133134
println("Hi there! You've successfully authenticated with the deploy key named " + key.Name + ", but Gitea does not provide shell access.")
134-
case models.KeyTypePrincipal:
135+
case asymkey_model.KeyTypePrincipal:
135136
println("Hi there! You've successfully authenticated with the principal " + key.Content + ", but Gitea does not provide shell access.")
136137
default:
137138
println("Hi there, " + user.Name + "! You've successfully authenticated with the key named " + key.Name + ", but Gitea does not provide shell access.")

cmd/web.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func setPort(port string) error {
180180
setting.HTTPPort = port
181181

182182
switch setting.Protocol {
183-
case setting.UnixSocket:
183+
case setting.HTTPUnix:
184184
case setting.FCGI:
185185
case setting.FCGIUnix:
186186
default:
@@ -202,7 +202,7 @@ func setPort(port string) error {
202202

203203
func listen(m http.Handler, handleRedirector bool) error {
204204
listenAddr := setting.HTTPAddr
205-
if setting.Protocol != setting.UnixSocket && setting.Protocol != setting.FCGIUnix {
205+
if setting.Protocol != setting.HTTPUnix && setting.Protocol != setting.FCGIUnix {
206206
listenAddr = net.JoinHostPort(listenAddr, setting.HTTPPort)
207207
}
208208
log.Info("Listen: %v://%s%s", setting.Protocol, listenAddr, setting.AppSubURL)
@@ -240,7 +240,7 @@ func listen(m http.Handler, handleRedirector bool) error {
240240
NoHTTPRedirector()
241241
}
242242
err = runFCGI("tcp", listenAddr, "FCGI Web", m)
243-
case setting.UnixSocket:
243+
case setting.HTTPUnix:
244244
if handleRedirector {
245245
NoHTTPRedirector()
246246
}

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
233233

234234
## Server (`server`)
235235

236-
- `PROTOCOL`: **http**: \[http, https, fcgi, unix, fcgi+unix\]
236+
- `PROTOCOL`: **http**: \[http, https, fcgi, http+unix, fcgi+unix\]
237237
- `DOMAIN`: **localhost**: Domain name of this server.
238238
- `ROOT_URL`: **%(PROTOCOL)s://%(DOMAIN)s:%(HTTP\_PORT)s/**:
239239
Overwrite the automatically generated public URL.
@@ -248,7 +248,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
248248
- `HTTP_ADDR`: **0.0.0.0**: HTTP listen address.
249249
- If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket
250250
defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
251-
- If `PROTOCOL` is set to `unix` or `fcgi+unix`, this should be the name of the Unix socket file to use. Relative paths will be made absolute against the AppWorkPath.
251+
- If `PROTOCOL` is set to `http+unix` or `fcgi+unix`, this should be the name of the Unix socket file to use. Relative paths will be made absolute against the AppWorkPath.
252252
- `HTTP_PORT`: **3000**: HTTP listen port.
253253
- If `PROTOCOL` is set to `fcgi`, Gitea will listen for FastCGI requests on TCP socket
254254
defined by `HTTP_ADDR` and `HTTP_PORT` configuration settings.
@@ -257,7 +257,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
257257
(DMZ) URL for Gitea workers (such as SSH update) accessing web service. In
258258
most cases you do not need to change the default value. Alter it only if
259259
your SSH server node is not the same as HTTP node. Do not set this variable
260-
if `PROTOCOL` is set to `unix`.
260+
if `PROTOCOL` is set to `http+unix`.
261261
- `PER_WRITE_TIMEOUT`: **30s**: Timeout for any write to the connection. (Set to 0 to
262262
disable all timeouts.)
263263
- `PER_WRITE_PER_KB_TIMEOUT`: **10s**: Timeout per Kb written to connections.
@@ -277,7 +277,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
277277
- `SSH_AUTHORIZED_PRINCIPALS_ALLOW`: **off** or **username, email**: \[off, username, email, anything\]: Specify the principals values that users are allowed to use as principal. When set to `anything` no checks are done on the principal string. When set to `off` authorized principal are not allowed to be set.
278278
- `SSH_CREATE_AUTHORIZED_PRINCIPALS_FILE`: **false/true**: Gitea will create a authorized_principals file by default when it is not using the internal ssh server and `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
279279
- `SSH_AUTHORIZED_PRINCIPALS_BACKUP`: **false/true**: Enable SSH Authorized Principals Backup when rewriting all keys, default is true if `SSH_AUTHORIZED_PRINCIPALS_ALLOW` is not `off`.
280-
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models.PublicKey` and the others are strings which are shellquoted.
280+
- `SSH_AUTHORIZED_KEYS_COMMAND_TEMPLATE`: **{{.AppPath}} --config={{.CustomConf}} serv key-{{.Key.ID}}**: Set the template for the command to passed on authorized keys. Possible keys are: AppPath, AppWorkPath, CustomConf, CustomPath, Key - where Key is a `models/asymkey.PublicKey` and the others are strings which are shellquoted.
281281
- `SSH_SERVER_CIPHERS`: **aes128-ctr, aes192-ctr, aes256-ctr, [email protected], arcfour256, arcfour128**: For the built-in SSH server, choose the ciphers to support for SSH connections, for system SSH this setting has no effect.
282282
- `SSH_SERVER_KEY_EXCHANGES`: **diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, [email protected]**: For the built-in SSH server, choose the key exchange algorithms to support for SSH connections, for system SSH this setting has no effect.
283283
- `SSH_SERVER_MACS`: **[email protected], hmac-sha2-256, hmac-sha1, hmac-sha1-96**: For the built-in SSH server, choose the MACs to support for SSH connections, for system SSH this setting has no effect

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ menu:
8484

8585
## Database (`database`)
8686

87-
- `DB_TYPE`: 数据库类型,可选 `mysql`, `postgres`, `mssql`, `tidb``sqlite3`
87+
- `DB_TYPE`: 数据库类型,可选 `mysql`, `postgres`, `mssql``sqlite3`
8888
- `HOST`: 数据库服务器地址和端口。
8989
- `NAME`: 数据库名称。
9090
- `USER`: 数据库用户名。
9191
- `PASSWD`: 数据库用户密码。
9292
- `SSL_MODE`: MySQL 或 PostgreSQL数据库是否启用SSL模式。
9393
- `CHARSET`: **utf8mb4**: 仅当数据库为 MySQL 时有效, 可以为 "utf8" 或 "utf8mb4"。注意:如果使用 "utf8mb4",你的 MySQL InnoDB 版本必须在 5.6 以上。
94-
- `PATH`: Tidb 或者 SQLite3 数据文件存放路径。
94+
- `PATH`: SQLite3 数据文件存放路径。
9595
- `LOG_SQL`: **true**: 显示生成的SQL,默认为真。
9696
- `MAX_IDLE_CONNS` **0**: 最大空闲数据库连接
9797
- `CONN_MAX_LIFETIME` **3s**: 数据库连接最大存活时间

docs/content/doc/help/seek-help.en-us.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,23 @@ menu:
2222

2323
1. Your `app.ini` (with any sensitive data scrubbed as necessary)
2424
2. The `gitea.log` (and any other appropriate log files for the situation)
25-
* e.g. If the error is related to the database, the `xorm.log` might be helpful
25+
* e.g. If the error is related to the database, the `xorm.log` might be helpful
2626
3. Any error messages you are seeing
2727
4. When possible, try to replicate the issue on [try.gitea.io](https://try.gitea.io) and include steps so that others can reproduce the issue.
28-
* This will greatly improve the chance that the root of the issue can be quickly discovered and resolved.
28+
* This will greatly improve the chance that the root of the issue can be quickly discovered and resolved.
29+
5. If you meet slow/hanging/deadlock problems, please report the stack trace when the problem occurs:
30+
1. Enable pprof in `app.ini` and restart Gitea
31+
```
32+
[server]
33+
ENABLE_PPROF = true
34+
```
35+
2. Trigger the bug, when Gitea gets stuck, use curl or browser to visit: `http://127.0.0.1:6060/debug/pprof/goroutine?debug=1` (IP is `127.0.0.1` and port is `6060`)
36+
3. Report the output (the stack trace doesn't contain sensitive data)
2937
3038
## Bugs
3139
3240
If you found a bug, please create an [issue on GitHub](https://github.com/go-gitea/gitea/issues).
3341
3442
## Chinese Support
3543
36-
Support for the Chinese language is provided at [Our discourse](https://discourse.gitea.io/c/5-category/5).
44+
Support for the Chinese language is provided at [Our discourse](https://discourse.gitea.io/c/5-category/5) or QQ Group 328432459.

docs/content/doc/help/seek-help.zh-cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ menu:
1717

1818
如果您在使用或者开发过程中遇到问题,请到以下渠道咨询:
1919

20-
-[Github issue](https://github.com/go-gitea/gitea/issues)提问(因为项目维护人员来自世界各地,为保证沟通顺畅,请使用英文提问)
21-
- 中文问题到 [Gitea 论坛](https://discourse.gitea.io/c/5-category/5)提问
22-
- 访问 [Discord server - 英文](https://discord.gg/Gitea)
20+
- [GitHub Issue](https://github.com/go-gitea/gitea/issues) 提问(因为项目维护人员来自世界各地,为保证沟通顺畅,请使用英文提问)
21+
- 中文问题到 [Gitea 论坛](https://discourse.gitea.io/c/5-category/5) 提问
22+
- 访问 [Discord Gitea 聊天室 - 英文](https://discord.gg/Gitea)
2323
- 加入 QQ群 328432459 获得进一步的支持

docs/content/doc/help/seek-help.zh-tw.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ menu:
2222

2323
1. 您的 `app.ini` (必要時清除掉任何機密資訊)
2424
2. `gitea.log` (以及任何有關的日誌檔案)
25-
* 例:如果錯誤和資料庫相關,提供 `xorm.log` 可能會有幫助
25+
* 例:如果錯誤和資料庫相關,提供 `xorm.log` 可能會有幫助
2626
3. 您看到的任何錯誤訊息
27-
5. 儘可能地在 [try.gitea.io](https://try.gitea.io) 觸發您的問題並記下步驟,以便其他人能重現那個問題。
28-
* 這將讓我們更有機會快速地找出問題的根源並解決它。
27+
4. 儘可能地在 [try.gitea.io](https://try.gitea.io) 觸發您的問題並記下步驟,以便其他人能重現那個問題。
28+
* 這將讓我們更有機會快速地找出問題的根源並解決它。
29+
5. 堆棧跟踪,[請參考英文文檔](https://docs.gitea.io/en-us/seek-help/)
2930

3031
## 錯誤回報
31-
如果您發現錯誤,請到 [Github 的 Issue](https://github.com/go-gitea/gitea/issues) 回報。
32+
33+
如果您發現錯誤,請到 [GitHub 的 Issue](https://github.com/go-gitea/gitea/issues) 回報。

docs/content/page/index.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Windows, on architectures like amd64, i386, ARM, PowerPC, and others.
7373
- PostgreSQL (>=10)
7474
- SQLite3
7575
- MSSQL (>=2008R2 SP3)
76-
- TiDB (experimental, not recommended)
76+
- TiDB (MySQL protocol)
7777
- Configuration file
7878
- [app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
7979
- Admin panel

docs/content/page/index.fr-fr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Le but de ce projet est de fournir de la manière la plus simple, la plus rapide
6868
- PostgreSQL
6969
- SQLite3
7070
- MSSQL
71-
- [TiDB](https://github.com/pingcap/tidb) (expérimental)
71+
- [TiDB](https://github.com/pingcap/tidb) (MySQL protocol)
7272
- Fichier de configuration
7373
- Voir [ici](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
7474
- Panel d'administration

docs/content/page/index.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Gitea的首要目标是创建一个极易安装,运行非常快速,安装和
3232
- 支持自定义源的 Gravatar 和 Federated Avatar
3333
- 支持邮件服务
3434
- 支持后台管理面板
35-
- 支持 MySQL、PostgreSQL、SQLite3, MSSQL 和 TiDB(实验性支持) 数据库
35+
- 支持 MySQL、PostgreSQL、SQLite3MSSQL 和 TiDB(MySQL) 数据库
3636
- 支持多语言本地化(21 种语言)
3737

3838
## 系统要求

docs/content/page/index.zh-tw.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Gitea 是從 [Gogs](http://gogs.io) Fork 出來的,請閱讀部落格文章 [G
6969
- PostgreSQL
7070
- SQLite3
7171
- MSSQL
72-
- TiDB(實驗中, 不建議使用
72+
- TiDB(MySQL 協議
7373
- 設定檔
7474
- [app.ini](https://github.com/go-gitea/gitea/blob/master/custom/conf/app.example.ini)
7575
- 管理員面板

integrations/api_admin_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"net/http"
1010
"testing"
1111

12-
"code.gitea.io/gitea/models"
12+
asymkey_model "code.gitea.io/gitea/models/asymkey"
1313
"code.gitea.io/gitea/models/unittest"
1414
user_model "code.gitea.io/gitea/models/user"
1515
"code.gitea.io/gitea/modules/json"
@@ -34,7 +34,7 @@ func TestAPIAdminCreateAndDeleteSSHKey(t *testing.T) {
3434

3535
var newPublicKey api.PublicKey
3636
DecodeJSON(t, resp, &newPublicKey)
37-
unittest.AssertExistsAndLoadBean(t, &models.PublicKey{
37+
unittest.AssertExistsAndLoadBean(t, &asymkey_model.PublicKey{
3838
ID: newPublicKey.ID,
3939
Name: newPublicKey.Title,
4040
Content: newPublicKey.Key,
@@ -45,7 +45,7 @@ func TestAPIAdminCreateAndDeleteSSHKey(t *testing.T) {
4545
req = NewRequestf(t, "DELETE", "/api/v1/admin/users/%s/keys/%d?token=%s",
4646
keyOwner.Name, newPublicKey.ID, token)
4747
session.MakeRequest(t, req, http.StatusNoContent)
48-
unittest.AssertNotExistsBean(t, &models.PublicKey{ID: newPublicKey.ID})
48+
unittest.AssertNotExistsBean(t, &asymkey_model.PublicKey{ID: newPublicKey.ID})
4949
}
5050

5151
func TestAPIAdminDeleteMissingSSHKey(t *testing.T) {

integrations/api_comment_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"testing"
1212

1313
"code.gitea.io/gitea/models"
14+
repo_model "code.gitea.io/gitea/models/repo"
1415
"code.gitea.io/gitea/models/unittest"
1516
user_model "code.gitea.io/gitea/models/user"
1617
"code.gitea.io/gitea/modules/convert"
@@ -25,7 +26,7 @@ func TestAPIListRepoComments(t *testing.T) {
2526
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
2627
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
2728
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
28-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
29+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
2930
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
3031

3132
session := loginUser(t, repoOwner.Name)
@@ -71,7 +72,7 @@ func TestAPIListIssueComments(t *testing.T) {
7172
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
7273
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
7374
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
74-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
75+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
7576
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
7677

7778
session := loginUser(t, repoOwner.Name)
@@ -91,7 +92,7 @@ func TestAPICreateComment(t *testing.T) {
9192
const commentBody = "Comment body"
9293

9394
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{}).(*models.Issue)
94-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
95+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
9596
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
9697

9798
session := loginUser(t, repoOwner.Name)
@@ -114,7 +115,7 @@ func TestAPIGetComment(t *testing.T) {
114115

115116
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{ID: 2}).(*models.Comment)
116117
assert.NoError(t, comment.LoadIssue())
117-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: comment.Issue.RepoID}).(*models.Repository)
118+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: comment.Issue.RepoID}).(*repo_model.Repository)
118119
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
119120

120121
session := loginUser(t, repoOwner.Name)
@@ -143,7 +144,7 @@ func TestAPIEditComment(t *testing.T) {
143144
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
144145
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
145146
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
146-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
147+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
147148
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
148149

149150
session := loginUser(t, repoOwner.Name)
@@ -168,7 +169,7 @@ func TestAPIDeleteComment(t *testing.T) {
168169
comment := unittest.AssertExistsAndLoadBean(t, &models.Comment{},
169170
unittest.Cond("type = ?", models.CommentTypeComment)).(*models.Comment)
170171
issue := unittest.AssertExistsAndLoadBean(t, &models.Issue{ID: comment.IssueID}).(*models.Issue)
171-
repo := unittest.AssertExistsAndLoadBean(t, &models.Repository{ID: issue.RepoID}).(*models.Repository)
172+
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: issue.RepoID}).(*repo_model.Repository)
172173
repoOwner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: repo.OwnerID}).(*user_model.User)
173174

174175
session := loginUser(t, repoOwner.Name)

0 commit comments

Comments
 (0)