Skip to content

Commit fe2d7b0

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Don’t comment when locking (go-gitea#29508) [skip ci] Updated translations via Crowdin migrate some more "OptionalBool" to "Option[bool]" (go-gitea#29479) Update FAQ about git hook problems (go-gitea#29495)
2 parents 0ac2d7a + 5e32cd6 commit fe2d7b0

File tree

28 files changed

+230
-183
lines changed

28 files changed

+230
-183
lines changed

.github/workflows/cron-lock.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,4 @@ jobs:
2020
- uses: dessant/lock-threads@v5
2121
with:
2222
issue-inactive-days: 10
23-
issue-comment: |
24-
Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
2523
pr-inactive-days: 7
26-
pr-comment: |
27-
Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)

docs/content/help/faq.en-us.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@ Our translations are currently crowd-sourced on our [Crowdin project](https://cr
221221

222222
Whether you want to change a translation or add a new one, it will need to be there as all translations are overwritten in our CI via the Crowdin integration.
223223

224-
## Push Hook / Webhook aren't running
224+
## Push Hook / Webhook / Actions aren't running
225225

226-
If you can push but can't see push activities on the home dashboard, or the push doesn't trigger webhook, there are a few possibilities:
226+
If you can push but can't see push activities on the home dashboard, or the push doesn't trigger webhook and Actions workflows, it's likely that the git hooks are not working.
227+
228+
There are a few possibilities:
227229

228230
1. The git hooks are out of sync: run "Resynchronize pre-receive, update and post-receive hooks of all repositories" on the site admin panel
229231
2. The git repositories (and hooks) are stored on some filesystems (ex: mounted by NAS) which don't support script execution, make sure the filesystem supports `chmod a+x any-script`

docs/content/help/faq.zh-cn.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,11 @@ Gitea还提供了自己的SSH服务器,用于在SSHD不可用时使用。
225225

226226
无论您想要更改翻译还是添加新的翻译,都需要在Crowdin集成中进行,因为所有翻译都会被CI覆盖。
227227

228-
## 推送钩子/ Webhook未运行
228+
## 推送钩子/ Webhook / Actions 未运行
229229

230-
如果您可以推送但无法在主页仪表板上看到推送活动,或者推送不触发Webhook,有几种可能性:
230+
如果您可以推送但无法在主页仪表板上看到推送活动,或者推送不触发 Webhook 和 Actions,可能是 git 钩子不工作而导致的。
231+
232+
这可能是由于以下原因:
231233

232234
1. Git钩子不同步:在站点管理面板上运行“重新同步所有仓库的pre-receive、update和post-receive钩子”
233235
2. Git仓库(和钩子)存储在一些不支持脚本执行的文件系统上(例如由NAS挂载),请确保文件系统支持`chmod a+x any-script`

models/repo/repo_list.go

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"code.gitea.io/gitea/models/unit"
1414
user_model "code.gitea.io/gitea/models/user"
1515
"code.gitea.io/gitea/modules/container"
16+
"code.gitea.io/gitea/modules/optional"
1617
"code.gitea.io/gitea/modules/setting"
1718
"code.gitea.io/gitea/modules/structs"
1819
"code.gitea.io/gitea/modules/util"
@@ -125,31 +126,31 @@ type SearchRepoOptions struct {
125126
// None -> include public and private
126127
// True -> include just private
127128
// False -> include just public
128-
IsPrivate util.OptionalBool
129+
IsPrivate optional.Option[bool]
129130
// None -> include collaborative AND non-collaborative
130131
// True -> include just collaborative
131132
// False -> include just non-collaborative
132-
Collaborate util.OptionalBool
133+
Collaborate optional.Option[bool]
133134
// What type of unit the user can be collaborative in,
134135
// it is ignored if Collaborate is False.
135136
// TypeInvalid means any unit type.
136137
UnitType unit.Type
137138
// None -> include forks AND non-forks
138139
// True -> include just forks
139140
// False -> include just non-forks
140-
Fork util.OptionalBool
141+
Fork optional.Option[bool]
141142
// None -> include templates AND non-templates
142143
// True -> include just templates
143144
// False -> include just non-templates
144-
Template util.OptionalBool
145+
Template optional.Option[bool]
145146
// None -> include mirrors AND non-mirrors
146147
// True -> include just mirrors
147148
// False -> include just non-mirrors
148-
Mirror util.OptionalBool
149+
Mirror optional.Option[bool]
149150
// None -> include archived AND non-archived
150151
// True -> include just archived
151152
// False -> include just non-archived
152-
Archived util.OptionalBool
153+
Archived optional.Option[bool]
153154
// only search topic name
154155
TopicOnly bool
155156
// only search repositories with specified primary language
@@ -159,7 +160,7 @@ type SearchRepoOptions struct {
159160
// None -> include has milestones AND has no milestone
160161
// True -> include just has milestones
161162
// False -> include just has no milestone
162-
HasMilestones util.OptionalBool
163+
HasMilestones optional.Option[bool]
163164
// LowerNames represents valid lower names to restrict to
164165
LowerNames []string
165166
// When specified true, apply some filters over the conditions:
@@ -359,12 +360,12 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
359360
)))
360361
}
361362

