409 response when removing users form subgroups
Summary
Some customers rely on delete billable members API to remove inactive users from their group. The recent change in this MR cause the existing working user removal script to return 409 {message: 409 Conflict: Resource lock} error. The change was to prevent accidental deletion of the last owner of a group. However, also cause some blockage when removing users from subgroup/project.
For more context see: https://gitlab.com/gitlab-com/dev-sub-department/section-dev-request-for-help/-/issues/32.
Steps to reproduce
Example Project
What is the current bug behavior?
Removing users doesn't isn't blocked with 409 error if the user isn't the last owner of the group.
What is the expected correct behavior?
Relevant logs and/or screenshots
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)