Added new table and API for Workflow Events

What does this MR do and why?

This MR introduces the object required to support Human in the loop for Duo Workflows. We need to be able to store human events and associate them to the workflow.

Refer to this issue for a detailed design: #487382 (comment 2102734264)

  • Added new table and API for Workflow Events
  • Added new table for Workflow Events and an API to be able to insert events

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable duo_workflows feature flag
  2. Create a workflow (this can be done via the IDE)
  3. Test creating an event with the following API call
curl -X POST \
    -H "Authorization: Bearer $GITLAB_TOKEN"  \
    -H "Content-Type: application/json" \
    -d '{
        "event_type":"message"
        "message": "test message"
    }' \
    http://gdk.test:3000/api/v4/ai/duo_workflows/workflows/<workflow_id>/events
  1. Test fetching existing events
curl -X GET \
    -H "Authorization: Bearer $GITLAB_TOKEN"  \
    http://localhost:3000/api/v4/ai/duo_workflows/workflows/<workflow_id>/events
  1. Test updating the status of an event
curl -X PUT \
    -H "Authorization: Bearer $GITLAB_TOKEN"  \
    -H "Content-Type: application/json" \
    -d '{
        "event_status": "Delivered"
    }' \
    http://localhost:3000/api/v4/ai/duo_workflows/workflows/<workflow_id>/events/1
Edited by Shekhar Patnaik

Merge request reports

Loading