aboutsummaryrefslogtreecommitdiffstats
path: root/modules/structs/repo_branch.go
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2020-11-29 03:30:46 +0800
committerGitHub <noreply@github.com>2020-11-28 21:30:46 +0200
commit9c26dc1f3a742280baff4e9578545bc822016764 (patch)
treeac997d23e59a658b387302ecd65e76a39d99b9e8 /modules/structs/repo_branch.go
parent7ed5bf8cbe06bf2cfc4980cf6e020dc46dd71a79 (diff)
downloadgitea-9c26dc1f3a742280baff4e9578545bc822016764.tar.gz
gitea-9c26dc1f3a742280baff4e9578545bc822016764.zip
Add block on official review requests branch protection (#13705)
Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/structs/repo_branch.go')
-rw-r--r--modules/structs/repo_branch.go121
1 files changed, 62 insertions, 59 deletions
diff --git a/modules/structs/repo_branch.go b/modules/structs/repo_branch.go
index 490c63070a..efb4caecb0 100644
--- a/modules/structs/repo_branch.go
+++ b/modules/structs/repo_branch.go
@@ -23,26 +23,27 @@ type Branch struct {
// BranchProtection represents a branch protection for a repository
type BranchProtection struct {
- BranchName string `json:"branch_name"`
- EnablePush bool `json:"enable_push"`
- EnablePushWhitelist bool `json:"enable_push_whitelist"`
- PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
- PushWhitelistTeams []string `json:"push_whitelist_teams"`
- PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"`
- EnableMergeWhitelist bool `json:"enable_merge_whitelist"`
- MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
- MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
- EnableStatusCheck bool `json:"enable_status_check"`
- StatusCheckContexts []string `json:"status_check_contexts"`
- RequiredApprovals int64 `json:"required_approvals"`
- EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"`
- ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
- ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
- BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"`
- BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"`
- DismissStaleApprovals bool `json:"dismiss_stale_approvals"`
- RequireSignedCommits bool `json:"require_signed_commits"`
- ProtectedFilePatterns string `json:"protected_file_patterns"`
+ BranchName string `json:"branch_name"`
+ EnablePush bool `json:"enable_push"`
+ EnablePushWhitelist bool `json:"enable_push_whitelist"`
+ PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
+ PushWhitelistTeams []string `json:"push_whitelist_teams"`
+ PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"`
+ EnableMergeWhitelist bool `json:"enable_merge_whitelist"`
+ MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
+ MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
+ EnableStatusCheck bool `json:"enable_status_check"`
+ StatusCheckContexts []string `json:"status_check_contexts"`
+ RequiredApprovals int64 `json:"required_approvals"`
+ EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"`
+ ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
+ ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
+ BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"`
+ BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests"`
+ BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"`
+ DismissStaleApprovals bool `json:"dismiss_stale_approvals"`
+ RequireSignedCommits bool `json:"require_signed_commits"`
+ ProtectedFilePatterns string `json:"protected_file_patterns"`
// swagger:strfmt date-time
Created time.Time `json:"created_at"`
// swagger:strfmt date-time
@@ -51,47 +52,49 @@ type BranchProtection struct {
// CreateBranchProtectionOption options for creating a branch protection
type CreateBranchProtectionOption struct {
- BranchName string `json:"branch_name"`
- EnablePush bool `json:"enable_push"`
- EnablePushWhitelist bool `json:"enable_push_whitelist"`
- PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
- PushWhitelistTeams []string `json:"push_whitelist_teams"`
- PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"`
- EnableMergeWhitelist bool `json:"enable_merge_whitelist"`
- MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
- MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
- EnableStatusCheck bool `json:"enable_status_check"`
- StatusCheckContexts []string `json:"status_check_contexts"`
- RequiredApprovals int64 `json:"required_approvals"`
- EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"`
- ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
- ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
- BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"`
- BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"`
- DismissStaleApprovals bool `json:"dismiss_stale_approvals"`
- RequireSignedCommits bool `json:"require_signed_commits"`
- ProtectedFilePatterns string `json:"protected_file_patterns"`
+ BranchName string `json:"branch_name"`
+ EnablePush bool `json:"enable_push"`
+ EnablePushWhitelist bool `json:"enable_push_whitelist"`
+ PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
+ PushWhitelistTeams []string `json:"push_whitelist_teams"`
+ PushWhitelistDeployKeys bool `json:"push_whitelist_deploy_keys"`
+ EnableMergeWhitelist bool `json:"enable_merge_whitelist"`
+ MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
+ MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
+ EnableStatusCheck bool `json:"enable_status_check"`
+ StatusCheckContexts []string `json:"status_check_contexts"`
+ RequiredApprovals int64 `json:"required_approvals"`
+ EnableApprovalsWhitelist bool `json:"enable_approvals_whitelist"`
+ ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
+ ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
+ BlockOnRejectedReviews bool `json:"block_on_rejected_reviews"`
+ BlockOnOfficialReviewRequests bool `json:"block_on_official_review_requests"`
+ BlockOnOutdatedBranch bool `json:"block_on_outdated_branch"`
+ DismissStaleApprovals bool `json:"dismiss_stale_approvals"`
+ RequireSignedCommits bool `json:"require_signed_commits"`
+ ProtectedFilePatterns string `json:"protected_file_patterns"`
}
// EditBranchProtectionOption options for editing a branch protection
type EditBranchProtectionOption struct {
- EnablePush *bool `json:"enable_push"`
- EnablePushWhitelist *bool `json:"enable_push_whitelist"`
- PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
- PushWhitelistTeams []string `json:"push_whitelist_teams"`
- PushWhitelistDeployKeys *bool `json:"push_whitelist_deploy_keys"`
- EnableMergeWhitelist *bool `json:"enable_merge_whitelist"`
- MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
- MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
- EnableStatusCheck *bool `json:"enable_status_check"`
- StatusCheckContexts []string `json:"status_check_contexts"`
- RequiredApprovals *int64 `json:"required_approvals"`
- EnableApprovalsWhitelist *bool `json:"enable_approvals_whitelist"`
- ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
- ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
- BlockOnRejectedReviews *bool `json:"block_on_rejected_reviews"`
- BlockOnOutdatedBranch *bool `json:"block_on_outdated_branch"`
- DismissStaleApprovals *bool `json:"dismiss_stale_approvals"`
- RequireSignedCommits *bool `json:"require_signed_commits"`
- ProtectedFilePatterns *string `json:"protected_file_patterns"`
+ EnablePush *bool `json:"enable_push"`
+ EnablePushWhitelist *bool `json:"enable_push_whitelist"`
+ PushWhitelistUsernames []string `json:"push_whitelist_usernames"`
+ PushWhitelistTeams []string `json:"push_whitelist_teams"`
+ PushWhitelistDeployKeys *bool `json:"push_whitelist_deploy_keys"`
+ EnableMergeWhitelist *bool `json:"enable_merge_whitelist"`
+ MergeWhitelistUsernames []string `json:"merge_whitelist_usernames"`
+ MergeWhitelistTeams []string `json:"merge_whitelist_teams"`
+ EnableStatusCheck *bool `json:"enable_status_check"`
+ StatusCheckContexts []string `json:"status_check_contexts"`
+ RequiredApprovals *int64 `json:"required_approvals"`
+ EnableApprovalsWhitelist *bool `json:"enable_approvals_whitelist"`
+ ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
+ ApprovalsWhitelistTeams []string `json:"approvals_whitelist_teams"`
+ BlockOnRejectedReviews *bool `json:"block_on_rejected_reviews"`
+ BlockOnOfficialReviewRequests *bool `json:"block_on_official_review_requests"`
+ BlockOnOutdatedBranch *bool `json:"block_on_outdated_branch"`
+ DismissStaleApprovals *bool `json:"dismiss_stale_approvals"`
+ RequireSignedCommits *bool `json:"require_signed_commits"`
+ ProtectedFilePatterns *string `json:"protected_file_patterns"`
}