Stream audit event for project fork action
What does this MR do and why?
Stream audit event for project fork action.
How to set up and validate locally
- run rails console and execute below code to enter destination url
group = group.find 1 #replace with your group id here
destination_url = 'https://audit-event.requestcatcher.com/'
AuditEvents::ExternalAuditEventDestination.create(namespace_id: group.id, destination_url: destination_url)
- Run
gdk start
. - Fork a project under group.
- you can view audit event stream of approval action on https://audit-event.requestcatcher.com/
Example streaming json payload
{
"id": 1,
"author_id": 1,
"entity_id": 24,
"entity_type": "Project",
"details": {
"author_name": "example-user",
"target_id": 24,
"target_type": "Project",
"target_details": "example-project",
"custom_message": "Forked project to to-group/example-project",
"ip_address": "127.0.0.1",
"entity_path": "from-group/example-project"
},
"ip_address": "127.0.0.1",
"author_name": "example-user",
"entity_path": "from-group/example-project",
"target_details": "tp",
"created_at": "2022-07-04T00:32:34.512Z",
"target_type": "Project",
"target_id": 24,
"event_type": "project_fork_operation"
}
/cc @daveliu
Edited by Linjie Zhang