Skip to content

Commit 6f55d1e

Browse files
committed
Merge branch 'master' of github.com:go-gitea/gitea
2 parents b563158 + a8c0240 commit 6f55d1e

File tree

9 files changed

+144
-69
lines changed

9 files changed

+144
-69
lines changed

Makefile

Lines changed: 87 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -204,94 +204,140 @@ test-sqlite\#%: integrations.sqlite.test
204204
test-sqlite-migration: migrations.sqlite.test
205205
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./migrations.sqlite.test
206206

207-
generate-ini:
207+
generate-ini-mysql:
208208
sed -e 's|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \
209209
-e 's|{{TEST_MYSQL_DBNAME}}|${TEST_MYSQL_DBNAME}|g' \
210210
-e 's|{{TEST_MYSQL_USERNAME}}|${TEST_MYSQL_USERNAME}|g' \
211211
-e 's|{{TEST_MYSQL_PASSWORD}}|${TEST_MYSQL_PASSWORD}|g' \
212212
integrations/mysql.ini.tmpl > integrations/mysql.ini
213+
214+
.PHONY: test-mysql
215+
test-mysql: integrations.mysql.test generate-ini-mysql
216+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test
217+
218+
.PHONY: test-mysql\#%
219+
test-mysql\#%: integrations.mysql.test generate-ini-mysql
220+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.run $*
221+
222+
.PHONY: test-mysql-migration
223+
test-mysql-migration: migrations.mysql.test generate-ini-mysql
224+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./migrations.mysql.test
225+
226+
227+
generate-ini-mysql8:
213228
sed -e 's|{{TEST_MYSQL8_HOST}}|${TEST_MYSQL8_HOST}|g' \
214229
-e 's|{{TEST_MYSQL8_DBNAME}}|${TEST_MYSQL8_DBNAME}|g' \
215230
-e 's|{{TEST_MYSQL8_USERNAME}}|${TEST_MYSQL8_USERNAME}|g' \
216231
-e 's|{{TEST_MYSQL8_PASSWORD}}|${TEST_MYSQL8_PASSWORD}|g' \
217232
integrations/mysql8.ini.tmpl > integrations/mysql8.ini
233+
234+
.PHONY: test-mysql8
235+
test-mysql8: integrations.mysql8.test generate-ini-mysql8
236+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./integrations.mysql8.test
237+
238+
.PHONY: test-mysql8\#%
239+
test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8
240+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./integrations.mysql8.test -test.run $*
241+
242+
.PHONY: test-mysql8-migration
243+
test-mysql8-migration: migrations.mysql8.test generate-ini-mysql8
244+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./migrations.mysql8.test
245+
246+
247+
generate-ini-pgsql:
218248
sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
219249
-e 's|{{TEST_PGSQL_DBNAME}}|${TEST_PGSQL_DBNAME}|g' \
220250
-e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
221251
-e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
222252
integrations/pgsql.ini.tmpl > integrations/pgsql.ini
223-
sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \
224-
-e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
225-
-e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
226-
-e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
227-
integrations/mssql.ini.tmpl > integrations/mssql.ini
228-
229-
.PHONY: test-mysql
230-
test-mysql: integrations.test generate-ini
231-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test
232253

233-
.PHONY: test-mysql-migration
234-
test-mysql-migration: migrations.test generate-ini
235-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./migrations.test
254+
.PHONY: test-pgsql
255+
test-pgsql: integrations.pgsql.test generate-ini-pgsql
256+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test
236257

237-
.PHONY: test-mysql8
238-
test-mysql8: integrations.test generate-ini
239-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./integrations.test
258+
.PHONY: test-pgsql\#%
259+
test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql
260+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.run $*
240261

241-
.PHONY: test-mysql8-migration
242-
test-mysql8-migration: migrations.test generate-ini
243-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./migrations.test
262+
.PHONY: test-pgsql-migration
263+
test-pgsql-migration: migrations.pgsql.test generate-ini-pgsql
264+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./migrations.pgsql.test
244265

