Commit 76ce6294 authored by Ethan Urie's avatar Ethan Urie

Merge branch...

Merge branch '341125-instance-level-devops-adoption-using-direct-link-spoils-usage-metric' into 'master'

Fix DevopsAdoption usage metric gathering

See merge request gitlab-org/gitlab!82904
parents 2644bc04 47676bd5
......@@ -5,11 +5,11 @@ module EE
module DevOpsReportController
extend ActiveSupport::Concern
prepended do
track_redis_hll_event :show, name: 'i_analytics_dev_ops_adoption', if: -> { params[:tab] != 'devops-score' }
track_redis_hll_event :show, name: 'i_analytics_dev_ops_adoption', if: -> { show_adoption? && params[:tab] != 'devops-score' }
end
def should_track_devops_score?
params[:tab] == 'devops-score'
!show_adoption? || params[:tab] == 'devops-score'
end
def show_adoption?
......
......@@ -35,12 +35,26 @@ RSpec.describe Admin::DevOpsReportController do
end
end
context 'when browsing to specific tabs' do
context 'with devops adoption available' do
before do
stub_licensed_features(devops_adoption: true)
end
['', 'dev', 'sec', 'ops'].each do |tab|
it_behaves_like 'tracks usage event', 'i_analytics_dev_ops_adoption', tab
end
it_behaves_like 'tracks usage event', 'i_analytics_dev_ops_score', 'devops-score'
end
context 'with devops adoption not available' do
before do
stub_licensed_features(devops_adoption: false)
end
['', 'dev', 'sec', 'ops', 'devops-score'].each do |tab|
it_behaves_like 'tracks usage event', 'i_analytics_dev_ops_score', tab
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