Commit 666fa798 authored by Piotr Skorupa's avatar Piotr Skorupa

Move SNOWPLOW_NAMESPACE to Snowplow destination class

parent 093f6884
......@@ -2,8 +2,6 @@
module Gitlab
module Tracking
SNOWPLOW_NAMESPACE = 'gl'
class << self
def enabled?
snowplow_micro_enabled? || Gitlab::CurrentSettings.snowplow_enabled?
......
......@@ -8,6 +8,8 @@ module Gitlab
class Snowplow < Base
extend ::Gitlab::Utils::Override
SNOWPLOW_NAMESPACE = 'gl'
override :event
def event(category, action, label: nil, property: nil, value: nil, context: nil)
return unless enabled?
......@@ -19,7 +21,7 @@ module Gitlab
def options(group)
additional_features = Feature.enabled?(:additional_snowplow_tracking, group, type: :ops)
{
namespace: Gitlab::Tracking::SNOWPLOW_NAMESPACE,
namespace: SNOWPLOW_NAMESPACE,
hostname: hostname,
cookie_domain: cookie_domain,
app_id: app_id,
......@@ -54,7 +56,7 @@ module Gitlab
@tracker ||= SnowplowTracker::Tracker.new(
emitter,
SnowplowTracker::Subject.new,
Gitlab::Tracking::SNOWPLOW_NAMESPACE,
SNOWPLOW_NAMESPACE,
app_id
)
end
......
......@@ -29,7 +29,7 @@ RSpec.describe Gitlab::Tracking::Destinations::Snowplow do
expect(SnowplowTracker::Tracker)
.to receive(:new)
.with(emitter, an_instance_of(SnowplowTracker::Subject), Gitlab::Tracking::SNOWPLOW_NAMESPACE, '_abc123_')
.with(emitter, an_instance_of(SnowplowTracker::Subject), described_class::SNOWPLOW_NAMESPACE, '_abc123_')
.and_return(tracker)
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