Commit 94288ae5 authored by Mark Chao's avatar Mark Chao

Rename from usage_ping to operational_metrics

Update gem and method reference
parent 800d80a1
...@@ -295,7 +295,7 @@ gem 'gon', '~> 6.4.0' ...@@ -295,7 +295,7 @@ gem 'gon', '~> 6.4.0'
gem 'request_store', '~> 1.5' gem 'request_store', '~> 1.5'
gem 'base32', '~> 0.3.0' gem 'base32', '~> 0.3.0'
gem 'gitlab-license', '~> 1.5' gem 'gitlab-license', '~> 2.0'
# Protect against bruteforcing # Protect against bruteforcing
gem 'rack-attack', '~> 6.3.0' gem 'rack-attack', '~> 6.3.0'
......
...@@ -490,7 +490,7 @@ GEM ...@@ -490,7 +490,7 @@ GEM
opentracing (~> 0.4) opentracing (~> 0.4)
pg_query (~> 2.1) pg_query (~> 2.1)
redis (> 3.0.0, < 5.0.0) redis (> 3.0.0, < 5.0.0)
gitlab-license (1.5.0) gitlab-license (2.0.0)
gitlab-mail_room (0.0.9) gitlab-mail_room (0.0.9)
gitlab-markup (1.7.1) gitlab-markup (1.7.1)
gitlab-net-dns (0.9.1) gitlab-net-dns (0.9.1)
...@@ -1489,7 +1489,7 @@ DEPENDENCIES ...@@ -1489,7 +1489,7 @@ DEPENDENCIES
gitlab-experiment (~> 0.6.1) gitlab-experiment (~> 0.6.1)
gitlab-fog-azure-rm (~> 1.1.1) gitlab-fog-azure-rm (~> 1.1.1)
gitlab-labkit (~> 0.20.0) gitlab-labkit (~> 0.20.0)
gitlab-license (~> 1.5) gitlab-license (~> 2.0)
gitlab-mail_room (~> 0.0.9) gitlab-mail_room (~> 0.0.9)
gitlab-markup (~> 1.7.1) gitlab-markup (~> 1.7.1)
gitlab-net-dns (~> 0.9.1) gitlab-net-dns (~> 0.9.1)
......
...@@ -579,7 +579,7 @@ class License < ApplicationRecord ...@@ -579,7 +579,7 @@ class License < ApplicationRecord
end end
def customer_service_enabled? def customer_service_enabled?
!!license&.usage_ping_required_metrics? !!license&.operational_metrics?
end end
def license_type def license_type
......
...@@ -1569,13 +1569,13 @@ RSpec.describe License do ...@@ -1569,13 +1569,13 @@ RSpec.describe License do
end end
context 'when the license has usage ping required metrics disabled' do context 'when the license has usage ping required metrics disabled' do
let(:gl_license) { build(:gitlab_license, usage_ping_required_metrics_enabled: false) } let(:gl_license) { build(:gitlab_license, operational_metrics_enabled: false) }
it { is_expected.to be false } it { is_expected.to be false }
end end
context 'when the license has usage ping required metrics enabled' do context 'when the license has usage ping required metrics enabled' do
let(:gl_license) { build(:gitlab_license, usage_ping_required_metrics_enabled: true) } let(:gl_license) { build(:gitlab_license, operational_metrics_enabled: true) }
it { is_expected.to be true } it { is_expected.to be true }
end end
......
...@@ -29,7 +29,7 @@ RSpec.describe ServicePing::BuildPayloadService do ...@@ -29,7 +29,7 @@ RSpec.describe ServicePing::BuildPayloadService do
context 'Instance subscribes to free TAM service' do context 'Instance subscribes to free TAM service' do
before do before do
# License.current.usage_ping? == true # License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: true) create_current_license(operational_metrics_enabled: true)
end end
it_behaves_like 'complete service ping payload' it_behaves_like 'complete service ping payload'
...@@ -38,7 +38,7 @@ RSpec.describe ServicePing::BuildPayloadService do ...@@ -38,7 +38,7 @@ RSpec.describe ServicePing::BuildPayloadService do
context 'Instance does NOT subscribe to free TAM service' do context 'Instance does NOT subscribe to free TAM service' do
before do before do
# License.current.usage_ping? == false # License.current.usage_ping? == false
create_current_license(usage_ping_required_metrics_enabled: false) create_current_license(operational_metrics_enabled: false)
end end
it_behaves_like 'service ping payload with all expected metrics' do it_behaves_like 'service ping payload with all expected metrics' do
...@@ -56,7 +56,7 @@ RSpec.describe ServicePing::BuildPayloadService do ...@@ -56,7 +56,7 @@ RSpec.describe ServicePing::BuildPayloadService do
context 'Instance subscribes to free TAM service' do context 'Instance subscribes to free TAM service' do
before do before do
# License.current.usage_ping? == true # License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: true) create_current_license(operational_metrics_enabled: true)
end end
it_behaves_like 'service ping payload with all expected metrics' do it_behaves_like 'service ping payload with all expected metrics' do
...@@ -71,7 +71,7 @@ RSpec.describe ServicePing::BuildPayloadService do ...@@ -71,7 +71,7 @@ RSpec.describe ServicePing::BuildPayloadService do
context 'Instance does NOT subscribe to free TAM service' do context 'Instance does NOT subscribe to free TAM service' do
before do before do
# License.current.usage_ping? == false # License.current.usage_ping? == false
create_current_license(usage_ping_required_metrics_enabled: false) create_current_license(operational_metrics_enabled: false)
end end
it 'returns empty service ping payload' do it 'returns empty service ping payload' do
......
...@@ -36,10 +36,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do ...@@ -36,10 +36,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
stub_config_setting(usage_ping_enabled: true) stub_config_setting(usage_ping_enabled: true)
end end
context 'and license has usage_ping_required_metrics_enabled set to true' do context 'and license has operational_metrics_enabled set to true' do
before do before do
# License.current.usage_ping? == true # License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: true) create_current_license(operational_metrics_enabled: true)
end end
it 'returns all categories' do it 'returns all categories' do
...@@ -57,10 +57,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do ...@@ -57,10 +57,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
end end
end end
context 'and license has usage_ping_required_metrics_enabled set to false' do context 'and license has operational_metrics_enabled set to false' do
before do before do
# License.current.usage_ping? == true # License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: false) create_current_license(operational_metrics_enabled: false)
end end
it 'returns all categories' do it 'returns all categories' do
...@@ -74,10 +74,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do ...@@ -74,10 +74,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
stub_config_setting(usage_ping_enabled: false) stub_config_setting(usage_ping_enabled: false)
end end
context 'and license has usage_ping_required_metrics_enabled set to true' do context 'and license has operational_metrics_enabled set to true' do
before do before do
# License.current.usage_ping? == true # License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: true) create_current_license(operational_metrics_enabled: true)
end end
it 'returns all categories' do it 'returns all categories' do
...@@ -85,10 +85,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do ...@@ -85,10 +85,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
end end
end end
context 'and license has usage_ping_required_metrics_enabled set to false' do context 'and license has operational_metrics_enabled set to false' do
before do before do
# License.current.usage_ping? == true # License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: false) create_current_license(operational_metrics_enabled: false)
end end
it 'returns all categories' do it 'returns all categories' do
...@@ -124,7 +124,7 @@ RSpec.describe ServicePing::PermitDataCategoriesService do ...@@ -124,7 +124,7 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
before do before do
allow(User).to receive(:single_user).and_return(double(:user, requires_usage_stats_consent?: requires_usage_stats_consent)) allow(User).to receive(:single_user).and_return(double(:user, requires_usage_stats_consent?: requires_usage_stats_consent))
stub_config_setting(usage_ping_enabled: usage_ping_enabled) stub_config_setting(usage_ping_enabled: usage_ping_enabled)
create_current_license(usage_ping_required_metrics_enabled: customer_service_enabled) create_current_license(operational_metrics_enabled: customer_service_enabled)
end end
it 'has the correct product_intelligence_enabled?' do it 'has the correct product_intelligence_enabled?' do
......
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