362-
if opts.IsPrivate != util.OptionalBoolNone {
363-
cond = cond.And(builder.Eq{"is_private": opts.IsPrivate.IsTrue()})
363+
if opts.IsPrivate.Has() {
364+
cond = cond.And(builder.Eq{"is_private": opts.IsPrivate.Value()})
364365
}
365366

366-
if opts.Template != util.OptionalBoolNone {
367-
cond = cond.And(builder.Eq{"is_template": opts.Template == util.OptionalBoolTrue})
367+
if opts.Template.Has() {
368+
cond = cond.And(builder.Eq{"is_template": opts.Template.Value()})
368369
}
369370

370371
// Restrict to starred repositories
@@ -380,11 +381,11 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
380381
// Restrict repositories to those the OwnerID owns or contributes to as per opts.Collaborate
381382
if opts.OwnerID > 0 {
382383
accessCond := builder.NewCond()
383-
if opts.Collaborate != util.OptionalBoolTrue {
384+
if !opts.Collaborate.Value() {
384385
accessCond = builder.Eq{"owner_id": opts.OwnerID}
385386
}
386387

387-
if opts.Collaborate != util.OptionalBoolFalse {
388+
if opts.Collaborate.ValueOrDefault(true) {
388389
// A Collaboration is:
389390

390391
collaborateCond := builder.NewCond()
@@ -472,31 +473,32 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
472473
Where(builder.Eq{"language": opts.Language}).And(builder.Eq{"is_primary": true})))
473474
}
474475

475-
if opts.Fork != util.OptionalBoolNone || opts.OnlyShowRelevant {
476-
if opts.OnlyShowRelevant && opts.Fork == util.OptionalBoolNone {
476+
if opts.Fork.Has() || opts.OnlyShowRelevant {
477+
if opts.OnlyShowRelevant && !opts.Fork.Has() {
477478
cond = cond.And(builder.Eq{"is_fork": false})
478479
} else {
479-
cond = cond.And(builder.Eq{"is_fork": opts.Fork == util.OptionalBoolTrue})
480+
cond = cond.And(builder.Eq{"is_fork": opts.Fork.Value()})
480481
}
481482
}
482483

483-
if opts.Mirror != util.OptionalBoolNone {
484-
cond = cond.And(builder.Eq{"is_mirror": opts.Mirror == util.OptionalBoolTrue})
484+
if opts.Mirror.Has() {
485+
cond = cond.And(builder.Eq{"is_mirror": opts.Mirror.Value()})
485486
}
486487

487488
if opts.Actor != nil && opts.Actor.IsRestricted {
488489
cond = cond.And(AccessibleRepositoryCondition(opts.Actor, unit.TypeInvalid))
489490
}
490491

491-
if opts.Archived != util.OptionalBoolNone {
492-
cond = cond.And(builder.Eq{"is_archived": opts.Archived == util.OptionalBoolTrue})
492+
if opts.Archived.Has() {
493+
cond = cond.And(builder.Eq{"is_archived": opts.Archived.Value()})
493494
}
494495

495-
switch opts.HasMilestones {
496-
case util.OptionalBoolTrue:
497-
cond = cond.And(builder.Gt{"num_milestones": 0})
498-
case util.OptionalBoolFalse:
499-
cond = cond.And(builder.Eq{"num_milestones": 0}.Or(builder.IsNull{"num_milestones"}))
496+
if opts.HasMilestones.Has() {
497+
if opts.HasMilestones.Value() {
498+
cond = cond.And(builder.Gt{"num_milestones": 0})
499+
} else {
500+
cond = cond.And(builder.Eq{"num_milestones": 0}.Or(builder.IsNull{"num_milestones"}))
501+
}
500502
}
501503

502504
if opts.OnlyShowRelevant {

0 commit comments

Comments
 (0)