Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37062 - Rename pulpcore::telemetry to pulpcore::analytics #326

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@
# @param loggers
# Configure additional loggers or override pre-defined logger configuration.
#
# @param telemetry
# Configure TELEMETRY in settings.yml, which controls the reporting of anonymous data to https://analytics.pulpproject.org/,
# @param analytics
# Configure ANALYTICS in settings.yml, which controls the reporting of anonymous data to https://analytics.pulpproject.org/,
# starting with Pulpcore version 3.21.0, to guide Pulp project developers. Set this to false to opt out of this anonymous reporting;
# if undef, it will instead be omitted from settings.yml and Pulp will report these usage statistics per its default behavior.
# Adding this configuration will have no effect in Pulp versions prior to the introduction of the telemetry feature.
# Originally, the pulp setting was called TELEMETRY and this param was called telemetry; it was renamed by the pulp developers.
#
# @param hide_guarded_distributions
# If activated, the distributions that are protected by a content guard will not be shown on the
Expand Down Expand Up @@ -254,7 +254,7 @@
Optional[Variant[Integer[1], Enum['None']]] $cache_expires_ttl = undef,
Pulpcore::LogLevel $log_level = 'INFO',
Hash[String[1], Pulpcore::Logger] $loggers = {},
Optional[Boolean] $telemetry = undef,
Optional[Boolean] $analytics = undef,
Optional[Boolean] $hide_guarded_distributions = undef,
Optional[Integer[1,100]] $import_workers_percent = undef,
) {
Expand Down
29 changes: 7 additions & 22 deletions spec/acceptance/settings_spec.rb
Original file line number Diff line number Diff line change
@@ -1,52 +1,37 @@
require 'spec_helper_acceptance'

describe 'TELEMETRY setting' do
context 'default TELEMETRY' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
include pulpcore
PUPPET
end
end

describe file('/etc/pulp/settings.py') do
it { is_expected.to be_file }
its(:content) { is_expected.to match(/^# TELEMETRY = False$/) }
end
end

context 'TELEMETRY disabled' do
describe 'ANALYTICS setting' do
context 'ANALYTICS disabled' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'pulpcore':
telemetry => false,
analytics => false,
}
PUPPET
end
end

describe file('/etc/pulp/settings.py') do
it { is_expected.to be_file }
its(:content) { is_expected.to match(/^TELEMETRY = False$/) }
its(:content) { is_expected.to match(/^ANALYTICS = False$/) }
end
end

context 'TELEMETRY enabled' do
context 'ANALYTICS enabled' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'pulpcore':
telemetry => true,
analytics => true,
}
PUPPET
end
end

describe file('/etc/pulp/settings.py') do
it { is_expected.to be_file }
its(:content) { is_expected.to match(/^TELEMETRY = True$/) }
its(:content) { is_expected.to match(/^ANALYTICS = True$/) }
end
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.with_content(%r{ALLOWED_CONTENT_CHECKSUMS = \["sha224", "sha256", "sha384", "sha512"\]})
.with_content(%r{REDIS_URL = "redis://localhost:6379/8"})
.with_content(%r{CACHE_ENABLED = False})
.with_content(%r{# ANALYTICS = False})
.without_content(%r{sslmode})
.without_content(%r{WORKER_TTL})
is_expected.to contain_concat__fragment('logging').with_content(<<~LOGGING)
Expand Down
6 changes: 3 additions & 3 deletions templates/settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# Send anonymous usage data to https://analytics.pulpproject.org/ unless this is
# explicitly defined with value False. This data is used by the Pulp project
# to make informed, data-driven decisions about future feature development.
<% if scope['pulpcore::telemetry'].nil? -%>
# TELEMETRY = False
<% if scope['pulpcore::analytics'].nil? -%>
# ANALYTICS = False
<% else -%>
TELEMETRY = <%= scope.call_function('to_python', [scope['pulpcore::telemetry']]) %>
ANALYTICS = <%= scope.call_function('to_python', [scope['pulpcore::analytics']]) %>
<% end -%>

CONTENT_ORIGIN = "https://<%= scope['pulpcore::servername'] %>"
Expand Down