245-
.PHONY: test-pgsql
246-
test-pgsql: integrations.test generate-ini
247-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test
248266

249-
.PHONY: test-pgsql-migration
250-
test-pgsql-migration: migrations.test generate-ini
251-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./migrations.test
267+
generate-ini-mssql:
268+
sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \
269+
-e 's|{{TEST_MSSQL_DBNAME}}|${TEST_MSSQL_DBNAME}|g' \
270+
-e 's|{{TEST_MSSQL_USERNAME}}|${TEST_MSSQL_USERNAME}|g' \
271+
-e 's|{{TEST_MSSQL_PASSWORD}}|${TEST_MSSQL_PASSWORD}|g' \
272+
integrations/mssql.ini.tmpl > integrations/mssql.ini
252273

253274
.PHONY: test-mssql
254-
test-mssql: integrations.test generate-ini
255-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.test
275+
test-mssql: integrations.mssql.test generate-ini-mssql
276+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test
277+
278+
.PHONY: test-mssql\#%
279+
test-mssql\#%: integrations.mssql.test generate-ini-mssql
280+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test -test.run $*
256281

257282
.PHONY: test-mssql-migration
258-
test-mssql-migration: migrations.test generate-ini
259-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./migrations.test
283+
test-mssql-migration: migrations.mssql.test generate-ini-mssql
284+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./migrations.mssql.test
260285

261286

262287
.PHONY: bench-sqlite
263288
bench-sqlite: integrations.sqlite.test
264289
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
265290

266291
.PHONY: bench-mysql
267-
bench-mysql: integrations.test generate-ini
268-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
292+
bench-mysql: integrations.mysql.test generate-ini-mysql
293+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
269294

270295
.PHONY: bench-mssql
271-
bench-mssql: integrations.test generate-ini
272-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
296+
bench-mssql: integrations.mssql.test generate-ini-mssql
297+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
273298

274299
.PHONY: bench-pgsql
275-
bench-pgsql: integrations.test generate-ini
276-
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
300+
bench-pgsql: integrations.pgsql.test generate-ini-pgsql
301+
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.cpuprofile=cpu.out -test.run DontRunTests -test.bench .
277302

278303

279304
.PHONY: integration-test-coverage
280-
integration-test-coverage: integrations.cover.test generate-ini
305+
integration-test-coverage: integrations.cover.test generate-ini-mysql
281306
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
282307

283-
integrations.test: $(SOURCES)
284-
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.test
308+
integrations.mysql.test: $(SOURCES)
309+
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql.test
310+
311+
integrations.mysql8.test: $(SOURCES)
312+
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mysql8.test
313+
314+
integrations.pgsql.test: $(SOURCES)
315+
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.pgsql.test
316+
317+
integrations.mssql.test: $(SOURCES)
318+
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.mssql.test
285319

286320
integrations.sqlite.test: $(SOURCES)
287321
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
288322

289323
integrations.cover.test: $(SOURCES)
290324
GO111MODULE=on $(GO) test -mod=vendor -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES) | tr ' ' ',') -o integrations.cover.test
291325

292-
.PHONY: migrations.test
293-
migrations.test: $(SOURCES)
294-
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.test
326+
.PHONY: migrations.mysql.test
327+
migrations.mysql.test: $(SOURCES)
328+
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql.test
329+
330+
.PHONY: migrations.mysql8.test
331+
migrations.mysql8.test: $(SOURCES)
332+
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mysql8.test
333+
334+
.PHONY: migrations.pgsql.test
335+
migrations.pgsql.test: $(SOURCES)
336+
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.pgsql.test
337+
338+
.PHONY: migrations.mssql.test
339+
migrations.mssql.test: $(SOURCES)
340+
$(GO) test -c code.gitea.io/gitea/integrations/migration-test -o migrations.mssql.test
295341

296342
.PHONY: migrations.sqlite.test
297343
migrations.sqlite.test: $(SOURCES)

