Skip to content

Commit afa2c2a

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix issue overview for teams (go-gitea#19652) Fix nodeinfo caching and prevent NPE if cache non-existent (go-gitea#19721) Update go-chi/cache to utilize Ping() (go-gitea#19719) Disable blank issues (go-gitea#19717) clarify what session provider 'db' does (go-gitea#19713) [skip ci] Updated translations via Crowdin
2 parents 79092b0 + 71ca131 commit afa2c2a

File tree

25 files changed

+174
-85
lines changed

25 files changed

+174
-85
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
blank_issues_enabled: true
1+
blank_issues_enabled: false
22
contact_links:
33
- name: Security Concern
44
url: https://tinyurl.com/security-gitea

custom/conf/app.example.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,8 @@ PATH =
16081608
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16091609
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16101610
;;
1611-
;; Either "memory", "file", or "redis", default is "memory"
1611+
;; Either "memory", "file", "redis", "db", "mysql", "couchbase", "memcache" or "postgres"
1612+
;; Default is "memory". "db" will reuse the configuration in [database]
16121613
;PROVIDER = memory
16131614
;;
16141615
;; Provider config options

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
697697

698698
## Session (`session`)
699699

700-
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, db, mysql, couchbase, memcache, postgres\].
700+
- `PROVIDER`: **memory**: Session engine provider \[memory, file, redis, db, mysql, couchbase, memcache, postgres\]. Setting `db` will reuse the configuration in `[database]`
701701
- `PROVIDER_CONFIG`: **data/sessions**: For file, the root path; for db, empty (database config will be used); for others, the connection string.
702702
- `COOKIE_SECURE`: **false**: Enable this to force using HTTPS for all session access.
703703
- `COOKIE_NAME`: **i\_like\_gitea**: The name of the cookie used for the session ID.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
code.gitea.io/gitea-vet v0.2.2-0.20220122151748-48ebc902541b
77
code.gitea.io/sdk/gitea v0.15.1
88
gitea.com/go-chi/binding v0.0.0-20220309004920-114340dabecb
9-
gitea.com/go-chi/cache v0.0.0-20211201020628-dcb774c4ffea
9+
gitea.com/go-chi/cache v0.2.0
1010
gitea.com/go-chi/captcha v0.0.0-20211013065431-70641c1a35d5
1111
gitea.com/go-chi/session v0.0.0-20211218221615-e3605d8b28b8
1212
gitea.com/lunny/levelqueue v0.4.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
7272
gitea.com/go-chi/binding v0.0.0-20220309004920-114340dabecb h1:Yy0Bxzc8R2wxiwXoG/rECGplJUSpXqCsog9PuJFgiHs=
7373
gitea.com/go-chi/binding v0.0.0-20220309004920-114340dabecb/go.mod h1:77TZu701zMXWJFvB8gvTbQ92zQ3DQq/H7l5wAEjQRKc=
7474
gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e/go.mod h1:k2V/gPDEtXGjjMGuBJiapffAXTv76H4snSmlJRLUhH0=
75-
gitea.com/go-chi/cache v0.0.0-20211201020628-dcb774c4ffea h1:Fq/f4hjigb5v5WpA5TfBCZOSavpHPBiB4Wkj/WsITYM=
76-
gitea.com/go-chi/cache v0.0.0-20211201020628-dcb774c4ffea/go.mod h1:k2V/gPDEtXGjjMGuBJiapffAXTv76H4snSmlJRLUhH0=
75+
gitea.com/go-chi/cache v0.2.0 h1:E0npuTfDW6CT1yD8NMDVc1SK6IeRjfmRL2zlEsCEd7w=
76+
gitea.com/go-chi/cache v0.2.0/go.mod h1:iQlVK2aKTZ/rE9UcHyz9pQWGvdP9i1eI2spOpzgCrtE=
7777
gitea.com/go-chi/captcha v0.0.0-20211013065431-70641c1a35d5 h1:J/1i8u40TbcLP/w2w2KCkgW2PelIqYkD5UOwu8IOvVU=
7878
gitea.com/go-chi/captcha v0.0.0-20211013065431-70641c1a35d5/go.mod h1:hQ9SYHKdOX968wJglb/NMQ+UqpOKwW4L+EYdvkWjHSo=
7979
gitea.com/go-chi/session v0.0.0-20211218221615-e3605d8b28b8 h1:tJQRXgZigkLeeW9LPlps9G9aMoE6LAmqigLA+wxmd1Q=

