Skip to content

Commit bf641e8

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Switch to `eslint-plugin-import-x` (go-gitea#32790) Fix clone panel js error (go-gitea#32798) [skip ci] Updated translations via Crowdin Add `is_archived` option for issue indexer (go-gitea#32735) Upgrade dependency crypto library (go-gitea#32750) Add standard-compliant route to serve outdated R packages (go-gitea#32783) Fix repo home file list (go-gitea#32788) Rearrange Clone Panel (go-gitea#31142) Fix a number of typescript errors (go-gitea#32773) Add label/author/assignee filters to the user/org home issue list (go-gitea#32779) # Conflicts: # templates/repo/wiki/revision.tmpl # templates/repo/wiki/view.tmpl
2 parents 12cfa63 + ee45950 commit bf641e8

Some content is hidden

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

82 files changed

+1232
-1269
lines changed

.eslintrc.yaml

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ parserOptions:
1616
parser: "@typescript-eslint/parser" # for vue plugin - https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
1717

1818
settings:
19-
import/extensions: [".js", ".ts"]
20-
import/parsers:
19+
import-x/extensions: [".js", ".ts"]
20+
import-x/parsers:
2121
"@typescript-eslint/parser": [".js", ".ts"]
22-
import/resolver:
22+
import-x/resolver:
2323
typescript: true
2424

2525
plugins:
@@ -28,7 +28,7 @@ plugins:
2828
- "@typescript-eslint/eslint-plugin"
2929
- eslint-plugin-array-func
3030
- eslint-plugin-github
31-
- eslint-plugin-i
31+
- eslint-plugin-import-x
3232
- eslint-plugin-no-jquery
3333
- eslint-plugin-no-use-extend-native
3434
- eslint-plugin-regexp
@@ -58,15 +58,15 @@ overrides:
5858
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
5959
- files: ["*.config.*"]
6060
rules:
61-
i/no-unused-modules: [0]
61+
import-x/no-unused-modules: [0]
6262
- files: ["**/*.d.ts"]
6363
rules:
64-
i/no-unused-modules: [0]
64+
import-x/no-unused-modules: [0]
6565
"@typescript-eslint/consistent-type-definitions": [0]
6666
"@typescript-eslint/consistent-type-imports": [0]
6767
- files: ["web_src/js/types.ts"]
6868
rules:
69-
i/no-unused-modules: [0]
69+
import-x/no-unused-modules: [0]
7070
- files: ["**/*.test.*", "web_src/js/test/setup.ts"]
7171
env:
7272
vitest-globals/env: true
@@ -394,49 +394,49 @@ rules:
394394
id-blacklist: [0]
395395
id-length: [0]
396396
id-match: [0]
397-
i/consistent-type-specifier-style: [0]
398-
i/default: [0]
399-
i/dynamic-import-chunkname: [0]
400-
i/export: [2]
401-
i/exports-last: [0]
402-
i/extensions: [2, always, {ignorePackages: true}]
403-
i/first: [2]
404-
i/group-exports: [0]
405-
i/max-dependencies: [0]
406-
i/named: [2]
407-
i/namespace: [0]
408-
i/newline-after-import: [0]
409-
i/no-absolute-path: [0]
410-
i/no-amd: [2]
411-
i/no-anonymous-default-export: [0]
412-
i/no-commonjs: [2]
413-
i/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
414-
i/no-default-export: [0]
415-
i/no-deprecated: [0]
416-
i/no-dynamic-require: [0]
417-
i/no-empty-named-blocks: [2]
418-
i/no-extraneous-dependencies: [2]
419-
i/no-import-module-exports: [0]
420-
i/no-internal-modules: [0]
421-
i/no-mutable-exports: [0]
422-
i/no-named-as-default-member: [0]
423-
i/no-named-as-default: [0]
424-
i/no-named-default: [0]
425-
i/no-named-export: [0]
426-
i/no-namespace: [0]
427-
i/no-nodejs-modules: [0]
428-
i/no-relative-packages: [0]
429-
i/no-relative-parent-imports: [0]
430-
i/no-restricted-paths: [0]
431-
i/no-self-import: [2]
432-
i/no-unassigned-import: [0]
433-
i/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$"]}]
434-
i/no-unused-modules: [2, {unusedExports: true}]
435-
i/no-useless-path-segments: [2, {commonjs: true}]
436-
i/no-webpack-loader-syntax: [2]
437-
i/order: [0]
438-
i/prefer-default-export: [0]
439-
i/unambiguous: [0]
397+
import-x/consistent-type-specifier-style: [0]
398+
import-x/default: [0]
399+
import-x/dynamic-import-chunkname: [0]
400+
import-x/export: [2]
401+
import-x/exports-last: [0]
402+
import-x/extensions: [2, always, {ignorePackages: true}]
403+
import-x/first: [2]
404+
import-x/group-exports: [0]
405+
import-x/max-dependencies: [0]
406+
import-x/named: [2]
407+
import-x/namespace: [0]
408+
import-x/newline-after-import: [0]
409+
import-x/no-absolute-path: [0]
410+
import-x/no-amd: [2]
411+
import-x/no-anonymous-default-export: [0]
412+
import-x/no-commonjs: [2]
413+
import-x/no-cycle: [2, {ignoreExternal: true, maxDepth: 1}]
414+
import-x/no-default-export: [0]
415+
import-x/no-deprecated: [0]
416+
import-x/no-dynamic-require: [0]
417+
import-x/no-empty-named-blocks: [2]
418+
import-x/no-extraneous-dependencies: [2]
419+
import-x/no-import-module-exports: [0]
420+
import-x/no-internal-modules: [0]
421+
import-x/no-mutable-exports: [0]
422+
import-x/no-named-as-default-member: [0]
423+
import-x/no-named-as-default: [0]
424+
import-x/no-named-default: [0]
425+
import-x/no-named-export: [0]
426+
import-x/no-namespace: [0]
427+
import-x/no-nodejs-modules: [0]
428+
import-x/no-relative-packages: [0]
429+
import-x/no-relative-parent-imports: [0]
430+
import-x/no-restricted-paths: [0]
431+
import-x/no-self-import: [2]
432+
import-x/no-unassigned-import: [0]
433+
import-x/no-unresolved: [2, {commonjs: true, ignore: ["\\?.+$"]}]
434+
import-x/no-unused-modules: [2, {unusedExports: true}]
435+
import-x/no-useless-path-segments: [2, {commonjs: true}]
436+
import-x/no-webpack-loader-syntax: [2]
437+
import-x/order: [0]
438+
import-x/prefer-default-export: [0]
439+
import-x/unambiguous: [0]
440440
init-declarations: [0]
441441
line-comment-position: [0]
442442
logical-assignment-operators: [0]

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ require (
121121
github.com/yuin/goldmark v1.7.8
122122
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
123123
github.com/yuin/goldmark-meta v1.1.0
124-
golang.org/x/crypto v0.28.0
124+
golang.org/x/crypto v0.31.0
125125
golang.org/x/image v0.21.0
126126
golang.org/x/net v0.30.0
127127
golang.org/x/oauth2 v0.23.0
128-
golang.org/x/sync v0.8.0
129-
golang.org/x/sys v0.26.0
130-
golang.org/x/text v0.19.0
128+
golang.org/x/sync v0.10.0
129+
golang.org/x/sys v0.28.0
130+
golang.org/x/text v0.21.0
131131
golang.org/x/tools v0.26.0
132132
google.golang.org/grpc v1.67.1
133133
google.golang.org/protobuf v1.35.1

go.sum

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,9 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
893893
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
894894
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
895895
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
896-
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
897896
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
897+
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
898+
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
898899
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
899900
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
900901
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
@@ -946,8 +947,9 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
946947
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
947948
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
948949
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
949-
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
950950
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
951+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
952+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
951953
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
952954
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
953955
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -982,8 +984,9 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
982984
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
983985
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
984986
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
985-
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
986987
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
988+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
989+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
987990
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
988991
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
989992
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -996,8 +999,9 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
996999
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
9971000
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
9981001
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
999-
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
10001002
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
1003+
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
1004+
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
10011005
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
10021006
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
10031007
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -1009,8 +1013,9 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
10091013
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
10101014
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
10111015
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
1012-
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
10131016
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
1017+
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
1018+
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
10141019
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
10151020
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
10161021
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

models/db/search.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ const (
2626
SearchOrderByForksReverse SearchOrderBy = "num_forks DESC"
2727
)
2828

29-
const (
30-
// Which means a condition to filter the records which don't match any id.
31-
// It's different from zero which means the condition could be ignored.
32-
NoConditionID = -1
33-
)
29+
// NoConditionID means a condition to filter the records which don't match any id.
30+
// eg: "milestone_id=-1" means "find the items without any milestone.
31+
const NoConditionID int64 = -1
32+
33+
// NonExistingID means a condition to match no result (eg: a non-existing user)
34+
// It doesn't use -1 or -2 because they are used as builtin users.
35+
const NonExistingID int64 = -1000000

models/issues/issue_search.go

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ type IssuesOptions struct { //nolint
2727
RepoIDs []int64 // overwrites RepoCond if the length is not 0
2828
AllPublic bool // include also all public repositories
2929
RepoCond builder.Cond
30-
AssigneeID int64
31-
PosterID int64
30+
AssigneeID optional.Option[int64]
31+
PosterID optional.Option[int64]
3232
MentionedID int64
3333
ReviewRequestedID int64
3434
ReviewedID int64
@@ -231,15 +231,8 @@ func applyConditions(sess *xorm.Session, opts *IssuesOptions) {
231231
sess.And("issue.is_closed=?", opts.IsClosed.Value())
232232
}
233233

234-
if opts.AssigneeID > 0 {
235-
applyAssigneeCondition(sess, opts.AssigneeID)
236-
} else if opts.AssigneeID == db.NoConditionID {
237-
sess.Where("issue.id NOT IN (SELECT issue_id FROM issue_assignees)")
238-
}
239-
240-
if opts.PosterID > 0 {
241-
applyPosterCondition(sess, opts.PosterID)
242-
}
234+
applyAssigneeCondition(sess, opts.AssigneeID)
235+
applyPosterCondition(sess, opts.PosterID)
243236

244237
if opts.MentionedID > 0 {
245238
applyMentionedCondition(sess, opts.MentionedID)
@@ -359,13 +352,27 @@ func issuePullAccessibleRepoCond(repoIDstr string, userID int64, org *organizati
359352
return cond
360353
}
361354

362-
func applyAssigneeCondition(sess *xorm.Session, assigneeID int64) {
363-
sess.Join("INNER", "issue_assignees", "issue.id = issue_assignees.issue_id").
364-
And("issue_assignees.assignee_id = ?", assigneeID)
355+
func applyAssigneeCondition(sess *xorm.Session, assigneeID optional.Option[int64]) {
356+
// old logic: 0 is also treated as "not filtering assignee", because the "assignee" was read as FormInt64
357+
if !assigneeID.Has() || assigneeID.Value() == 0 {
358+
return
359+
}
360+
if assigneeID.Value() == db.NoConditionID {
361+
sess.Where("issue.id NOT IN (SELECT issue_id FROM issue_assignees)")
362+
} else {
363+
sess.Join("INNER", "issue_assignees", "issue.id = issue_assignees.issue_id").
364+
And("issue_assignees.assignee_id = ?", assigneeID.Value())
365+
}
365366
}
366367

367-
func applyPosterCondition(sess *xorm.Session, posterID int64) {
368-
sess.And("issue.poster_id=?", posterID)
368+
func applyPosterCondition(sess *xorm.Session, posterID optional.Option[int64]) {
369+
if !posterID.Has() {
370+
return
371+
}
372+
// poster doesn't need to support db.NoConditionID(-1), so just use the value as-is
373+
if posterID.Has() {
374+
sess.And("issue.poster_id=?", posterID.Value())
375+
}
369376
}
370377

371378
func applyMentionedCondition(sess *xorm.Session, mentionedID int64) {

models/issues/issue_stats.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,9 @@ func applyIssuesOptions(sess *xorm.Session, opts *IssuesOptions, issueIDs []int6
151151

152152
applyProjectCondition(sess, opts)
153153

154-
if opts.AssigneeID > 0 {
155-
applyAssigneeCondition(sess, opts.AssigneeID)
156-
} else if opts.AssigneeID == db.NoConditionID {
157-
sess.Where("issue.id NOT IN (SELECT issue_id FROM issue_assignees)")
158-
}
154+
applyAssigneeCondition(sess, opts.AssigneeID)
159155

160-
if opts.PosterID > 0 {
161-
applyPosterCondition(sess, opts.PosterID)
162-
}
156+
applyPosterCondition(sess, opts.PosterID)
163157

164158
if opts.MentionedID > 0 {
165159
applyMentionedCondition(sess, opts.MentionedID)

models/issues/issue_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
repo_model "code.gitea.io/gitea/models/repo"
1717
"code.gitea.io/gitea/models/unittest"
1818
user_model "code.gitea.io/gitea/models/user"
19+
"code.gitea.io/gitea/modules/optional"
1920
"code.gitea.io/gitea/modules/setting"
2021

2122
"github.com/stretchr/testify/assert"
@@ -155,7 +156,7 @@ func TestIssues(t *testing.T) {
155156
}{
156157
{
157158
issues_model.IssuesOptions{
158-
AssigneeID: 1,
159+
AssigneeID: optional.Some(int64(1)),
159160
SortType: "oldest",
160161
},
161162
[]int64{1, 6},

modules/indexer/issues/bleve/bleve.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
const (
2424
issueIndexerAnalyzer = "issueIndexer"
2525
issueIndexerDocType = "issueIndexerDocType"
26-
issueIndexerLatestVersion = 4
26+
issueIndexerLatestVersion = 5
2727
)
2828

2929
const unicodeNormalizeName = "unicodeNormalize"
@@ -75,6 +75,7 @@ func generateIssueIndexMapping() (mapping.IndexMapping, error) {
7575

7676
docMapping.AddFieldMappingsAt("is_pull", boolFieldMapping)
7777
docMapping.AddFieldMappingsAt("is_closed", boolFieldMapping)
78+
docMapping.AddFieldMappingsAt("is_archived", boolFieldMapping)
7879
docMapping.AddFieldMappingsAt("label_ids", numberFieldMapping)
7980
docMapping.AddFieldMappingsAt("no_label", boolFieldMapping)
8081
docMapping.AddFieldMappingsAt("milestone_id", numberFieldMapping)
@@ -185,6 +186,9 @@ func (b *Indexer) Search(ctx context.Context, options *internal.SearchOptions) (
185186
if options.IsClosed.Has() {
186187
queries = append(queries, inner_bleve.BoolFieldQuery(options.IsClosed.Value(), "is_closed"))
187188
}
189+
if options.IsArchived.Has() {
190+
queries = append(queries, inner_bleve.BoolFieldQuery(options.IsArchived.Value(), "is_archived"))
191+
}
188192

189193
if options.NoLabelOnly {
190194
queries = append(queries, inner_bleve.BoolFieldQuery(true, "no_label"))

modules/indexer/issues/db/options.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ func ToDBOptions(ctx context.Context, options *internal.SearchOptions) (*issue_m
5454
RepoIDs: options.RepoIDs,
5555
AllPublic: options.AllPublic,
5656
RepoCond: nil,
57-
AssigneeID: convertID(options.AssigneeID),
58-
PosterID: convertID(options.PosterID),
57+
AssigneeID: optional.Some(convertID(options.AssigneeID)),
58+
PosterID: options.PosterID,
5959
MentionedID: convertID(options.MentionID),
6060
ReviewRequestedID: convertID(options.ReviewRequestedID),
6161
ReviewedID: convertID(options.ReviewedID),
@@ -72,7 +72,7 @@ func ToDBOptions(ctx context.Context, options *internal.SearchOptions) (*issue_m
7272
UpdatedAfterUnix: options.UpdatedAfterUnix.Value(),
7373
UpdatedBeforeUnix: options.UpdatedBeforeUnix.Value(),
7474
PriorityRepoID: 0,
75-
IsArchived: optional.None[bool](),
75+
IsArchived: options.IsArchived,
7676
Org: nil,
7777
Team: nil,
7878
User: nil,

0 commit comments

Comments
 (0)