Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb')
-rw-r--r--qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb b/qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb
index 610bf8b9e28..40a8be8202a 100644
--- a/qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb
+++ b/qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb
@@ -30,10 +30,17 @@ module QA
)
end
- # Require approval from code owners on master
- Resource::ProtectedBranch.fabricate! do |protected_branch|
+ # Require approval from code owners on the default branch
+ # The default branch is already protected, and we can't update a protected branch via the API (yet)
+ # so we unprotect it first and then protect it again with the desired parameters
+ Resource::ProtectedBranch.unprotect_via_api! do |protected_branch|
protected_branch.project = project
- protected_branch.branch_name = 'master'
+ protected_branch.branch_name = project.default_branch
+ end
+
+ Resource::ProtectedBranch.fabricate_via_api! do |protected_branch|
+ protected_branch.project = project
+ protected_branch.branch_name = project.default_branch
protected_branch.new_branch = false
protected_branch.require_code_owner_approval = true
end