diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /qa/spec/support/shared_examples/merge_with_code_owner_shared_examples.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
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.rb | 18 |
1 files changed, 6 insertions, 12 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 40a8be8202a..4bbad9bf3e5 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 @@ -31,19 +31,13 @@ module QA end # 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 = 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 + protected_branch = Resource::ProtectedBranch.fabricate_via_api! do |branch| + branch.project = project + branch.branch_name = project.default_branch + branch.new_branch = false + branch.require_code_owner_approval = true end + protected_branch.set_require_code_owner_approval # Push a change to the file with a CODEOWNERS rule Resource::Repository::Push.fabricate! do |push| |