Skip to content

Commit f3c1634

Browse files
authored
Merge branch 'main' into lunny/issue_dev
2 parents 66681c3 + 9df5dda commit f3c1634

File tree

188 files changed

+5596
-634
lines changed

Some content is hidden

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

188 files changed

+5596
-634
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ TEST_PGSQL_DBNAME ?= testgitea
179179
TEST_PGSQL_USERNAME ?= postgres
180180
TEST_PGSQL_PASSWORD ?= postgres
181181
TEST_PGSQL_SCHEMA ?= gtestschema
182+
TEST_MINIO_ENDPOINT ?= minio:9000
182183
TEST_MSSQL_HOST ?= mssql:1433
183184
TEST_MSSQL_DBNAME ?= gitea
184185
TEST_MSSQL_USERNAME ?= sa
@@ -574,6 +575,7 @@ generate-ini-pgsql:
574575
-e 's|{{TEST_PGSQL_USERNAME}}|${TEST_PGSQL_USERNAME}|g' \
575576
-e 's|{{TEST_PGSQL_PASSWORD}}|${TEST_PGSQL_PASSWORD}|g' \
576577
-e 's|{{TEST_PGSQL_SCHEMA}}|${TEST_PGSQL_SCHEMA}|g' \
578+
-e 's|{{TEST_MINIO_ENDPOINT}}|${TEST_MINIO_ENDPOINT}|g' \
577579
-e 's|{{REPO_TEST_DIR}}|${REPO_TEST_DIR}|g' \
578580
-e 's|{{TEST_LOGGER}}|$(or $(TEST_LOGGER),test$(COMMA)file)|g' \
579581
-e 's|{{TEST_TYPE}}|$(or $(TEST_TYPE),integration)|g' \

cmd/hook.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,9 @@ Gitea or set your environment appropriately.`, "")
591591
// S: ... ...
592592
// S: flush-pkt
593593
hookOptions := private.HookOptions{
594-
UserName: pusherName,
595-
UserID: pusherID,
594+
UserName: pusherName,
595+
UserID: pusherID,
596+
GitPushOptions: make(map[string]string),
596597
}
597598
hookOptions.OldCommitIDs = make([]string, 0, hookBatchSize)
598599
hookOptions.NewCommitIDs = make([]string, 0, hookBatchSize)
@@ -617,8 +618,6 @@ Gitea or set your environment appropriately.`, "")
617618
hookOptions.RefFullNames = append(hookOptions.RefFullNames, git.RefName(t[2]))
618619
}
619620

