Tag push rule prevents tag deletion from Web UI
Overview
Enabling the "Do not allow users to remove git tags with git push" push rule prevents tags deletion from the UI. This is a confirmed regression. Working in 8.16 and broken in 8.17.
Reproduce
- Enable the "Do not allow users to remove git tags with git push" push rule
- Delete a tag from the Web UI
Problems
-
The push rule explicitly states "Tags can still be deleted through the web UI." - This behaviour has now changed.
-
This exception is unhanded and simply results in the generic "Something went wrong on our end.".
-
This was likely broken in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7237
Output
GitHooksService::PreReceiveError (GitLab: You can not delete a tag):
app/services/git_hooks_service.rb:17:in `block in execute'
app/services/git_hooks_service.rb:13:in `each'
app/services/git_hooks_service.rb:13:in `execute'
app/services/git_operation_service.rb:117:in `with_hooks'
app/services/git_operation_service.rb:111:in `update_ref_in_hooks'
app/services/git_operation_service.rb:44:in `rm_tag'
app/models/repository.rb:210:in `rm_tag'
app/services/delete_tag_service.rb:10:in `execute'
app/controllers/projects/tags_controller.rb:44:in `destroy'
```
@ayufan @smcgivern @adamniedzielski (as you've worked on this functionality before)
________
https://gitlab.zendesk.com/agent/tickets/67755