BE: Allow AI Catalog flows to be at Beta maturity level, while other AI Catalog features are GA
About
There is a frontend counterpart issue for this: #578140 (closed).
Currently, the entire AI Catalog is at the same maturity level (Experiment, and soon GA).
However, flows should not be part of the AI catalog's GA, and should independently move from Experiment -> Beta -> GA.
Problem
Customers must opt in to Experimental and Beta AI Features to use them. This allows customers control over the maturity-level of the AI features they use.
Otherwise, they should not be able to use those features.
The UX should also clearly differentiate which features are at which maturity level.
Proposal
In addition to the existing ai_catalog feature, add ai_catalog_flows into Gitlab::Llm::Utils::AiFeaturesCatalogue, and Gitlab::Llm::StageCheck.
Update our permission policy checks to include additional checks that the project supports the feature maturity of flows if the item is a flow.
`Gitlab::Llm::StageCheck.available?(project, :ai_catalog_flows)`
`Gitlab::Llm::StageCheck.available?(group, :ai_catalog_flows)`
Update Ai::Catalog::Flows::CreateService to disallow creation if the project does not pass its stage check for flows.
Update Ai::Catalog::ItemConsumers::CreateService to disallow creation if the project or group does not pass its stage check for flows.
The idea is we want to:
- Deny mutating AI Catalog items if the project/group does not pass
StageCheck - Deny enabling AI Catalog items if the project/group does not pass
StageCheck - Deny reading AI Catalog items - unless the item is public.
We also want to make some booleans available to the frontend so they can show/hide the flow feature at the project-level and group-level, alongside feature flag checks. See #578140 (closed). Work with a frontend dev to guide the best way to pass these booleans to the frontend.