Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-admin users to delete review requests #29057

Merged
merged 31 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0e1e120
add CanDoerChangeReviewRequests
Zettat123 Feb 5, 2024
576f61f
check team members
Zettat123 Feb 5, 2024
b254cbf
update CanDoerChangeReviewRequests
Zettat123 Feb 6, 2024
90d5ae6
assign canChooseReviewer with CanDoerChangeReviewRequests
Zettat123 Feb 6, 2024
b731818
remove some unused checks
Zettat123 Feb 6, 2024
63a7c93
some fixes
Zettat123 Feb 6, 2024
ddefef7
fix lint
Zettat123 Feb 6, 2024
a1269e8
fix owner check
Zettat123 Feb 6, 2024
2bcec53
add tests
Zettat123 Feb 7, 2024
1f57301
fix fixtures
Zettat123 Feb 7, 2024
573715e
Merge branch 'main' into delete-review-requests
Zettat123 Feb 7, 2024
0410363
fix fixtures
Zettat123 Feb 7, 2024
8daed87
fix test inconsistency
Zettat123 Feb 7, 2024
bef6cb0
fix some tests
Zettat123 Feb 7, 2024
05b826d
fix repo count
Zettat123 Feb 7, 2024
175df6b
fix some tests
Zettat123 Feb 7, 2024
c74425c
fix IsValidTeamReviewRequest
Zettat123 Feb 7, 2024
0fccba1
add team member tests
Zettat123 Feb 7, 2024
d4767fa
remove debug logs
Zettat123 Feb 7, 2024
03aac65
fix inconsistency
Zettat123 Feb 7, 2024
f422847
fix some tests
Zettat123 Feb 7, 2024
4f69a83
fix inconsistency
Zettat123 Feb 7, 2024
8d2e121
fix fixtures
Zettat123 Feb 7, 2024
9a1e2c5
fix some test issues
Zettat123 Feb 8, 2024
e08539f
fix access
Zettat123 Feb 8, 2024
a8ef1b3
fix issue_test
Zettat123 Feb 8, 2024
40d61de
remove the org email from fixtures
Zettat123 Feb 8, 2024
8ce74ec
Merge branch 'main' into delete-review-requests
Zettat123 Feb 19, 2024
fe35d29
Merge branch 'main' into delete-review-requests
GiteaBot Feb 24, 2024
72cb3f2
Merge branch 'main' into delete-review-requests
GiteaBot Feb 24, 2024
f8e782c
Merge branch 'main' into delete-review-requests
GiteaBot Feb 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions models/fixtures/access.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,27 @@
user_id: 31
repo_id: 28
mode: 4

-
id: 24
user_id: 38
repo_id: 60
mode: 2

-
id: 25
user_id: 38
repo_id: 61
mode: 1

-
id: 26
user_id: 39
repo_id: 61
mode: 1

-
id: 27
user_id: 40
repo_id: 61
mode: 4
6 changes: 6 additions & 0 deletions models/fixtures/collaboration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@
repo_id: 22
user_id: 18
mode: 2 # write

-
id: 9
repo_id: 60
user_id: 38
mode: 2 # write
24 changes: 24 additions & 0 deletions models/fixtures/email_address.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,27 @@
lower_email: user37@example.com
is_activated: true
is_primary: true

-
id: 38
uid: 38
email: user38@example.com
lower_email: user38@example.com
is_activated: true
is_primary: true

-
id: 39
uid: 39
email: user39@example.com
lower_email: user39@example.com
is_activated: true
is_primary: true

-
id: 40
uid: 40
email: user40@example.com
lower_email: user40@example.com
is_activated: true
is_primary: true
34 changes: 34 additions & 0 deletions models/fixtures/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,37 @@
created_unix: 978307210
updated_unix: 978307210
is_locked: false

-
id: 21
repo_id: 60
index: 1
poster_id: 39
original_author_id: 0
name: repo60 pull1
content: content for the 1st issue
milestone_id: 0
priority: 0
is_closed: false
is_pull: true
num_comments: 0
created_unix: 1707270422
updated_unix: 1707270422
is_locked: false

-
id: 22
repo_id: 61
index: 1
poster_id: 40
original_author_id: 0
name: repo61 pull1
content: content for the 1st issue
milestone_id: 0
priority: 0
is_closed: false
is_pull: true
num_comments: 0
created_unix: 1707270422
updated_unix: 1707270422
is_locked: false
18 changes: 18 additions & 0 deletions models/fixtures/org_user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,21 @@
uid: 5
org_id: 36
is_public: true