integrations/README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,45 @@ make test-sqlite
2727
## Run mysql integrations tests
2828
Setup a mysql database inside docker
2929
```
30-
docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" --rm --name mysql mysql:5.7 #(just ctrl-c to stop db and clean the container)
30+
docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" -p 3306:3306 --rm --name mysql mysql:5.7 #(just ctrl-c to stop db and clean the container)
3131
```
3232
Start tests based on the database container
3333
```
34-
TEST_MYSQL_HOST="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql):3306" TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-mysql
34+
TEST_MYSQL_HOST=localhost:3306 TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-mysql
3535
```
3636

3737
## Run pgsql integrations tests
3838
Setup a pgsql database inside docker
3939
```
40-
docker run -e "POSTGRES_DB=test" --rm --name pgsql postgres:9.5 #(just ctrl-c to stop db and clean the container)
40+
docker run -e "POSTGRES_DB=test" -p 5432:5432 --rm --name pgsql postgres:9.5 #(just ctrl-c to stop db and clean the container)
4141
```
4242
Start tests based on the database container
4343
```
44-
TEST_PGSQL_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgsql) TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
44+
TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
45+
```
46+
47+
## Run mssql integrations tests
48+
Setup a mssql database inside docker
49+
```
50+
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container)
51+
```
52+
Start tests based on the database container
53+
```
54+
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=gitea_test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql
4555
```
4656

4757
## Running individual tests
4858

49-
Example command to run GPG test with sqlite backend:
59+
Example command to run GPG test:
60+
61+
For sqlite:
62+
5063
```
51-
go test -c code.gitea.io/gitea/integrations \
52-
-o integrations.sqlite.test -tags 'sqlite' &&
53-
GITEA_ROOT="$GOPATH/src/code.gitea.io/gitea" \
54-
GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test \
55-
-test.v -test.run GPG
64+
make test-sqlite#GPG
5665
```
5766

67+
For other databases(replace MSSQL to MYSQL, MYSQL8, PGSQL):
68+
69+
```
70+
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG
71+
```

integrations/README_ZH.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,46 @@ make test-sqlite
2626
## 如何使用 mysql 数据库进行集成测试
2727
首先在docker容器里部署一个 mysql 数据库
2828
```
29-
docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" --rm --name mysql mysql:5.7 #(just ctrl-c to stop db and clean the container)
29+
docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" -p 3306:3306 --rm --name mysql mysql:5.7 #(just ctrl-c to stop db and clean the container)
3030
```
3131
之后便可以基于这个数据库进行集成测试
3232
```
33-
TEST_MYSQL_HOST="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql):3306" TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-mysql
33+
TEST_MYSQL_HOST=localhost:3306 TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-mysql
3434
```
3535

3636
## 如何使用 pgsql 数据库进行集成测试
3737
同上,首先在 docker 容器里部署一个 pgsql 数据库
3838
```
39-
docker run -e "POSTGRES_DB=test" --rm --name pgsql postgres:9.5 #(just ctrl-c to stop db and clean the container)
39+
docker run -e "POSTGRES_DB=test" -p 5432:5432 --rm --name pgsql postgres:9.5 #(just ctrl-c to stop db and clean the container)
4040
```
4141
之后便可以基于这个数据库进行集成测试
4242
```
43-
TEST_PGSQL_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgsql) TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
43+
TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
44+
```
45+
46+
## Run mssql integrations tests
47+
同上,首先在 docker 容器里部署一个 mssql 数据库
48+
```
49+
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container)
50+
```
51+
之后便可以基于这个数据库进行集成测试
52+
```
53+
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=gitea_test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql
4454
```
4555

4656
## 如何进行自定义的集成测试
4757

