feat: Add duo_session_resumed audit event for DAP sessions
Relates to issue #585213 (closed)
Changes
This MR implements the missing duo_session_resumed audit event for Duo Agent Platform (DAP) sessions, providing full parity with other session lifecycle audit events.
Key Changes:
-
Created Audit Event Type Definition (
ee/config/audit_events/types/duo_session_resumed.yml)- New audit event type following the pattern from
duo_session_started.yml - Configured with name
duo_session_resumedand description "Duo session is resumed" - Set to save to database, stream events, and scope to Project
- Referenced MR !216689 (merged) and milestone 18.8
- New audit event type following the pattern from
-
Updated Service Configuration (
ee/app/services/ai/duo_workflows/update_workflow_status_service.rb)- Added
'resume'entry toAUDIT_EVENT_CONFIGhash - Configuration:
'resume' => { name: 'duo_session_resumed', message: 'Resumed Duo session' } - Audit event triggers automatically via existing
audit_event_for_status_changemethod
- Added
-
Updated Documentation (
doc/user/compliance/audit_event_types.md)- Added new table row for
duo_session_resumedin the Duo agent platform section - Includes link to MR !216689 (merged), description, database save status, GitLab version 18.8, and Project scope
- Maintains alphabetical ordering within the section
- Added new table row for
-
Added Comprehensive Test Coverage (
ee/spec/services/ai/duo_workflows/update_workflow_status_service_spec.rb)- Test case for audit event creation when resuming a workflow
- Verifies correct parameters: name, author, scope, target, and message
- Error handling test to ensure workflow updates continue even when audit logging fails
- Validates workflow status transitions correctly despite audit errors
The implementation maintains consistency with existing codebase patterns and provides the same level of audit tracking for resume events as other DAP session lifecycle events (start, finish, drop, stop).