Commit 1d880b4b authored by Gabriel Mazetto's avatar Gabriel Mazetto Committed by Robert Speicher

Removed left-overs from previous implementation

parent 671b20bc
......@@ -159,8 +159,9 @@ class GeoNode < ActiveRecord::Base
self.build_system_hook if system_hook.nil?
self.system_hook.token = SecureRandom.hex(20) unless self.system_hook.token.present?
self.system_hook.url = geo_events_url if uri.present?
self.system_hook.push_events = true
self.system_hook.tag_push_events = true
self.system_hook.push_events = false
self.system_hook.tag_push_events = false
self.system_hook.repository_update_events = true
end
def expire_cache!
......
......@@ -7,8 +7,4 @@ class SystemHook < WebHook
def async_execute(data, hook_name)
Sidekiq::Client.enqueue(SystemHookWorker, id, data, hook_name)
end
def self.repository_update_hooks
GeoNode.where(primary: false).map(&:system_hook)
end
end
......@@ -23,18 +23,6 @@ class PostReceive
# Triggers repository update on secondary nodes when Geo is enabled
Gitlab::Geo.notify_wiki_update(post_received.project) if Gitlab::Geo.enabled?
else
# TODO: gitlab-org/gitlab-ce#26325. Remove this.
if Gitlab::Geo.enabled?
hook_data = {
event_name: 'repository_update',
project_id: post_received.project.id,
project: post_received.project.hook_attrs,
remote_url: post_received.project.ssh_url_to_repo
}
SystemHooksService.new.execute_hooks(hook_data, :repository_update_hooks)
end
process_project_changes(post_received)
process_repository_update(post_received)
end
......
......@@ -89,8 +89,9 @@ describe GeoNode, type: :model do
expect(node.system_hook.url).to be_present
expect(node.system_hook.url).to eq(node.geo_events_url)
expect(node.system_hook.token).to be_present
expect(node.system_hook.push_events).to be_truthy
expect(node.system_hook.tag_push_events).to be_truthy
expect(node.system_hook.push_events).to be_falsey
expect(node.system_hook.tag_push_events).to be_falsey
expect(node.system_hook.repository_update_events).to be_truthy
end
end
end
......
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