Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/post_receive.rb')
-rw-r--r--app/workers/post_receive.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index 45af15216fc..68a0934e2b7 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -131,11 +131,24 @@ class PostReceive
repository_update_hook_data = Gitlab::DataBuilder::Repository.update(project, user, changes, refs)
SystemHooksService.new.execute_hooks(repository_update_hook_data, :repository_update_hooks)
Gitlab::UsageDataCounters::SourceCodeCounter.count(:pushes)
+ emit_snowplow_event(project, user)
end
def log(message)
Gitlab::GitLogger.error("POST-RECEIVE: #{message}")
end
+
+ def emit_snowplow_event(project, user)
+ return unless Feature.enabled?(:route_hll_to_snowplow_phase2, project.namespace)
+
+ Gitlab::Tracking.event(
+ 'PostReceive',
+ 'source_code_pushes',
+ project: project,
+ namespace: project.namespace,
+ user: user
+ )
+ end
end
PostReceive.prepend_mod_with('PostReceive')