Validate released flows have at least 1 step
What does this MR do and why?
We need to ensure that released flows have at least 1 step defined.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Enable the
global_ai_catalogfeature flag - Create a flow without any steps, which has not yet been released:
mutation {
aiCatalogFlowCreate(
input: {name: "Test flow", description: "Test flow", projectId: "gid://gitlab/Project/1000000", public: true, steps: []}
) {
errors
item {
id
}
}
}
- Update the flow to release it, and observe that there will be an error:
mutation {
aiCatalogFlowUpdate(input: {
id: "gid://gitlab/Ai::Catalog::Item/<REPLACE_WITH_ID_OF_FLOW>"
release: true
}) {
errors
}
}
- Create an agent
mutation {
aiCatalogAgentCreate(
input: {name: "Name", description: "An agent", projectId: "gid://gitlab/Project/1000000", systemPrompt: "sys", userPrompt: "user", public: true, release: true}
) {
errors
item {
id
}
}
}
- Attempt to release the version with steps defined:
mutation {
aiCatalogFlowUpdate(input: {
id: "gid://gitlab/Ai::Catalog::Item/<REPLACE_WITH_ID_OF_FLOW>"
release: true
steps: [{ agentId: "gid://gitlab/Ai::Catalog::Item/<REPACE_WITH_ID_OF_AGENT>" }]
}) {
errors
}
}
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 #565649 (closed)
Edited by Keeyan Nejad