Commit 9af258ae authored by Mark Chao's avatar Mark Chao

Merge branch 'rename-to-operational-metrics' into 'master'

Update license's new attribute to operational_metrics

See merge request gitlab-org/gitlab!65922
parents 98ae32c5 94288ae5
......@@ -295,7 +295,7 @@ gem 'gon', '~> 6.4.0'
gem 'request_store', '~> 1.5'
gem 'base32', '~> 0.3.0'
gem 'gitlab-license', '~> 1.5'
gem 'gitlab-license', '~> 2.0'
# Protect against bruteforcing
gem 'rack-attack', '~> 6.3.0'
......
......@@ -490,7 +490,7 @@ GEM
opentracing (~> 0.4)
pg_query (~> 2.1)
redis (> 3.0.0, < 5.0.0)
gitlab-license (1.5.0)
gitlab-license (2.0.0)
gitlab-mail_room (0.0.9)
gitlab-markup (1.7.1)
gitlab-net-dns (0.9.1)
......@@ -1489,7 +1489,7 @@ DEPENDENCIES
gitlab-experiment (~> 0.6.1)
gitlab-fog-azure-rm (~> 1.1.1)
gitlab-labkit (~> 0.20.0)
gitlab-license (~> 1.5)
gitlab-license (~> 2.0)
gitlab-mail_room (~> 0.0.9)
gitlab-markup (~> 1.7.1)
gitlab-net-dns (~> 0.9.1)
......
......@@ -579,7 +579,7 @@ class License < ApplicationRecord
end
def customer_service_enabled?
!!license&.usage_ping_required_metrics?
!!license&.operational_metrics?
end
def license_type
......
......@@ -1569,13 +1569,13 @@ RSpec.describe License do
end
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 }
end
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 }
end
......
......@@ -29,7 +29,7 @@ RSpec.describe ServicePing::BuildPayloadService do
context 'Instance subscribes to free TAM service' do
before do
# License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: true)
create_current_license(operational_metrics_enabled: true)
end
it_behaves_like 'complete service ping payload'
......@@ -38,7 +38,7 @@ RSpec.describe ServicePing::BuildPayloadService do
context 'Instance does NOT subscribe to free TAM service' do
before do
# License.current.usage_ping? == false
create_current_license(usage_ping_required_metrics_enabled: false)
create_current_license(operational_metrics_enabled: false)
end
it_behaves_like 'service ping payload with all expected metrics' do
......@@ -56,7 +56,7 @@ RSpec.describe ServicePing::BuildPayloadService do
context 'Instance subscribes to free TAM service' do
before do
# License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: true)
create_current_license(operational_metrics_enabled: true)
end
it_behaves_like 'service ping payload with all expected metrics' do
......@@ -71,7 +71,7 @@ RSpec.describe ServicePing::BuildPayloadService do
context 'Instance does NOT subscribe to free TAM service' do
before do
# License.current.usage_ping? == false
create_current_license(usage_ping_required_metrics_enabled: false)
create_current_license(operational_metrics_enabled: false)
end
it 'returns empty service ping payload' do
......
......@@ -36,10 +36,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
stub_config_setting(usage_ping_enabled: true)
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
# License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: true)
create_current_license(operational_metrics_enabled: true)
end
it 'returns all categories' do
......@@ -57,10 +57,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
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
# License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: false)
create_current_license(operational_metrics_enabled: false)
end
it 'returns all categories' do
......@@ -74,10 +74,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
stub_config_setting(usage_ping_enabled: false)
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
# License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: true)
create_current_license(operational_metrics_enabled: true)
end
it 'returns all categories' do
......@@ -85,10 +85,10 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
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
# License.current.usage_ping? == true
create_current_license(usage_ping_required_metrics_enabled: false)
create_current_license(operational_metrics_enabled: false)
end
it 'returns all categories' do
......@@ -124,7 +124,7 @@ RSpec.describe ServicePing::PermitDataCategoriesService do
before do
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)
create_current_license(usage_ping_required_metrics_enabled: customer_service_enabled)
create_current_license(operational_metrics_enabled: customer_service_enabled)
end
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