diff options
author | Jimmy Praet <jimmy.praet@telenet.be> | 2024-01-15 08:20:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-15 07:20:01 +0000 |
commit | 5d3fdd121279c758f247a76e020799aa5e548feb (patch) | |
tree | e27b631cfdfd35d673da1130c9639633a1e3bc10 /modules/structs | |
parent | ce0225c1b87d682f53b87496c8dd6ccee0396f0b (diff) | |
download | gitea-5d3fdd121279c758f247a76e020799aa5e548feb.tar.gz gitea-5d3fdd121279c758f247a76e020799aa5e548feb.zip |
Add branch protection setting for ignoring stale approvals (#28498)
Fixes #27114.
* In Gitea 1.12 (#9532), a "dismiss stale approvals" branch protection
setting was introduced, for ignoring stale reviews when verifying the
approval count of a pull request.
* In Gitea 1.14 (#12674), the "dismiss review" feature was added.
* This caused confusion with users (#25858), as "dismiss" now means 2
different things.
* In Gitea 1.20 (#25882), the behavior of the "dismiss stale approvals"
branch protection was modified to actually dismiss the stale review.
For some users this new behavior of dismissing the stale reviews is not
desirable.
So this PR reintroduces the old behavior as a new "ignore stale
approvals" branch protection setting.
---------
Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'modules/structs')
-rw-r--r-- | modules/structs/repo_branch.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/structs/repo_branch.go b/modules/structs/repo_branch.go index e9927aec27..e96d276b29 100644 --- a/modules/structs/repo_branch.go +++ b/modules/structs/repo_branch.go @@ -43,6 +43,7 @@ type BranchProtection struct { BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests"` BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"` DismissStaleApprovals bool `json:"dismiss_stale_approvals"` + IgnoreStaleApprovals bool `json:"ignore_stale_approvals"` RequireSignedCommits bool `json:"require_signed_commits"` ProtectedFilePatterns string `json:"protected_file_patterns"` UnprotectedFilePatterns string `json:"unprotected_file_patterns"` @@ -75,6 +76,7 @@ type CreateBranchProtectionOption struct { BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests"` BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"` DismissStaleApprovals bool `json:"dismiss_stale_approvals"` + IgnoreStaleApprovals bool `json:"ignore_stale_approvals"` RequireSignedCommits bool `json:"require_signed_commits"` ProtectedFilePatterns string `json:"protected_file_patterns"` UnprotectedFilePatterns string `json:"unprotected_file_patterns"` @@ -100,6 +102,7 @@ type EditBranchProtectionOption struct { BlockOnOfficialReviewRequests *bool `json:"block_on_official_review_requests"` BlockOnOutdatedBranch *bool `json:"block_on_outdated_branch"` DismissStaleApprovals *bool `json:"dismiss_stale_approvals"` + IgnoreStaleApprovals *bool `json:"ignore_stale_approvals"` RequireSignedCommits *bool `json:"require_signed_commits"` ProtectedFilePatterns *string `json:"protected_file_patterns"` UnprotectedFilePatterns *string `json:"unprotected_file_patterns"` |