Skip to content

Commit abd25ce

Browse files
committed
Merge branch 'main' into lunny/add_line_through_deleted_branch
2 parents d5559d1 + b4abb6d commit abd25ce

Some content is hidden

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

47 files changed

+464
-445
lines changed

.github/workflows/pull-compliance.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python-version: "3.12"
3838
- uses: actions/setup-node@v4
3939
with:
40-
node-version: 20
40+
node-version: 22
4141
cache: npm
4242
cache-dependency-path: package-lock.json
4343
- run: pip install poetry
@@ -66,7 +66,7 @@ jobs:
6666
- uses: actions/checkout@v4
6767
- uses: actions/setup-node@v4
6868
with:
69-
node-version: 20
69+
node-version: 22
7070
cache: npm
7171
cache-dependency-path: package-lock.json
7272
- run: make deps-frontend
@@ -137,7 +137,7 @@ jobs:
137137
- uses: actions/checkout@v4
138138
- uses: actions/setup-node@v4
139139
with:
140-
node-version: 20
140+
node-version: 22
141141
cache: npm
142142
cache-dependency-path: package-lock.json
143143
- run: make deps-frontend
@@ -186,7 +186,7 @@ jobs:
186186
- uses: actions/checkout@v4
187187
- uses: actions/setup-node@v4
188188
with:
189-
node-version: 20
189+
node-version: 22
190190
cache: npm
191191
cache-dependency-path: package-lock.json
192192
- run: make deps-frontend

.github/workflows/pull-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
check-latest: true
2424
- uses: actions/setup-node@v4
2525
with:
26-
node-version: 20
26+
node-version: 22
2727
cache: npm
2828
cache-dependency-path: package-lock.json
2929
- run: make deps-frontend frontend deps-backend

.github/workflows/release-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
check-latest: true
2323
- uses: actions/setup-node@v4
2424
with:
25-
node-version: 20
25+
node-version: 22
2626
cache: npm
2727
cache-dependency-path: package-lock.json
2828
- run: make deps-frontend deps-backend

.github/workflows/release-tag-rc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
check-latest: true
2424
- uses: actions/setup-node@v4
2525
with:
26-
node-version: 20
26+
node-version: 22
2727
cache: npm
2828
cache-dependency-path: package-lock.json
2929
- run: make deps-frontend deps-backend

.github/workflows/release-tag-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
check-latest: true
2626
- uses: actions/setup-node@v4
2727
with:
28-
node-version: 20
28+
node-version: 22
2929
cache: npm
3030
cache-dependency-path: package-lock.json
3131
- run: make deps-frontend deps-backend

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
gzip
2323

2424
# frontend
25-
nodejs_20
25+
nodejs_22
2626

2727
# linting
2828
python312

models/activities/action.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ func (a *Action) GetActDisplayNameTitle(ctx context.Context) string {
251251
// GetRepoUserName returns the name of the action repository owner.
252252
func (a *Action) GetRepoUserName(ctx context.Context) string {
253253
a.loadRepo(ctx)
254+
if a.Repo == nil {
255+
return "(non-existing-repo)"
256+
}
254257
return a.Repo.OwnerName
255258
}
256259

@@ -263,6 +266,9 @@ func (a *Action) ShortRepoUserName(ctx context.Context) string {
263266
// GetRepoName returns the name of the action repository.
264267
func (a *Action) GetRepoName(ctx context.Context) string {
265268
a.loadRepo(ctx)
269+
if a.Repo == nil {
270+
return "(non-existing-repo)"
271+
}
266272
return a.Repo.Name
267273
}
268274

models/organization/mini_org.go

Lines changed: 0 additions & 78 deletions
This file was deleted.

models/organization/org.go

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ import (
2525
"xorm.io/xorm"
2626
)
2727

28-
// ________ .__ __ .__
29-
// \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
30-
// / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \
31-
// / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \
32-
// \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| /
33-
// \/ /_____/ \/ \/ \/ \/ \/
34-
3528
// ErrOrgNotExist represents a "OrgNotExist" kind of error.
3629
type ErrOrgNotExist struct {
3730
ID int64
@@ -465,42 +458,6 @@ func GetUsersWhoCanCreateOrgRepo(ctx context.Context, orgID int64) (map[int64]*u
465458
And("team_user.org_id = ?", orgID).Find(&users)
466459
}
467460

468-
// SearchOrganizationsOptions options to filter organizations
469-
type SearchOrganizationsOptions struct {
470-
db.ListOptions
471-
All bool
472-
}
473-
474-
// FindOrgOptions finds orgs options
475-
type FindOrgOptions struct {
476-
db.ListOptions
477-
UserID int64
478-
IncludePrivate bool
479-
}
480-
481-
func queryUserOrgIDs(userID int64, includePrivate bool) *builder.Builder {
482-
cond := builder.Eq{"uid": userID}
483-
if !includePrivate {
484-
cond["is_public"] = true
485-
}
486-
return builder.Select("org_id").From("org_user").Where(cond)
487-
}
488-
489-
func (opts FindOrgOptions) ToConds() builder.Cond {
490-
var cond builder.Cond = builder.Eq{"`user`.`type`": user_model.UserTypeOrganization}
491-
if opts.UserID > 0 {
492-
cond = cond.And(builder.In("`user`.`id`", queryUserOrgIDs(opts.UserID, opts.IncludePrivate)))
493-
}
494-
if !opts.IncludePrivate {
495-
cond = cond.And(builder.Eq{"`user`.visibility": structs.VisibleTypePublic})
496-
}
497-
return cond
498-
}
499-
500-
func (opts FindOrgOptions) ToOrders() string {
501-
return "`user`.name ASC"
502-
}
503-
504461
// HasOrgOrUserVisible tells if the given user can see the given org or user
505462
func HasOrgOrUserVisible(ctx context.Context, orgOrUser, user *user_model.User) bool {
506463
// If user is nil, it's an anonymous user/request.
@@ -533,20 +490,6 @@ func HasOrgsVisible(ctx context.Context, orgs []*Organization, user *user_model.
533490
return false
534491
}
535492

536-
// GetOrgsCanCreateRepoByUserID returns a list of organizations where given user ID
537-
// are allowed to create repos.
538-
func GetOrgsCanCreateRepoByUserID(ctx context.Context, userID int64) ([]*Organization, error) {
539-
orgs := make([]*Organization, 0, 10)
540-
541-
return orgs, db.GetEngine(ctx).Where(builder.In("id", builder.Select("`user`.id").From("`user`").
542-
Join("INNER", "`team_user`", "`team_user`.org_id = `user`.id").
543-
Join("INNER", "`team`", "`team`.id = `team_user`.team_id").
544-
Where(builder.Eq{"`team_user`.uid": userID}).
545-
And(builder.Eq{"`team`.authorize": perm.AccessModeOwner}.Or(builder.Eq{"`team`.can_create_org_repo": true})))).
546-
Asc("`user`.name").
547-
Find(&orgs)
548-
}
549-
550493
// GetOrgUsersByOrgID returns all organization-user relations by organization ID.
551494
func GetOrgUsersByOrgID(ctx context.Context, opts *FindOrgMembersOpts) ([]*OrgUser, error) {
552495
sess := db.GetEngine(ctx).Where("org_id=?", opts.OrgID)

0 commit comments

Comments
 (0)