diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /qa/spec/support/shared_examples | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'qa/spec/support/shared_examples')
-rw-r--r-- | qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb | 13 |
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 |