API response says the force pushing is allowed when it is not allowed
Summary
- When force pushing is prevented by
prevent_pushing_and_force_pushing
, the UI correctly shows that no one is allowed to force push, but the API response says they are allowed to force push
Full context: #435500 (comment 1702617086)
Steps to reproduce
- Create a protected branch
- Create a security policy with
prevent_pushing_and_force_pushing: true
for the protected branch - View the protected branch in the UI
- View the protected branch information from the API
Example Project
What is the current bug behavior?
UI says No one
is allowed to force push; API says force pushing is allowed
What is the expected correct behavior?
UI says No one
is allowed to force push; API says force pushing is not allowed
Relevant logs and/or screenshots
See them at #435500 (comment 1702617086)
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Edited by Alexander Turinske