48-
下面的示例展示了怎样基于 sqlite 数据库进行 GPG 测试:
58+
下面的示例展示了怎样在集成测试中只进行 GPG 测试:
59+
60+
sqlite 数据库:
61+
62+
```
63+
make test-sqlite#GPG
64+
```
65+
66+
其它数据库(把 MSSQL 替换为 MYSQL, MYSQL8, PGSQL):
67+
4968
```
50-
go test -c code.gitea.io/gitea/integrations \
51-
-o integrations.sqlite.test -tags 'sqlite' &&
52-
GITEA_ROOT="$GOPATH/src/code.gitea.io/gitea" \
53-
GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test \
54-
-test.v -test.run GPG
69+
TEST_MSSQL_HOST=localhost:1433 TEST_MSSQL_DBNAME=test TEST_MSSQL_USERNAME=sa TEST_MSSQL_PASSWORD=MwantsaSecurePassword1 make test-mssql#GPG
5570
```
5671

integrations/integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func initIntegrationTest() {
131131
if err != nil {
132132
log.Fatalf("sql.Open: %v", err)
133133
}
134-
if _, err = db.Exec("CREATE DATABASE IF NOT EXISTS testgitea"); err != nil {
134+
if _, err = db.Exec(fmt.Sprintf("CREATE DATABASE IF NOT EXISTS %s", setting.Database.Name)); err != nil {
135135
log.Fatalf("db.Exec: %v", err)
136136
}
137137
case setting.Database.UsePostgreSQL:
@@ -150,7 +150,7 @@ func initIntegrationTest() {
150150
if rows.Next() {
151151
break
152152
}
153-
if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil {
153+
if _, err = db.Exec(fmt.Sprintf("CREATE DATABASE %s", setting.Database.Name)); err != nil {
154154
log.Fatalf("db.Exec: %v", err)
155155
}
156156
case setting.Database.UseMSSQL:
@@ -160,7 +160,7 @@ func initIntegrationTest() {
160160
if err != nil {
161161
log.Fatalf("sql.Open: %v", err)
162162
}
163-
if _, err := db.Exec("If(db_id(N'gitea') IS NULL) BEGIN CREATE DATABASE gitea; END;"); err != nil {
163+
if _, err := db.Exec(fmt.Sprintf("If(db_id(N'%s') IS NULL) BEGIN CREATE DATABASE %s; END;", setting.Database.Name, setting.Database.Name)); err != nil {
164164
log.Fatalf("db.Exec: %v", err)
165165
}
166166
defer db.Close()

integrations/mssql.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ PROVIDER_CONFIG = data/sessions-mssql
6262

6363
[log]
6464
MODE = test,file
65-
ROOT_PATH = sqlite-log
65+
ROOT_PATH = mssql-log
6666
REDIRECT_MACARON_LOG = true
6767
ROUTER = ,
6868
MACARON = ,

integrations/mysql.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ PROVIDER_CONFIG = data/sessions-mysql
6262

6363
[log]
6464
MODE = test,file
65-
ROOT_PATH = sqlite-log
65+
ROOT_PATH = mysql-log
6666
REDIRECT_MACARON_LOG = true
6767
ROUTER = ,
6868
MACARON = ,

integrations/mysql8.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ PROVIDER_CONFIG = data/sessions-mysql8
5959

6060
[log]
6161
MODE = test,file
62-
ROOT_PATH = sqlite-log
62+
ROOT_PATH = mysql8-log
6363
REDIRECT_MACARON_LOG = true
6464
ROUTER = ,
6565
MACARON = ,

integrations/pgsql.ini.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ PROVIDER_CONFIG = data/sessions-pgsql
6262

6363
[log]
6464
MODE = test,file
65-
ROOT_PATH = sqlite-log
65+
ROOT_PATH = pgsql-log
6666
REDIRECT_MACARON_LOG = true
6767
ROUTER = ,
6868
MACARON = ,

models/issue_xref.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func (issue *Issue) isValidCommentReference(e Engine, ctx *crossReferencesContex
197197
return nil, err
198198
}
199199
// Check user permissions
200-
if refIssue.Repo.ID != ctx.OrigIssue.Repo.ID {
200+
if refIssue.RepoID != ctx.OrigIssue.RepoID {
201201
perm, err := getUserRepoPermission(e, refIssue.Repo, ctx.Doer)
202202
if err != nil {
203203
return nil, err

0 commit comments

Comments
 (0)