Commit b8506107 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'bvl-remove-dependency-list-usage-count' into 'master'

Remove dependency_list usage counter

See merge request gitlab-org/gitlab!82604
parents 4f59fcd2 47d21186
# frozen_string_literal: true
class RemoveDependencyListUsageDataFromRedis < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
Gitlab::Redis::SharedState.with { |r| r.del("DEPENDENCY_LIST_USAGE_COUNTER") }
end
def down
# no-op
end
end
39785d4140c7345ddbe62417576381654ce22d505ee5c92a84425f0a3f8e4935
\ No newline at end of file
......@@ -18,8 +18,6 @@ module Projects
render status: :ok
end
format.json do
::Gitlab::UsageCounters::DependencyList.increment(project.id)
render json: serializer.represent(dependencies, build: report_service.build)
end
end
......
......@@ -7,7 +7,8 @@ product_stage: secure
product_group: group::composition analysis
product_category: dependency_scanning
value_type: number
status: active
status: removed
milestone_removed: "14.9"
time_frame: all
data_source: redis
distribution:
......
......@@ -191,7 +191,6 @@ module EE
usage_data[:counts].merge!(
{
confidential_epics: count(::Epic.confidential),
dependency_list_usages_total: redis_usage_data { ::Gitlab::UsageCounters::DependencyList.usage_totals[:total] },
epics: count(::Epic),
epic_issues: count(::EpicIssue),
geo_nodes: count(::GeoNode),
......
# frozen_string_literal: true
module Gitlab
module UsageCounters
class DependencyList < Common
def self.base_key
'DEPENDENCY_LIST_USAGE_COUNTER'
end
end
end
end
......@@ -43,16 +43,6 @@ RSpec.describe Projects::DependenciesController do
end
end
context 'when usage ping is collected' do
let(:user) { developer }
it 'counts usage of the feature' do
expect(::Gitlab::UsageCounters::DependencyList).to receive(:increment).with(project.id)
get :index, params: params, format: :json
end
end
context 'with existing report' do
let_it_be(:pipeline) { create(:ee_ci_pipeline, :with_dependency_list_report, project: project) }
......
......@@ -93,7 +93,6 @@ RSpec.describe Gitlab::UsageData do
container_scanning_jobs
coverage_fuzzing_jobs
dast_jobs
dependency_list_usages_total
dependency_scanning_jobs
epics
epics_deepest_relationship_level
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::UsageCounters::DependencyList, :clean_gitlab_redis_shared_state do
it_behaves_like 'a usage counter'
end
# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe RemoveDependencyListUsageDataFromRedis, :migration, :clean_gitlab_redis_shared_state do
let(:key) { "DEPENDENCY_LIST_USAGE_COUNTER" }
describe "#up" do
it 'removes the hash from redis' do
with_redis do |redis|
redis.hincrby(key, 1, 1)
redis.hincrby(key, 2, 1)
end
expect { migrate! }.to change { with_redis { |r| r.hgetall(key) } }.from({ '1' => '1', '2' => '1' }).to({})
end
end
def with_redis(&block)
Gitlab::Redis::SharedState.with(&block)
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