Commit 4d1ab8f5 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'mc/feature/remove-track_all_ci_template_inclusions-ff' into 'master'

Remove track_all_ci_template_inclusions FF

See merge request gitlab-org/gitlab!70380
parents 46e1e292 75b9287a
---
name: track_all_ci_template_inclusions
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69204
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/339684
milestone: '14.3'
type: development
group: group::pipeline authoring
default_enabled: false
...@@ -21,8 +21,6 @@ module Gitlab::UsageDataCounters ...@@ -21,8 +21,6 @@ module Gitlab::UsageDataCounters
class << self class << self
def track_unique_project_event(project_id:, template:, config_source:) def track_unique_project_event(project_id:, template:, config_source:)
return unless TEMPLATE_TO_EVENT[template] || Feature.enabled?(:track_all_ci_template_inclusions, default_enabled: :yaml)
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(ci_template_event_name(template, config_source), values: project_id) Gitlab::UsageDataCounters::HLLRedisCounter.track_event(ci_template_event_name(template, config_source), values: project_id)
end end
......
...@@ -90,29 +90,11 @@ RSpec.describe Gitlab::UsageDataCounters::CiTemplateUniqueCounter do ...@@ -90,29 +90,11 @@ RSpec.describe Gitlab::UsageDataCounters::CiTemplateUniqueCounter do
end.not_to raise_error end.not_to raise_error
end end
context 'when feature flag is disabled' do it "tracks #{template}" do
before do expected_template_event_name = described_class.ci_template_event_name(template, :repository_source)
stub_feature_flags(track_all_ci_template_inclusions: false) expect(Gitlab::UsageDataCounters::HLLRedisCounter).to(receive(:track_event)).with(expected_template_event_name, values: project_id)
end
it "does not track #{template}" do
expect(Gitlab::UsageDataCounters::HLLRedisCounter).not_to(receive(:track_event))
described_class.track_unique_project_event(project_id: project_id, template: template, config_source: config_source)
end
end
context 'when feature flag is enabled' do described_class.track_unique_project_event(project_id: project_id, template: template, config_source: config_source)
before do
stub_feature_flags(track_all_ci_template_inclusions: true)
end
it "tracks #{template}" do
expected_template_event_name = described_class.ci_template_event_name(template, :repository_source)
expect(Gitlab::UsageDataCounters::HLLRedisCounter).to(receive(:track_event)).with(expected_template_event_name, values: project_id)
described_class.track_unique_project_event(project_id: project_id, template: template, config_source: config_source)
end
end end
end 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