integrations/api_issue_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,22 +209,22 @@ func TestAPISearchIssues(t *testing.T) {
209209
req = NewRequest(t, "GET", link.String())
210210
resp = MakeRequest(t, req, http.StatusOK)
211211
DecodeJSON(t, resp, &apiIssues)
212-
assert.EqualValues(t, "15", resp.Header().Get("X-Total-Count"))
212+
assert.EqualValues(t, "17", resp.Header().Get("X-Total-Count"))
213213
assert.Len(t, apiIssues, 10) // there are more but 10 is page item limit
214214

215215
query.Add("limit", "20")
216216
link.RawQuery = query.Encode()
217217
req = NewRequest(t, "GET", link.String())
218218
resp = MakeRequest(t, req, http.StatusOK)
219219
DecodeJSON(t, resp, &apiIssues)
220-
assert.Len(t, apiIssues, 15)
220+
assert.Len(t, apiIssues, 17)
221221

222222
query = url.Values{"assigned": {"true"}, "state": {"all"}, "token": {token}}
223223
link.RawQuery = query.Encode()
224224
req = NewRequest(t, "GET", link.String())
225225
resp = MakeRequest(t, req, http.StatusOK)
226226
DecodeJSON(t, resp, &apiIssues)
227-
assert.Len(t, apiIssues, 1)
227+
assert.Len(t, apiIssues, 2)
228228

229229
query = url.Values{"milestones": {"milestone1"}, "state": {"all"}, "token": {token}}
230230
link.RawQuery = query.Encode()
@@ -252,7 +252,7 @@ func TestAPISearchIssues(t *testing.T) {
252252
req = NewRequest(t, "GET", link.String())
253253
resp = MakeRequest(t, req, http.StatusOK)
254254
DecodeJSON(t, resp, &apiIssues)
255-
assert.Len(t, apiIssues, 3)
255+
assert.Len(t, apiIssues, 5)
256256

257257
query = url.Values{"owner": {"user3"}, "team": {"team1"}, "token": {token}} // organization + team
258258
link.RawQuery = query.Encode()

integrations/api_nodeinfo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestNodeinfo(t *testing.T) {
2929
assert.True(t, nodeinfo.OpenRegistrations)
3030
assert.Equal(t, "gitea", nodeinfo.Software.Name)
3131
assert.Equal(t, 23, nodeinfo.Usage.Users.Total)
32-
assert.Equal(t, 15, nodeinfo.Usage.LocalPosts)
32+
assert.Equal(t, 17, nodeinfo.Usage.LocalPosts)
3333
assert.Equal(t, 2, nodeinfo.Usage.LocalComments)
3434
})
3535
}

integrations/issue_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,22 +392,22 @@ func TestSearchIssues(t *testing.T) {
392392
req = NewRequest(t, "GET", link.String())
393393
resp = session.MakeRequest(t, req, http.StatusOK)
394394
DecodeJSON(t, resp, &apiIssues)
395-
assert.EqualValues(t, "15", resp.Header().Get("X-Total-Count"))
395+
assert.EqualValues(t, "17", resp.Header().Get("X-Total-Count"))
396396
assert.Len(t, apiIssues, 10) // there are more but 10 is page item limit
397397

398398
query.Add("limit", "20")
399399
link.RawQuery = query.Encode()
400400
req = NewRequest(t, "GET", link.String())
401401
resp = session.MakeRequest(t, req, http.StatusOK)
402402
DecodeJSON(t, resp, &apiIssues)
403-
assert.Len(t, apiIssues, 15)
403+
assert.Len(t, apiIssues, 17)
404404

405405
query = url.Values{"assigned": {"true"}, "state": {"all"}}
406406
link.RawQuery = query.Encode()
407407
req = NewRequest(t, "GET", link.String())
408408
resp = session.MakeRequest(t, req, http.StatusOK)
409409
DecodeJSON(t, resp, &apiIssues)
410-
assert.Len(t, apiIssues, 1)
410+
assert.Len(t, apiIssues, 2)
411411

412412
query = url.Values{"milestones": {"milestone1"}, "state": {"all"}}
413413
link.RawQuery = query.Encode()
@@ -435,7 +435,7 @@ func TestSearchIssues(t *testing.T) {
435435
req = NewRequest(t, "GET", link.String())
436436
resp = session.MakeRequest(t, req, http.StatusOK)
437437
DecodeJSON(t, resp, &apiIssues)
438-
assert.Len(t, apiIssues, 3)
438+
assert.Len(t, apiIssues, 5)
439439

440440
query = url.Values{"owner": {"user3"}, "team": {"team1"}} // organization + team
441441
link.RawQuery = query.Encode()

models/fixtures/issue.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,27 @@
184184
is_pull: false
185185
created_unix: 1602935696
186186
updated_unix: 1602935696
187+
188+
-
189+
id: 16
190+
repo_id: 32
191+
index: 1
192+
poster_id: 2
193+
name: just a normal issue
194+
content: content
195+
is_closed: false
196+
is_pull: false
197+
created_unix: 1602935696
198+
updated_unix: 1602935696
199+
200+
-
201+
id: 17
202+
repo_id: 32
203+
index: 2
204+
poster_id: 15
205+
name: a issue with a assignment
206+
content: content
207+
is_closed: false
208+
is_pull: false
209+
created_unix: 1602935696
210+
updated_unix: 1602935696

models/fixtures/issue_assignees.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@
1010
id: 3
1111
assignee_id: 2
1212
issue_id: 6
13+
-
14+
id: 4
15+
assignee_id: 2
16+
issue_id: 17

0 commit comments

Comments
 (0)