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
853ecc0e
Commit
853ecc0e
authored
Nov 20, 2020
by
Douglas Barbosa Alexandre
Committed by
Michael Kozono
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Does not track package events on a read-only instance
parent
44383761
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
app/services/packages/create_event_service.rb
app/services/packages/create_event_service.rb
+1
-1
changelogs/unreleased/285475-cannot-list-container-repository-registries-and-images-on-geo-seco.yml
...ontainer-repository-registries-and-images-on-geo-seco.yml
+5
-0
spec/services/packages/create_event_service_spec.rb
spec/services/packages/create_event_service_spec.rb
+11
-1
No files found.
app/services/packages/create_event_service.rb
View file @
853ecc0e
...
...
@@ -7,7 +7,7 @@ module Packages
::
Gitlab
::
UsageDataCounters
::
HLLRedisCounter
.
track_event
(
current_user
.
id
,
redis_event_name
)
end
if
Feature
.
enabled?
(
:collect_package_events
)
if
Feature
.
enabled?
(
:collect_package_events
)
&&
Gitlab
::
Database
.
read_write?
::
Packages
::
Event
.
create!
(
event_type:
event_name
,
originator:
current_user
&
.
id
,
...
...
changelogs/unreleased/285475-cannot-list-container-repository-registries-and-images-on-geo-seco.yml
0 → 100644
View file @
853ecc0e
---
title
:
Does not track package events on a read-only instance
merge_request
:
48257
author
:
type
:
fixed
spec/services/packages/create_event_service_spec.rb
View file @
853ecc0e
...
...
@@ -25,7 +25,7 @@ RSpec.describe Packages::CreateEventService do
stub_feature_flags
(
collect_package_events:
false
)
end
it
'does not create an event
object
'
do
it
'does not create an event'
do
expect
{
subject
}.
not_to
change
{
Packages
::
Event
.
count
}
end
end
...
...
@@ -43,6 +43,16 @@ RSpec.describe Packages::CreateEventService do
expect
(
subject
.
event_scope
).
to
eq
(
expected_scope
)
expect
(
subject
.
event_type
).
to
eq
(
event_name
)
end
context
'on a read-only instance'
do
before
do
allow
(
Gitlab
::
Database
).
to
receive
(
:read_only?
).
and_return
(
true
)
end
it
'does not create an event'
do
expect
{
subject
}.
not_to
change
{
Packages
::
Event
.
count
}
end
end
end
end
...
...
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