Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e5792375
Commit
e5792375
authored
Feb 18, 2021
by
ggelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove collect_package_events_redis feature flag
Remove the feature flag since it's already enabled by default.
parent
58829631
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
65 deletions
+12
-65
app/services/packages/create_event_service.rb
app/services/packages/create_event_service.rb
+6
-8
changelogs/unreleased/remove-pkg-event-redis-feature-flag.yml
...gelogs/unreleased/remove-pkg-event-redis-feature-flag.yml
+5
-0
config/feature_flags/development/collect_package_events_redis.yml
...eature_flags/development/collect_package_events_redis.yml
+0
-7
lib/gitlab/usage_data_counters/known_events/package_events.yml
...itlab/usage_data_counters/known_events/package_events.yml
+0
-24
lib/tasks/gitlab/packages/events.rake
lib/tasks/gitlab/packages/events.rake
+1
-2
spec/services/packages/create_event_service_spec.rb
spec/services/packages/create_event_service_spec.rb
+0
-24
No files found.
app/services/packages/create_event_service.rb
View file @
e5792375
...
...
@@ -3,7 +3,6 @@
module
Packages
class
CreateEventService
<
BaseService
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
|
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
track_event
(
event_name
,
values:
current_user
.
id
)
end
...
...
@@ -11,7 +10,6 @@ module Packages
::
Packages
::
Event
.
counters_for
(
event_scope
,
event_name
,
originator_type
).
each
do
|
event_name
|
::
Gitlab
::
UsageDataCounters
::
PackageEventCounter
.
count
(
event_name
)
end
end
if
Feature
.
enabled?
(
:collect_package_events
)
&&
Gitlab
::
Database
.
read_write?
::
Packages
::
Event
.
create!
(
...
...
changelogs/unreleased/remove-pkg-event-redis-feature-flag.yml
0 → 100644
View file @
e5792375
---
title
:
Removes collect_package_events_redis feature flag
merge_request
:
49897
author
:
type
:
other
config/feature_flags/development/collect_package_events_redis.yml
deleted
100644 → 0
View file @
58829631
---
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
lib/gitlab/usage_data_counters/known_events/package_events.yml
View file @
e5792375
...
...
@@ -3,119 +3,95 @@
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_composer_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_conan_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_conan_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_container_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_container_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_debian_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_debian_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_generic_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_generic_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_golang_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_golang_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_maven_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_maven_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_npm_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_npm_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_nuget_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_nuget_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_pypi_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_pypi_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_rubygems_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_rubygems_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_tag_deploy_token
category
:
deploy_token_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
-
name
:
i_package_tag_user
category
:
user_packages
aggregation
:
weekly
redis_slot
:
package
feature_flag
:
collect_package_events_redis
lib/tasks/gitlab/packages/events.rake
View file @
e5792375
...
...
@@ -51,8 +51,7 @@ namespace :gitlab do
"name"
=>
event_name
,
"category"
=>
"
#{
originator_type
}
_packages"
,
"aggregation"
=>
"weekly"
,
"redis_slot"
=>
"package"
,
"feature_flag"
=>
"collect_package_events_redis"
"redis_slot"
=>
"package"
}
end
...
...
spec/services/packages/create_event_service_spec.rb
View file @
e5792375
...
...
@@ -57,18 +57,6 @@ RSpec.describe Packages::CreateEventService do
end
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
expect
(
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
).
to
receive
(
:track_event
).
with
(
/package/
,
values:
user
.
id
)
...
...
@@ -77,18 +65,6 @@ RSpec.describe Packages::CreateEventService do
end
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
expect
(
::
Gitlab
::
UsageDataCounters
::
PackageEventCounter
).
to
receive
(
:count
).
at_least
(
:once
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment