Commit 0e606ca2 authored by Sashi's avatar Sashi Committed by Sashi Kumar

Fix duplicated tag deletion activity and events

When deleting a release tag, this is what happens:
- Tags::DestroyService calls repository.rm_tag and calls project hooks and executes events. Call to rm_tag invokes Gitaly UserDeleteTagRequest
- Gitaly posts back to /internal/post_receive API which invokes PostReceive worker
- PostReceive worker invokes TagHooksService which calls the same hooks/services again
parent ab30bbb8
......@@ -18,11 +18,6 @@ module Tags
.new(project, current_user, tag: tag_name)
.execute
push_data = build_push_data(tag)
EventCreateService.new.push(project, current_user, push_data)
project.execute_hooks(push_data.dup, :tag_push_hooks)
project.execute_services(push_data.dup, :tag_push_hooks)
success('Tag was removed')
else
error('Failed to remove tag')
......@@ -38,14 +33,5 @@ module Tags
def success(message)
super().merge(message: message)
end
def build_push_data(tag)
Gitlab::DataBuilder::Push.build(
project: project,
user: current_user,
oldrev: tag.dereferenced_target.sha,
newrev: Gitlab::Git::BLANK_SHA,
ref: "#{Gitlab::Git::TAG_REF_PREFIX}#{tag.name}")
end
end
end
---
title: Fix duplicated activity and events on deletion of tag
merge_request: 28861
author: Sashi Kumar
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment