Commit 24aa8fcd authored by Igor Drozdov's avatar Igor Drozdov

Fix 2.7 warnings for usage data code area

It fixes Ruby warnings and removes the files from
deprecations list
parent 8632edaa
......@@ -446,10 +446,10 @@ module EE
pipelines_with_secure_jobs[metric_name.to_sym] =
if start_id && finish_id
estimate_batch_distinct_count(relation, :commit_id, batch_size: 1000, start: start_id, finish: finish_id) do |result|
save_aggregated_metrics(aggregated_metrics_params.merge(data: result))
save_aggregated_metrics(**aggregated_metrics_params.merge({ data: result }))
end
else
save_aggregated_metrics(aggregated_metrics_params.merge(data: ::Gitlab::Database::PostgresHll::Buckets.new))
save_aggregated_metrics(**aggregated_metrics_params.merge({ data: ::Gitlab::Database::PostgresHll::Buckets.new }))
0
end
end
......
......@@ -55,8 +55,6 @@ module DeprecationToolkitEnv
# one by one
def self.allowed_kwarg_warning_paths
%w[
ee/lib/ee/gitlab/usage_data.rb
spec/lib/gitlab/utils/usage_data_spec.rb
spec/support/gitlab_experiment.rb
spec/support/helpers/next_instance_of.rb
rspec-mocks-3.10.0/lib/rspec/mocks/message_expectation.rb
......@@ -70,8 +68,6 @@ module DeprecationToolkitEnv
grape_logging-1.8.3/lib/grape_logging/middleware/request_logger.rb
activesupport-6.0.3.4/lib/active_support/cache.rb
factory_bot-6.1.0/lib/factory_bot/decorator.rb
doorkeeper-5.4.0/lib/doorkeeper/models/access_token_mixin.rb
rouge-3.26.0/lib/rouge/formatter.rb
batch-loader-1.4.0/lib/batch_loader/graphql.rb
carrierwave-1.3.1/lib/carrierwave/sanitized_file.rb
activerecord-6.0.3.4/lib/active_record/relation.rb
......
......@@ -397,7 +397,7 @@ RSpec.describe Gitlab::Utils::UsageData do
expect(redis).to receive(:set).with("#{metric_name}_#{time_period_name}-#{timestamp}", '{"141":1,"56":1}', ex: 80.hours)
end
described_class.save_aggregated_metrics(method_params)
described_class.save_aggregated_metrics(**method_params)
end
context 'error handling' do
......@@ -406,7 +406,7 @@ RSpec.describe Gitlab::Utils::UsageData do
end
it 'rescues and reraise ::Redis::CommandError for development and test environments' do
expect { described_class.save_aggregated_metrics(method_params) }.to raise_error ::Redis::CommandError
expect { described_class.save_aggregated_metrics(**method_params) }.to raise_error ::Redis::CommandError
end
context 'for environment different than development' do
......@@ -415,7 +415,7 @@ RSpec.describe Gitlab::Utils::UsageData do
end
it 'rescues ::Redis::CommandError' do
expect { described_class.save_aggregated_metrics(method_params) }.not_to raise_error
expect { described_class.save_aggregated_metrics(**method_params) }.not_to raise_error
end
end
end
......@@ -434,12 +434,12 @@ RSpec.describe Gitlab::Utils::UsageData do
expect(redis).not_to receive(:set)
end
described_class.save_aggregated_metrics(method_params)
described_class.save_aggregated_metrics(**method_params)
end
end
it 'raises error for development environment' do
expect { described_class.save_aggregated_metrics(method_params) }.to raise_error /Unsupported data type/
expect { described_class.save_aggregated_metrics(**method_params) }.to raise_error /Unsupported data type/
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