Return specific error message when DWS unavailable

What does this MR do and why?

This MR updates the flow config validation error message to factor if the validation step failed due to DWS being unavailable, versus, the flow config actually be invalid.

References

https://gitlab.com/gitlab-org/gitlab/-/work_items/607417+ !251744 (comment 3739011962)

How to set up and validate locally

Create a custom flow https://docs.gitlab.com/user/duo_agent_platform/flows/custom/#create-a-flow.

Enable the flow in a project https://docs.gitlab.com/user/duo_agent_platform/flows/custom/#enable-a-flow.

Update the flow's latest version to be invalid.

version = Ai::Catalog::Item.find(<flow id>).latest_version
version.definition = { 'foo' => 'bar' }
version.save(validate: false)

Find the flow in the project AI > Flows page, click on it to view it. Scroll to the triggers section, and click Edit to edit the triggers.

Verify that adding a new trigger event results in a message that the flow is invalid:

image

Now stop Duo Workflow Service so it is unavailable:

gdk stop duo-workflow-service

Try to save the new trigger event again, this time you should get a message that Duo Workflow Service is unavailable:

image

MR acceptance checklist

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

Related to #607417

Edited by Luke Duncalfe

Merge request reports

Loading
Loading