-
id: 18
uid: 38
org_id: 41
is_public: true

-
id: 19
uid: 39
org_id: 41
is_public: true

-
id: 20
uid: 40
org_id: 41
is_public: true
18 changes: 18 additions & 0 deletions models/fixtures/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,21 @@
index: 1
head_repo_id: 23
base_repo_id: 23

-
id: 9
type: 0 # gitea pull request
status: 2 # mergable
issue_id: 21
index: 1
head_repo_id: 60
base_repo_id: 60

-
id: 10
type: 0 # gitea pull request
status: 2 # mergable
issue_id: 22
index: 1
head_repo_id: 61
base_repo_id: 61
42 changes: 42 additions & 0 deletions models/fixtures/repo_unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -676,3 +676,45 @@
type: 1
config: "{}"
created_unix: 946684810

-
id: 102
repo_id: 60
type: 1
config: "{}"
created_unix: 946684810

-
id: 103
repo_id: 60
type: 2
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
created_unix: 946684810

-
id: 104
repo_id: 60
type: 3
config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}"
created_unix: 946684810

-
id: 105
repo_id: 61
type: 1
config: "{}"
created_unix: 946684810

-
id: 106
repo_id: 61
type: 2
config: "{\"EnableTimetracker\":true,\"AllowOnlyContributorsToTrackTime\":true}"
created_unix: 946684810

-
id: 107
repo_id: 61
type: 3
config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}"
created_unix: 946684810
62 changes: 62 additions & 0 deletions models/fixtures/repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1706,3 +1706,65 @@
is_private: true
status: 0
num_issues: 0

-
id: 60
owner_id: 40
owner_name: user40
lower_name: repo60
name: repo60
default_branch: main
num_watches: 0
num_stars: 0
num_forks: 0
num_issues: 0
num_closed_issues: 0
num_pulls: 1
num_closed_pulls: 0
num_milestones: 0
num_closed_milestones: 0
num_projects: 0
num_closed_projects: 0
is_private: false
is_empty: false
is_archived: false
is_mirror: false
status: 0
is_fork: false
fork_id: 0
is_template: false
template_id: 0
size: 0
is_fsck_enabled: true
close_issues_via_commit_in_any_branch: false

-
id: 61
owner_id: 41
owner_name: org41
lower_name: repo61
name: repo61
default_branch: main
num_watches: 0
num_stars: 0
num_forks: 0
num_issues: 0
num_closed_issues: 0
num_pulls: 1
num_closed_pulls: 0
num_milestones: 0
num_closed_milestones: 0
num_projects: 0
num_closed_projects: 0
is_private: false
is_empty: false
is_archived: false
is_mirror: false
status: 0
is_fork: false
fork_id: 0
is_template: false
template_id: 0
size: 0
is_fsck_enabled: true
close_issues_via_commit_in_any_branch: false
22 changes: 22 additions & 0 deletions models/fixtures/team.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,25 @@
num_members: 1
includes_all_repositories: false
can_create_org_repo: true

-
id: 21
org_id: 41
lower_name: owners
name: Owners
authorize: 4 # owner
num_repos: 1
num_members: 1
includes_all_repositories: true
can_create_org_repo: true

-
id: 22
org_id: 41
lower_name: team1
name: Team1
authorize: 1 # read
num_repos: 1
num_members: 2
includes_all_repositories: false
can_create_org_repo: false
12 changes: 12 additions & 0 deletions models/fixtures/team_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,15 @@
org_id: 17
team_id: 9
repo_id: 24

-
id: 12
org_id: 41
team_id: 21
repo_id: 61

-
id: 13
org_id: 41
team_id: 22
repo_id: 61
36 changes: 36 additions & 0 deletions models/fixtures/team_unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,39 @@
team_id: 2
type: 8
access_mode: 2

-
id: 49
team_id: 21
type: 1
access_mode: 4

-
id: 50
team_id: 21
type: 2
access_mode: 4

-
id: 51
team_id: 21
type: 3
access_mode: 4

-
id: 52
team_id: 22
type: 1
access_mode: 1

-
id: 53
team_id: 22
type: 2
access_mode: 1

-
id: 54
team_id: 22
type: 3
access_mode: 1
18 changes: 18 additions & 0 deletions models/fixtures/team_user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,21 @@
org_id: 17
team_id: 9
uid: 15

-
id: 23
org_id: 41
team_id: 21
uid: 40

-
id: 24
org_id: 41
team_id: 22
uid: 38

-
id: 25
org_id: 41
team_id: 22
uid: 39
Loading
Loading