Rails endpoints to update workflow status

What does this MR do and why?

This MR adds an endpoint which will be used to mark a workflow as failed or finished.

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.

Example below:

  1. Enable feature flag duo_workflow
  2. Create a workflow
    curl POST --verbose \                                                                              
     --header "Authorization: Bearer [YOUR_TOKEN]" \
     --header 'Content-Type: application/json' \
     --data '{
         "project_id": "[namespace/project]"
     }' \
     http://gdk.test:3000/api/v4/ai/duo_workflows/workflows
  3. Get the id from the returned json
  4. Make a request to mark the workflow as failed
    curl --request PATCH --verbose \                                                                            
     --header "Authorization: Bearer [YOUR_TOKEN]" \
     --header 'Content-Type: application/json' \
     --data '{"status_event": "drop"}' \
     http://gdk.test:3000/api/v4/ai/duo_workflows/workflows/[id from above]
  5. You should receive a success response. The status in the json body should be 4 (enum for failed)

Closes #482003 (closed)

Edited by Halil Coban

Merge request reports

Loading