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
581dd9b8
Commit
581dd9b8
authored
Nov 30, 2021
by
Max Woolf
Committed by
Stan Hu
Nov 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle event streaming licence error when no entity
parent
18c34a49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
ee/app/models/ee/audit_event.rb
ee/app/models/ee/audit_event.rb
+1
-1
ee/spec/models/ee/audit_event_spec.rb
ee/spec/models/ee/audit_event_spec.rb
+14
-0
No files found.
ee/app/models/ee/audit_event.rb
View file @
581dd9b8
...
...
@@ -57,7 +57,7 @@ module EE
def
stream_to_external_destinations
return
if
entity
.
nil?
return
unless
::
Feature
.
enabled?
(
:ff_external_audit_events_namespace
,
group_entity
)
return
unless
group_entity
.
licensed_feature_available?
(
:external_audit_events
)
return
unless
group_entity
&
.
licensed_feature_available?
(
:external_audit_events
)
AuditEvents
::
AuditEventStreamingWorker
.
perform_async
(
id
)
end
...
...
ee/spec/models/ee/audit_event_spec.rb
View file @
581dd9b8
...
...
@@ -101,6 +101,20 @@ RSpec.describe AuditEvent, type: :model do
event
.
stream_to_external_destinations
end
context
'when entity is not a group or project'
do
let_it_be
(
:event
)
{
create
(
:user_audit_event
)
}
before
do
stub_feature_flags
(
ff_external_audit_events_namespace:
true
)
end
it
'enqueues no workers'
do
expect
(
AuditEvents
::
AuditEventStreamingWorker
).
not_to
receive
(
:perform_async
)
event
.
stream_to_external_destinations
end
end
end
context
'when ff_external_audit_events_namespace is disabled'
do
...
...
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