forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor patch to be in line with upstream
CONFLICT (modify/delete): services/repository/review.go deleted in HEAD and modified in BLENDER: Don't allow assigning large teams as reviewers. Version BLENDER: Don't allow assigning large teams as reviewers of services/repository/review.go left in tree.
- Loading branch information
1 parent
75e8e03
commit 6649ea8
Showing
1 changed file
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
From 343b5d5701076992bf2bf7f8d5160e387eb2f5c3 Mon Sep 17 00:00:00 2001 | ||
From 4ef4ec237b2d138fb203fd23c01133394e05d8c2 Mon Sep 17 00:00:00 2001 | ||
From: Brecht Van Lommel <[email protected]> | ||
Date: Fri, 10 May 2024 13:33:32 +0200 | ||
Subject: [PATCH] BLENDER: Don't allow assigning large teams as reviewers | ||
|
||
To avoid accidentally spamming hundreds of people. | ||
--- | ||
models/organization/team.go | 16 ++++++++++++++++ | ||
routers/web/repo/issue.go | 4 ++-- | ||
services/repository/review.go | 2 +- | ||
models/organization/team.go | 16 ++++++++++++++++ | ||
routers/web/repo/issue.go | 4 ++-- | ||
services/pull/reviewer.go | 2 +- | ||
3 files changed, 19 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/models/organization/team.go b/models/organization/team.go | ||
index fb7f0c04939e6..be56a0428ec83 100644 | ||
index fb7f0c0493..be56a0428e 100644 | ||
--- a/models/organization/team.go | ||
+++ b/models/organization/team.go | ||
@@ -272,3 +272,19 @@ func IncrTeamRepoNum(ctx context.Context, teamID int64) error { | ||
|
@@ -35,12 +35,12 @@ index fb7f0c04939e6..be56a0428ec83 100644 | |
+ return smallTeams, nil | ||
+} | ||
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go | ||
index cb233b787a690..bbc25ec8be915 100644 | ||
index 3fdf594045..2f3660178c 100644 | ||
--- a/routers/web/repo/issue.go | ||
+++ b/routers/web/repo/issue.go | ||
@@ -3673,13 +3673,13 @@ func handleTeamMentions(ctx *context.Context) { | ||
@@ -3670,13 +3670,13 @@ func handleTeamMentions(ctx *context.Context) { | ||
} | ||
|
||
if isAdmin { | ||
- teams, err = org.LoadTeams(ctx) | ||
+ teams, err = organization.FilterLargeTeams(org.LoadTeams(ctx)) | ||
|
@@ -54,14 +54,17 @@ index cb233b787a690..bbc25ec8be915 100644 | |
if err != nil { | ||
ctx.ServerError("GetUserTeams", err) | ||
return | ||
diff --git a/services/repository/review.go b/services/repository/review.go | ||
index 40513e6bc67ba..f85424d60efa8 100644 | ||
--- a/services/repository/review.go | ||
+++ b/services/repository/review.go | ||
@@ -20,5 +20,5 @@ func GetReviewerTeams(ctx context.Context, repo *repo_model.Repository) ([]*orga | ||
diff --git a/services/pull/reviewer.go b/services/pull/reviewer.go | ||
index bf0d8cb298..bccd4481d5 100644 | ||
--- a/services/pull/reviewer.go | ||
+++ b/services/pull/reviewer.go | ||
@@ -85,5 +85,5 @@ func GetReviewerTeams(ctx context.Context, repo *repo_model.Repository) ([]*orga | ||
return nil, nil | ||
} | ||
|
||
- return organization.GetTeamsWithAccessToRepo(ctx, repo.OwnerID, repo.ID, perm.AccessModeRead) | ||
- return organization.GetTeamsWithAccessToRepoUnit(ctx, repo.OwnerID, repo.ID, perm.AccessModeRead, unit.TypePullRequests) | ||
+ return organization.FilterLargeTeams(organization.GetTeamsWithAccessToRepo(ctx, repo.OwnerID, repo.ID, perm.AccessModeRead)) | ||
} | ||
-- | ||
2.45.2 | ||
|