mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-02 16:35:19 +02:00
fix: PR not blocked by review request for a whitelisted team (#8511)
Fixes #8491. Previous behavior always updated the newly created review to set the `official` flag to false. This logic is now removed. The most likely reason that this logic existed was that team reviews were being marked as official based upon `doer`, rather than the target team, which seems undesirable. The expected behavior was retained by removing the check for `IsOfficialReviewer(..., doer)`, ensuring that when making a review request for a team, it doesn't matter *who* makes the request. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8511 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net> Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
This commit is contained in:
parent
e186b5c039
commit
e47fa23729
5 changed files with 134 additions and 10 deletions
16
models/fixtures/TestAddTeamReviewRequest/issue.yml
Normal file
16
models/fixtures/TestAddTeamReviewRequest/issue.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
-
|
||||
id: 23
|
||||
repo_id: 2
|
||||
index: 3
|
||||
poster_id: 2
|
||||
original_author_id: 0
|
||||
name: protected branch pull
|
||||
content: pull request to a protected branch
|
||||
milestone_id: 0
|
||||
priority: 0
|
||||
is_pull: true
|
||||
is_closed: false
|
||||
num_comments: 0
|
||||
created_unix: 1707270422
|
||||
updated_unix: 1707270422
|
||||
is_locked: false
|
|
@ -0,0 +1,28 @@
|
|||
- id: 1
|
||||
repo_id: 2
|
||||
branch_name: protected-main
|
||||
can_push: false
|
||||
enable_whitelist: true
|
||||
whitelist_user_i_ds: [1]
|
||||
whitelist_team_i_ds: []
|
||||
enable_merge_whitelist: true
|
||||
whitelist_deploy_keys: false
|
||||
merge_whitelist_user_i_ds: [1]
|
||||
merge_whitelist_team_i_ds: []
|
||||
enable_status_check: false
|
||||
status_check_contexts: []
|
||||
enable_approvals_whitelist: true
|
||||
approvals_whitelist_user_i_ds: []
|
||||
approvals_whitelist_team_i_ds: [1]
|
||||
required_approvals: 1
|
||||
block_on_rejected_reviews: true
|
||||
block_on_official_review_requests: true
|
||||
block_on_outdated_branch: true
|
||||
dismiss_stale_approvals: true
|
||||
ignore_stale_approvals: false
|
||||
require_signed_commits: false
|
||||
protected_file_patterns: ""
|
||||
unprotected_file_patterns: ""
|
||||
apply_to_admins: true
|
||||
created_unix: 1752513073
|
||||
updated_unix: 1752513073
|
12
models/fixtures/TestAddTeamReviewRequest/pull_request.yml
Normal file
12
models/fixtures/TestAddTeamReviewRequest/pull_request.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
-
|
||||
id: 11
|
||||
type: 0 # gitea pull request
|
||||
status: 2 # mergeable
|
||||
issue_id: 23
|
||||
index: 3
|
||||
head_repo_id: 2
|
||||
base_repo_id: 2
|
||||
head_branch: feature/protected-branch-pr
|
||||
base_branch: protected-main
|
||||
merge_base: 4a357436d925b5c974181ff12a994538ddc5a269
|
||||
has_merged: false
|
Loading…
Add table
Add a link
Reference in a new issue