Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  Display all user types and org types on admin management UI (go-gitea#27050)
  Apply lng2020 to maintainers (go-gitea#27068)
  Fix incorrect default branch label while switching between branches (go-gitea#27053)
  set version in snapcraft yaml
  Replace 'userxx' with 'orgxx' in all test files when the user type is org  (go-gitea#27052)
  [skip ci] Updated translations via Crowdin
  Load reviewer before sending notification (go-gitea#27063)
  bump all nightly builds to 16gb
  Show the repo count in code tab on both user profile and org page. (go-gitea#27048)
  Fix Fomantic's line-height causing vertical scrollbars to appear (go-gitea#26961)
  Dashboard context dropdown position fix on landing page in mobile view. (go-gitea#27047)
  • Loading branch information
zjjhot committed Sep 14, 2023
2 parents 8251797 + 198a9ca commit 78fb7f3
Show file tree
Hide file tree
Showing 108 changed files with 348 additions and 304 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
branches: [ main, release/v* ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
nightly-binary:
runs-on: actuated-4cpu-8gb
runs-on: actuated-4cpu-16gb
steps:
- uses: actions/checkout@v3
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
push: true
tags: gitea/gitea:${{ steps.clean_name.outputs.branch }}
nightly-docker-rootless:
runs-on: actuated-4cpu-8gb
runs-on: actuated-4cpu-16gb
steps:
- uses: actions/checkout@v3
# fetch all commits instead of only the last as some branches are long lived and could have many between versions
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@ Denys Konovalov <[email protected]> (@denyskon)
Punit Inani <[email protected]> (@puni9869)
CaiCandong <[email protected]> (@caicandong)
Rui Chen <[email protected]> (@chenrui333)
Nanguan Lin <[email protected]> (@lng2020)
20 changes: 10 additions & 10 deletions models/fixtures/email_address.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
-
id: 10
uid: 3
email: user3@example.com
lower_email: user3@example.com
email: org3@example.com
lower_email: org3@example.com
is_activated: true
is_primary: true

Expand All @@ -97,16 +97,16 @@
-
id: 13
uid: 6
email: user6@example.com
lower_email: user6@example.com
email: org6@example.com
lower_email: org6@example.com
is_activated: true
is_primary: true

-
id: 14
uid: 7
email: user7@example.com
lower_email: user7@example.com
email: org7@example.com
lower_email: org7@example.com
is_activated: true
is_primary: true

Expand Down Expand Up @@ -153,8 +153,8 @@
-
id: 20
uid: 17
email: user17@example.com
lower_email: user17@example.com
email: org17@example.com
lower_email: org17@example.com
is_activated: true
is_primary: true

Expand All @@ -169,8 +169,8 @@
-
id: 22
uid: 19
email: user19@example.com
lower_email: user19@example.com
email: org19@example.com
lower_email: org19@example.com
is_activated: true
is_primary: true

Expand Down
14 changes: 7 additions & 7 deletions models/fixtures/repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
-
id: 3
owner_id: 3
owner_name: user3
owner_name: org3
lower_name: repo3
name: repo3
default_branch: master
Expand Down Expand Up @@ -126,7 +126,7 @@
-
id: 5
owner_id: 3
owner_name: user3
owner_name: org3
lower_name: repo5
name: repo5
num_watches: 0
Expand Down Expand Up @@ -671,7 +671,7 @@
-
id: 23
owner_id: 17
owner_name: user17
owner_name: org17
lower_name: big_test_public_4
name: big_test_public_4
num_watches: 0
Expand Down Expand Up @@ -701,7 +701,7 @@
-
id: 24
owner_id: 17
owner_name: user17
owner_name: org17
lower_name: big_test_private_4
name: big_test_private_4
num_watches: 0
Expand Down Expand Up @@ -791,7 +791,7 @@
-
id: 27
owner_id: 19
owner_name: user19
owner_name: org19
lower_name: big_test_public_mirror_6
name: big_test_public_mirror_6
num_watches: 0
Expand Down Expand Up @@ -821,7 +821,7 @@
-
id: 28
owner_id: 19
owner_name: user19
owner_name: org19
lower_name: big_test_private_mirror_6
name: big_test_private_mirror_6
num_watches: 0
Expand Down Expand Up @@ -942,7 +942,7 @@
-
id: 32 # org public repo
owner_id: 3
owner_name: user3
owner_name: org3
lower_name: repo21
name: repo21
num_watches: 0
Expand Down
2 changes: 1 addition & 1 deletion models/fixtures/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@
type: 1
reviewer_id: 6
issue_id: 11
content: "singular review from user6 and final review for this pr"
content: "singular review from org6 and final review for this pr"
updated_unix: 946684831
created_unix: 946684831
58 changes: 29 additions & 29 deletions models/fixtures/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@

-
id: 3
lower_name: user3
name: user3
lower_name: org3
name: org3
full_name: ' <<<< >> >> > >> > >>> >> '
email: user3@example.com
email: org3@example.com
keep_email_private: false
email_notifications_preference: onmention
passwd: ZogKvWdyEx:password
passwd_hash_algo: dummy
must_change_password: false
login_source: 0
login_name: user3
login_name: org3
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
Expand All @@ -98,7 +98,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar3
avatar_email: user3@example.com
avatar_email: org3@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
Expand Down Expand Up @@ -187,17 +187,17 @@

-
id: 6
lower_name: user6
name: user6
full_name: User Six
email: user6@example.com
lower_name: org6
name: org6
full_name: Org Six
email: org6@example.com
keep_email_private: false
email_notifications_preference: enabled
passwd: ZogKvWdyEx:password
passwd_hash_algo: dummy
must_change_password: false
login_source: 0
login_name: user6
login_name: org6
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
Expand All @@ -209,7 +209,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar6
avatar_email: user6@example.com
avatar_email: org6@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
Expand All @@ -224,17 +224,17 @@

-
id: 7
lower_name: user7
name: user7
full_name: User Seven
email: user7@example.com
lower_name: org7
name: org7
full_name: Org Seven
email: org7@example.com
keep_email_private: false
email_notifications_preference: disabled
passwd: ZogKvWdyEx:password
passwd_hash_algo: dummy
must_change_password: false
login_source: 0
login_name: user7
login_name: org7
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
Expand All @@ -246,7 +246,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar7
avatar_email: user7@example.com
avatar_email: org7@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
Expand Down Expand Up @@ -594,17 +594,17 @@

-
id: 17
lower_name: user17
name: user17
full_name: User 17
email: user17@example.com
lower_name: org17
name: org17
full_name: org 17
email: org17@example.com
keep_email_private: false
email_notifications_preference: enabled
passwd: ZogKvWdyEx:password
passwd_hash_algo: dummy
must_change_password: false
login_source: 0
login_name: user17
login_name: org17
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
Expand All @@ -616,7 +616,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar17
avatar_email: user17@example.com
avatar_email: org17@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
Expand Down Expand Up @@ -668,17 +668,17 @@

-
id: 19
lower_name: user19
name: user19
full_name: User 19
email: user19@example.com
lower_name: org19
name: org19
full_name: Org 19
email: org19@example.com
keep_email_private: false
email_notifications_preference: enabled
passwd: ZogKvWdyEx:password
passwd_hash_algo: dummy
must_change_password: false
login_source: 0
login_name: user19
login_name: org19
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
Expand All @@ -690,7 +690,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar19
avatar_email: user19@example.com
avatar_email: org19@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
Expand Down
6 changes: 3 additions & 3 deletions models/issues/assignees_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func TestUpdateAssignee(t *testing.T) {
_, _, err = issues_model.ToggleIssueAssignee(db.DefaultContext, issue, &user_model.User{ID: 1}, user2.ID)
assert.NoError(t, err)

user3, err := user_model.GetUserByID(db.DefaultContext, 3)
org3, err := user_model.GetUserByID(db.DefaultContext, 3)
assert.NoError(t, err)
_, _, err = issues_model.ToggleIssueAssignee(db.DefaultContext, issue, &user_model.User{ID: 1}, user3.ID)
_, _, err = issues_model.ToggleIssueAssignee(db.DefaultContext, issue, &user_model.User{ID: 1}, org3.ID)
assert.NoError(t, err)

user1, err := user_model.GetUserByID(db.DefaultContext, 1) // This user is already assigned (see the definition in fixtures), so running UpdateAssignee should unassign him
Expand All @@ -47,7 +47,7 @@ func TestUpdateAssignee(t *testing.T) {
assert.NoError(t, err)

var expectedAssignees []*user_model.User
expectedAssignees = append(expectedAssignees, user2, user3)
expectedAssignees = append(expectedAssignees, user2, org3)

for in, assignee := range issue.Assignees {
assert.Equal(t, assignee.ID, expectedAssignees[in].ID)
Expand Down
6 changes: 3 additions & 3 deletions models/issues/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,11 @@ func TestIssue_ResolveMentions(t *testing.T) {
// Public repo, doer
testSuccess("user2", "repo1", "user1", []string{"user1"}, []int64{})
// Private repo, team member
testSuccess("user17", "big_test_private_4", "user20", []string{"user2"}, []int64{2})
testSuccess("org17", "big_test_private_4", "user20", []string{"user2"}, []int64{2})
// Private repo, not a team member
testSuccess("user17", "big_test_private_4", "user20", []string{"user5"}, []int64{})
testSuccess("org17", "big_test_private_4", "user20", []string{"user5"}, []int64{})
// Private repo, whole team
testSuccess("user17", "big_test_private_4", "user15", []string{"user17/owners"}, []int64{18})
testSuccess("org17", "big_test_private_4", "user15", []string{"org17/owners"}, []int64{18})
}

func TestResourceIndex(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions models/issues/issue_xref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestXRef_AddCrossReferences(t *testing.T) {
itarget = testCreateIssue(t, 3, 3, "title4", "content4", false)

// Cross-reference to issue #4 by admin
content = fmt.Sprintf("content5, mentions user3/repo3#%d", itarget.Index)
content = fmt.Sprintf("content5, mentions org3/repo3#%d", itarget.Index)
i = testCreateIssue(t, 2, 1, "title5", content, false)
ref = unittest.AssertExistsAndLoadBean(t, &issues_model.Comment{IssueID: itarget.ID, RefIssueID: i.ID, RefCommentID: 0})
assert.Equal(t, issues_model.CommentTypeIssueRef, ref.Type)
Expand All @@ -63,7 +63,7 @@ func TestXRef_AddCrossReferences(t *testing.T) {
assert.Equal(t, references.XRefActionNone, ref.RefAction)

// Cross-reference to issue #4 with no permission
content = fmt.Sprintf("content6, mentions user3/repo3#%d", itarget.Index)
content = fmt.Sprintf("content6, mentions org3/repo3#%d", itarget.Index)
i = testCreateIssue(t, 4, 5, "title6", content, false)
unittest.AssertNotExistsBean(t, &issues_model.Comment{IssueID: itarget.ID, RefIssueID: i.ID, RefCommentID: 0})
}
Expand Down
8 changes: 4 additions & 4 deletions models/issues/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ func TestParseCodeOwnersLine(t *testing.T) {
{Line: "# comment", Tokens: []string{}},
{Line: "!.* @user1 @org1/team1", Tokens: []string{"!.*", "@user1", "@org1/team1"}},
{Line: `.*\\.js @user2 #comment`, Tokens: []string{`.*\.js`, "@user2"}},
{Line: `docs/(aws|google|azure)/[^/]*\\.(md|txt) @user3 @org2/team2`, Tokens: []string{`docs/(aws|google|azure)/[^/]*\.(md|txt)`, "@user3", "@org2/team2"}},
{Line: `\#path @user3`, Tokens: []string{`#path`, "@user3"}},
{Line: `path\ with\ spaces/ @user3`, Tokens: []string{`path with spaces/`, "@user3"}},
{Line: `docs/(aws|google|azure)/[^/]*\\.(md|txt) @org3 @org2/team2`, Tokens: []string{`docs/(aws|google|azure)/[^/]*\.(md|txt)`, "@org3", "@org2/team2"}},
{Line: `\#path @org3`, Tokens: []string{`#path`, "@org3"}},
{Line: `path\ with\ spaces/ @org3`, Tokens: []string{`path with spaces/`, "@org3"}},
}

for _, g := range given {
Expand All @@ -335,7 +335,7 @@ func TestGetApprovers(t *testing.T) {
// to assert that there are no duplicated approvers.
setting.Repository.PullRequest.DefaultMergeMessageOfficialApproversOnly = false
approvers := pr.GetApprovers()
expected := "Reviewed-by: User Five <[email protected]>\nReviewed-by: User Six <user6@example.com>\n"
expected := "Reviewed-by: User Five <[email protected]>\nReviewed-by: Org Six <org6@example.com>\n"
assert.EqualValues(t, expected, approvers)
}

Expand Down
Loading

0 comments on commit 78fb7f3

Please sign in to comment.