620-
hookOptions.GitPushOptions = make(map[string]string)
621-
622621
if hasPushOptions {
623622
for {
624623
rs, err = readPktLine(ctx, reader, pktLineTypeUnknow)
@@ -629,11 +628,7 @@ Gitea or set your environment appropriately.`, "")
629628
if rs.Type == pktLineTypeFlush {
630629
break
631630
}
632-
633-
kv := strings.SplitN(string(rs.Data), "=", 2)
634-
if len(kv) == 2 {
635-
hookOptions.GitPushOptions[kv[0]] = kv[1]
636-
}
631+
hookOptions.GitPushOptions.AddFromKeyValue(string(rs.Data))
637632
}
638633
}
639634

custom/conf/app.example.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,8 @@ LEVEL = Info
15071507
;; - manage_gpg_keys: a user cannot configure gpg keys
15081508
;; - manage_mfa: a user cannot configure mfa devices
15091509
;; - manage_credentials: a user cannot configure emails, passwords, or openid
1510+
;; - change_username: a user cannot change their username
1511+
;; - change_full_name: a user cannot change their full name
15101512
;;EXTERNAL_USER_DISABLE_FEATURES =
15111513

15121514
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
331331

332332
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
333333

334-
replace github.com/nektos/act => gitea.com/gitea/act v0.259.1
334+
replace github.com/nektos/act => gitea.com/gitea/act v0.261.3
335335

336336
replace github.com/charmbracelet/git-lfs-transfer => gitea.com/gitea/git-lfs-transfer v0.2.0
337337

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
1616
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
1717
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:cliQ4HHsCo6xi2oWZYKWW4bly/Ory9FuTpFPRxj/mAg=
1818
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078/go.mod h1:g/V2Hjas6Z1UHUp4yIx6bATpNzJ7DYtD0FG3+xARWxs=
19-
gitea.com/gitea/act v0.259.1 h1:8GG1o/xtUHl3qjn5f0h/2FXrT5ubBn05TJOM5ry+FBw=
20-
gitea.com/gitea/act v0.259.1/go.mod h1:UxZWRYqQG2Yj4+4OqfGWW5a3HELwejyWFQyU7F1jUD8=
19+
gitea.com/gitea/act v0.261.3 h1:BhiYpGJQKGq0XMYYICCYAN4KnsEWHyLbA6dxhZwFcV4=
20+
gitea.com/gitea/act v0.261.3/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
2121
gitea.com/gitea/git-lfs-transfer v0.2.0 h1:baHaNoBSRaeq/xKayEXwiDQtlIjps4Ac/Ll4KqLMB40=
2222
gitea.com/gitea/git-lfs-transfer v0.2.0/go.mod h1:UrXUCm3xLQkq15fu7qlXHUMlrhdlXHoi13KH2Dfiits=
2323
gitea.com/go-chi/binding v0.0.0-20240430071103-39a851e106ed h1:EZZBtilMLSZNWtHHcgq2mt6NSGhJSZBuduAlinMEmso=

models/admin/task.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -179,27 +179,6 @@ func GetMigratingTask(ctx context.Context, repoID int64) (*Task, error) {
179179
return &task, nil
180180
}
181181

182-
// GetMigratingTaskByID returns the migrating task by repo's id
183-
func GetMigratingTaskByID(ctx context.Context, id, doerID int64) (*Task, *migration.MigrateOptions, error) {
184-
task := Task{
185-
ID: id,
186-
DoerID: doerID,
187-
Type: structs.TaskTypeMigrateRepo,
188-
}
189-
has, err := db.GetEngine(ctx).Get(&task)
190-
if err != nil {
191-
return nil, nil, err
192-
} else if !has {
193-
return nil, nil, ErrTaskDoesNotExist{id, 0, task.Type}
194-
}
195-
196-
var opts migration.MigrateOptions
197-
if err := json.Unmarshal([]byte(task.PayloadContent), &opts); err != nil {
198-
return nil, nil, err
199-
}
200-
return &task, &opts, nil
201-
}
202-
203182
// CreateTask creates a task on database
204183
func CreateTask(ctx context.Context, task *Task) error {
205184
return db.Insert(ctx, task)

models/fixtures/repo_unit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,3 +712,24 @@
712712
type: 3
713713
config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}"
714714
created_unix: 946684810
715+
716+
-
717+
id: 108
718+
repo_id: 62
719+
type: 1
720+
config: "{}"
721+
created_unix: 946684810
722+
723+
-
724+
id: 109
725+
repo_id: 62
726+
type: 2
727+
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
728+
created_unix: 946684810
729+
730+
-
731+
id: 110
732+
repo_id: 62
733+
type: 3
734+
config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}"
735+
created_unix: 946684810

models/fixtures/repository.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,3 +1768,34 @@
17681768
size: 0
17691769
is_fsck_enabled: true
17701770
close_issues_via_commit_in_any_branch: false
1771+
1772+
-
1773+
id: 62
1774+
owner_id: 42
1775+
owner_name: org42
1776+
lower_name: search-by-path
1777+
name: search-by-path
1778+
default_branch: master
1779+
num_watches: 0
1780+
num_stars: 0
1781+
num_forks: 0
1782+
num_issues: 0
1783+
num_closed_issues: 0
1784+
num_pulls: 0
1785+
num_closed_pulls: 0
1786+
num_milestones: 0
1787+
num_closed_milestones: 0
1788+
num_projects: 0
1789+
num_closed_projects: 0
1790+
is_private: false
1791+
is_empty: false
1792+
is_archived: false
1793+
is_mirror: false
1794+
status: 0
1795+
is_fork: false
1796+
fork_id: 0
1797+
is_template: false
1798+
template_id: 0
1799+
size: 0
1800+
is_fsck_enabled: true
1801+
close_issues_via_commit_in_any_branch: false

models/fixtures/user.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,3 +1517,40 @@
15171517
repo_admin_change_team_access: false
15181518
theme: ""
15191519
keep_activity_private: false
1520+
1521+
-
1522+
id: 42
1523+
lower_name: org42
1524+
name: org42
1525+
full_name: Org42
1526+
1527+
keep_email_private: false
1528+
email_notifications_preference: onmention
1529+
passwd: ZogKvWdyEx:password
1530+
passwd_hash_algo: dummy
1531+
must_change_password: false
1532+
login_source: 0
1533+
login_name: org42
1534+
type: 1
1535+
salt: ZogKvWdyEx
1536+
max_repo_creation: -1
1537+
is_active: false
1538+
is_admin: false
1539+
is_restricted: false
1540+
allow_git_hook: false
1541+
allow_import_local: false
1542+
allow_create_organization: true
1543+
prohibit_login: false
1544+
avatar: avatar42
1545+
avatar_email: [email protected]
1546+
use_custom_avatar: false
1547+
num_followers: 0
1548+
num_following: 0
1549+
num_stars: 0
1550+
num_repos: 1
1551+
num_teams: 0
1552+
num_members: 0
1553+
visibility: 0
1554+
repo_admin_change_team_access: false
1555+
theme: ""
1556+
keep_activity_private: false

models/issues/pull_list.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type PullRequestsOptions struct {
2626
SortType string
2727
Labels []int64
2828
MilestoneID int64
29+
PosterID int64
2930
}
3031

3132
func listPullRequestStatement(ctx context.Context, baseRepoID int64, opts *PullRequestsOptions) *xorm.Session {
@@ -46,6 +47,10 @@ func listPullRequestStatement(ctx context.Context, baseRepoID int64, opts *PullR
4647
sess.And("issue.milestone_id=?", opts.MilestoneID)
4748
}
4849

50+
if opts.PosterID > 0 {
51+
sess.And("issue.poster_id=?", opts.PosterID)
52+
}
53+
4954
return sess
5055
}
5156

0 commit comments

Comments
 (0)