Failure in qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb | Create Protected branch support when developers and maintainers are not allowed to push to a protected branch user without push rights fails to push to the protect
Summary
https://gitlab.com/gitlab-org/gitlab-qa/-/jobs/451302535
Issue opened to report the bug causing this test to fail: #208253 (closed)
Stack trace
2) Create Protected branch support when developers and maintainers are not allowed to push to a protected branch user without push rights fails to push to the protected branch
Failure/Error: expect { push_new_file(branch_name) }.to raise_error(QA::Git::Repository::RepositoryCommandError, /remote: GitLab: You are not allowed to push code to protected branches on this project\.([\s\S]+)\[remote rejected\] #{branch_name} -> #{branch_name} \(pre-receive hook declined\)/)
expected QA::Git::Repository::RepositoryCommandError with message matching /remote: GitLab: You are not allowed to push code to protected branches on this project\.([\s\S]+)\[remote rejected\] protected-branch -> protected-branch \(pre-receive hook declined\)/, got #<QA::Git::Repository::RepositoryCommandError: The command HOME="/tmp/qa-netrc-credentials/23" git pu...x-group/qa-test-2020-02-26-18-21-20-292b861157a0da69/protected-branch-project-c805c5db1edb58ab.git'> with backtrace:
# ./qa/git/repository.rb:221:in `run'
# ./qa/git/repository.rb:116:in `push_changes'
# ./qa/resource/repository/push.rb:98:in `block in fabricate!'
# ./qa/scenario/actable.rb:16:in `perform'
# ./qa/git/repository.rb:33:in `block (2 levels) in perform'
# ./qa/git/repository.rb:33:in `chdir'
# ./qa/git/repository.rb:33:in `block in perform'
# ./qa/git/repository.rb:32:in `perform'
# ./qa/resource/repository/push.rb:50:in `fabricate!'
# ./qa/resource/repository/project_push.rb:38:in `fabricate!'
# ./qa/resource/base.rb:30:in `block (2 levels) in fabricate_via_browser_ui!'
# ./qa/resource/base.rb:135:in `log_fabrication'
# ./qa/resource/base.rb:30:in `block in fabricate_via_browser_ui!'
# ./qa/resource/base.rb:118:in `do_fabricate!'
# ./qa/resource/base.rb:29:in `fabricate_via_browser_ui!'
# ./qa/resource/base.rb:21:in `rescue in fabricate!'
# ./qa/resource/base.rb:18:in `fabricate!'
# ./qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb:51:in `push_new_file'
# ./qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb:38:in `block (5 levels) in <module:QA>'
# ./qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb:38:in `block (4 levels) in <module:QA>'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:123:in `block in run'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:110:in `loop'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:110:in `run'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
# ./spec/spec_helper.rb:68:in `block (2 levels) in <top (required)>'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:123:in `block in run'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:110:in `loop'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:110:in `run'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
# /usr/local/bundle/gems/rspec-retry-0.6.1/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
# ./qa/specs/runner.rb:69:in `perform'
# ./qa/scenario/template.rb:10:in `block in perform'
# ./qa/scenario/template.rb:8:in `tap'
# ./qa/scenario/template.rb:8:in `perform'
# ./qa/scenario/template.rb:33:in `perform'
# ./qa/scenario/template.rb:10:in `block in perform'
# ./qa/scenario/template.rb:8:in `tap'
# ./qa/scenario/template.rb:8:in `perform'
# ./qa/scenario/bootable.rb:28:in `launch!'
# ./qa/specs/features/browser_ui/3_create/repository/push_protected_branch_spec.rb:38:in `block (4 levels) in <module:QA>'
The full error is hidden from the stacktrace. It looks like:
remote: GitLab: API is not accessible
To http://192.168.20.9:3000/gitlab-qa-sandbox-group/qa-test-2020-02-27-12-27-01-5c06ff7049d7364b/protected-branch-project-17de38c397667bea.git
! [remote rejected] protected-branch -> protected-branch (pre-receive hook declined)
error: failed to push some refs to 'http://root@192.168.20.9:3000/gitlab-qa-sandbox-group/qa-test-2020-02-27-12-27-01-5c06ff7049d7364b/protected-branch-project-17de38c397667bea.git'
Screenshot / HTML page
The screenshot isn't helpful. It's just the Repository Settings page as it appears before and after adding a protected branch.
Possible fixes
Revert and fix !25936 (merged)?
Edited by Mark Lapierre