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 ...@@ -5,11 +5,11 @@ module EE
module DevOpsReportController module DevOpsReportController
extend ActiveSupport::Concern extend ActiveSupport::Concern
prepended do 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 end
def should_track_devops_score? def should_track_devops_score?
params[:tab] == 'devops-score' !show_adoption? || params[:tab] == 'devops-score'
end end
def show_adoption? def show_adoption?
......
...@@ -35,12 +35,26 @@ RSpec.describe Admin::DevOpsReportController do ...@@ -35,12 +35,26 @@ RSpec.describe Admin::DevOpsReportController do
end end
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| ['', 'dev', 'sec', 'ops'].each do |tab|
it_behaves_like 'tracks usage event', 'i_analytics_dev_ops_adoption', tab it_behaves_like 'tracks usage event', 'i_analytics_dev_ops_adoption', tab
end end
it_behaves_like 'tracks usage event', 'i_analytics_dev_ops_score', 'devops-score' it_behaves_like 'tracks usage event', 'i_analytics_dev_ops_score', 'devops-score'
end 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
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