Commit 0834be2c authored by David Fernandez's avatar David Fernandez

Merge branch 'remove-pkg-event-redis-feature-flag' into 'master'

Removes collect_package_events_redis feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!49897
parents 82bdb762 e5792375
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
module Packages module Packages
class CreateEventService < BaseService class CreateEventService < BaseService
def execute def execute
if Feature.enabled?(:collect_package_events_redis, default_enabled: true)
::Packages::Event.unique_counters_for(event_scope, event_name, originator_type).each do |event_name| ::Packages::Event.unique_counters_for(event_scope, event_name, originator_type).each do |event_name|
::Gitlab::UsageDataCounters::HLLRedisCounter.track_event(event_name, values: current_user.id) ::Gitlab::UsageDataCounters::HLLRedisCounter.track_event(event_name, values: current_user.id)
end end
...@@ -11,7 +10,6 @@ module Packages ...@@ -11,7 +10,6 @@ module Packages
::Packages::Event.counters_for(event_scope, event_name, originator_type).each do |event_name| ::Packages::Event.counters_for(event_scope, event_name, originator_type).each do |event_name|
::Gitlab::UsageDataCounters::PackageEventCounter.count(event_name) ::Gitlab::UsageDataCounters::PackageEventCounter.count(event_name)
end end
end
if Feature.enabled?(:collect_package_events) && Gitlab::Database.read_write? if Feature.enabled?(:collect_package_events) && Gitlab::Database.read_write?
::Packages::Event.create!( ::Packages::Event.create!(
......
---
title: Removes collect_package_events_redis feature flag
merge_request: 49897
author:
type: other
---
name: collect_package_events_redis
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46846
rollout_issue_url:
group: group::package
type: development
default_enabled: true
...@@ -3,119 +3,95 @@ ...@@ -3,119 +3,95 @@
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_composer_user - name: i_package_composer_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_conan_deploy_token - name: i_package_conan_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_conan_user - name: i_package_conan_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_container_deploy_token - name: i_package_container_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_container_user - name: i_package_container_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_debian_deploy_token - name: i_package_debian_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_debian_user - name: i_package_debian_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_generic_deploy_token - name: i_package_generic_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_generic_user - name: i_package_generic_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_golang_deploy_token - name: i_package_golang_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_golang_user - name: i_package_golang_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_maven_deploy_token - name: i_package_maven_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_maven_user - name: i_package_maven_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_npm_deploy_token - name: i_package_npm_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_npm_user - name: i_package_npm_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_nuget_deploy_token - name: i_package_nuget_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_nuget_user - name: i_package_nuget_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_pypi_deploy_token - name: i_package_pypi_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_pypi_user - name: i_package_pypi_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_rubygems_deploy_token - name: i_package_rubygems_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_rubygems_user - name: i_package_rubygems_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_tag_deploy_token - name: i_package_tag_deploy_token
category: deploy_token_packages category: deploy_token_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
- name: i_package_tag_user - name: i_package_tag_user
category: user_packages category: user_packages
aggregation: weekly aggregation: weekly
redis_slot: package redis_slot: package
feature_flag: collect_package_events_redis
...@@ -51,8 +51,7 @@ namespace :gitlab do ...@@ -51,8 +51,7 @@ namespace :gitlab do
"name" => event_name, "name" => event_name,
"category" => "#{originator_type}_packages", "category" => "#{originator_type}_packages",
"aggregation" => "weekly", "aggregation" => "weekly",
"redis_slot" => "package", "redis_slot" => "package"
"feature_flag" => "collect_package_events_redis"
} }
end end
......
...@@ -57,18 +57,6 @@ RSpec.describe Packages::CreateEventService do ...@@ -57,18 +57,6 @@ RSpec.describe Packages::CreateEventService do
end end
shared_examples 'redis package unique event creation' do |originator_type, expected_scope| shared_examples 'redis package unique event creation' do |originator_type, expected_scope|
context 'with feature flag disable' do
before do
stub_feature_flags(collect_package_events_redis: false)
end
it 'does not track the event' do
expect(::Gitlab::UsageDataCounters::HLLRedisCounter).not_to receive(:track_event)
subject
end
end
it 'tracks the event' do it 'tracks the event' do
expect(::Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:track_event).with(/package/, values: user.id) expect(::Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:track_event).with(/package/, values: user.id)
...@@ -77,18 +65,6 @@ RSpec.describe Packages::CreateEventService do ...@@ -77,18 +65,6 @@ RSpec.describe Packages::CreateEventService do
end end
shared_examples 'redis package count event creation' do |originator_type, expected_scope| shared_examples 'redis package count event creation' do |originator_type, expected_scope|
context 'with feature flag disabled' do
before do
stub_feature_flags(collect_package_events_redis: false)
end
it 'does not track the event' do
expect(::Gitlab::UsageDataCounters::PackageEventCounter).not_to receive(:count)
subject
end
end
it 'tracks the event' do it 'tracks the event' do
expect(::Gitlab::UsageDataCounters::PackageEventCounter).to receive(:count).at_least(:once) expect(::Gitlab::UsageDataCounters::PackageEventCounter).to receive(:count).at_least(:once)
......
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