Skip to content
代码片段 群组 项目
提交 e8c3643d 编辑于 作者: Mario Celi's avatar Mario Celi
浏览文件

Merge branch '415538-fixing-audit-event-entity' into 'master'

Replacing invalid audit event entity in project deletion with valid one

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127841



Merged-by: default avatarMario Celi <mcelicalderon@gitlab.com>
Approved-by: default avatarAaron Huntsman <ahuntsman@gitlab.com>
Approved-by: default avatarMario Celi <mcelicalderon@gitlab.com>
Co-authored-by: default avatarHitesh Raghuvanshi <hraghuvanshi@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -81,10 +81,12 @@ def log_geo_event(project)
end
def log_audit_event(project)
audit_scope = project.parent.instance_of?(::Namespaces::UserNamespace) ? project.parent.owner : project.parent
audit_context = {
name: 'project_destroyed',
author: current_user,
scope: project.parent,
scope: audit_scope,
target: project,
message: 'Project destroyed',
target_details: project.full_path,
......
......@@ -169,8 +169,8 @@
let(:attributes) do
{
author_id: user.id,
entity_id: project.parent.id,
entity_type: 'Namespaces::UserNamespace',
entity_id: user.id,
entity_type: 'User',
details: {
remove: 'project',
author_name: user.name,
......@@ -249,6 +249,7 @@
context 'system hooks exception' do
before do
allow_any_instance_of(SystemHooksService).to receive(:execute_hooks_for).and_raise('something went wrong')
stub_licensed_features(extended_audit_events: true)
end
it 'logs an audit event' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册