Skip to content

Commit 81f4eeb

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: Fix sort bug on repository issues list (go-gitea#28897) Upgrade xorm to v1.3.7 to fix a resource leak problem caused by Iterate (go-gitea#28891) Add missing exclusive in advanced label options (go-gitea#28322) Fix `DeleteCollaboration` transaction behaviour (go-gitea#28886) Fix schedule not trigger bug because matching full ref name with short ref name (go-gitea#28874)
2 parents d2370bc + c4cdeba commit 81f4eeb

File tree

6 files changed

+29
-22
lines changed

6 files changed

+29
-22
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ require (
121121
mvdan.cc/xurls/v2 v2.5.0
122122
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251
123123
xorm.io/builder v0.3.13
124-
xorm.io/xorm v1.3.7-0.20240101024435-4992cba040fe
124+
xorm.io/xorm v1.3.7
125125
)
126126

127127
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,5 +1380,5 @@ strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251 h1:mUcz5b3
13801380
strk.kbt.io/projects/go/libravatar v0.0.0-20191008002943-06d1c002b251/go.mod h1:FJGmPh3vz9jSos1L/F91iAgnC/aejc0wIIrF2ZwJxdY=
13811381
xorm.io/builder v0.3.13 h1:a3jmiVVL19psGeXx8GIurTp7p0IIgqeDmwhcR6BAOAo=
13821382
xorm.io/builder v0.3.13/go.mod h1:aUW0S9eb9VCaPohFCH3j7czOx1PMW3i1HrSzbLYGBSE=
1383-
xorm.io/xorm v1.3.7-0.20240101024435-4992cba040fe h1:c+IGxoesJV3s4QZb55feZIb1sqFEUluAYHpe5uJIO6U=
1384-
xorm.io/xorm v1.3.7-0.20240101024435-4992cba040fe/go.mod h1:/PjYRKEcJ67WtOnb6DXEMb2Y0uWFaZSoDlhJUebWbXw=
1383+
xorm.io/xorm v1.3.7 h1:mLceAGu0b87r9pD4qXyxGHxifOXIIrAdVcA6k95/osw=
1384+
xorm.io/xorm v1.3.7/go.mod h1:LsCCffeeYp63ssk0pKumP6l96WZcHix7ChpurcLNuMw=

modules/indexer/issues/db/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ func ToDBOptions(ctx context.Context, options *internal.SearchOptions) (*issue_m
3838
sortType = "leastupdate"
3939
case internal.SortByCommentsAsc:
4040
sortType = "leastcomment"
41-
case internal.SortByDeadlineAsc:
41+
case internal.SortByDeadlineDesc:
4242
sortType = "farduedate"
4343
case internal.SortByCreatedDesc:
4444
sortType = "newest"
4545
case internal.SortByUpdatedDesc:
4646
sortType = "recentupdate"
4747
case internal.SortByCommentsDesc:
4848
sortType = "mostcomment"
49-
case internal.SortByDeadlineDesc:
49+
case internal.SortByDeadlineAsc:
5050
sortType = "nearduedate"
5151
default:
5252
sortType = "newest"

options/label/Advanced.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ labels:
1414
- name: "Kind/Testing"
1515
color: 795548
1616
description: Issue or pull request related to testing
17-
- name: "Kind/Breaking"
18-
color: c62828
19-
description: Breaking change that won't be backward compatible
2017
- name: "Kind/Documentation"
2118
color: 37474f
2219
description: Documentation changes
20+
- name: "Compat/Breaking"
21+
color: c62828
22+
description: Breaking change that won't be backward compatible
2323
- name: "Reviewed/Duplicate"
2424
exclusive: true
2525
color: 616161

services/actions/notifier_helper.go

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,24 +159,28 @@ func notify(ctx context.Context, input *notifyInput) error {
159159
workflows, schedules, err := actions_module.DetectWorkflows(gitRepo, commit,
160160
input.Event,
161161
input.Payload,
162-
input.Event == webhook_module.HookEventPush && input.Ref == input.Repo.DefaultBranch,
162+
input.Event == webhook_module.HookEventPush && git.RefName(input.Ref).BranchName() == input.Repo.DefaultBranch,
163163
)
164164
if err != nil {
165165
return fmt.Errorf("DetectWorkflows: %w", err)
166166
}
167167

168-
if len(workflows) == 0 {
169-
log.Trace("repo %s with commit %s couldn't find workflows", input.Repo.RepoPath(), commit.ID)
170-
} else {
171-
for _, wf := range workflows {
172-
if actionsConfig.IsWorkflowDisabled(wf.EntryName) {
173-
log.Trace("repo %s has disable workflows %s", input.Repo.RepoPath(), wf.EntryName)
174-
continue
175-
}
168+
log.Trace("repo %s with commit %s event %s find %d workflows and %d schedules",
169+
input.Repo.RepoPath(),
170+
commit.ID,
171+
input.Event,
172+
len(workflows),
173+
len(schedules),
174+
)
176175

177-
if wf.TriggerEvent.Name != actions_module.GithubEventPullRequestTarget {
178-
detectedWorkflows = append(detectedWorkflows, wf)
179-
}
176+
for _, wf := range workflows {
177+
if actionsConfig.IsWorkflowDisabled(wf.EntryName) {
178+
log.Trace("repo %s has disable workflows %s", input.Repo.RepoPath(), wf.EntryName)
179+
continue
180+
}
181+
182+
if wf.TriggerEvent.Name != actions_module.GithubEventPullRequestTarget {
183+
detectedWorkflows = append(detectedWorkflows, wf)
180184
}
181185
}
182186

services/repository/collaboration.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ func DeleteCollaboration(ctx context.Context, repo *repo_model.Repository, uid i
2626
}
2727
defer committer.Close()
2828

29-
if has, err := db.GetEngine(ctx).Delete(collaboration); err != nil || has == 0 {
29+
if has, err := db.GetEngine(ctx).Delete(collaboration); err != nil {
3030
return err
31-
} else if err = access_model.RecalculateAccesses(ctx, repo); err != nil {
31+
} else if has == 0 {
32+
return committer.Commit()
33+
}
34+
if err = access_model.RecalculateAccesses(ctx, repo); err != nil {
3235
return err
3336
}
3437

0 commit comments

Comments
 (0)