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

Move SNOWPLOW_NAMESPACE to Snowplow destination class

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