AI Catalog permissions and duo_features_enabled
What does this MR do and why?
Currently AI Catalog features are enabled if the project has opted- in to Experimental/Beta AI features. This check will eventually be removed when AI Catalog goes GA.
When the check is removed, currently it would make AI Catalog features available to any project that is Premium+.
This change is to check that the project has duo_features_enabled
,
which is a cascading setting that can be set at instance, group, or
project-level to signal if Duo features should run at that level.
Part of: https://gitlab.com/gitlab-org/gitlab/-/issues/568176
How to set up and validate locally
- Enable the
global_ai_catalog
feature flag - Visit http://gdk.test:3000/explore/ai-catalog/agents
- Using a project that has Duo Features enabled, a Premium+ license, and has opted-in to Experimental AI features, create an agent. Make sure you make the agent public. Note, if you've set up your environment and run
rake gitlab:duo:setup
you will have agitlab-duo
group that any project under can be used. - From the AI catalog, execute a Test Run for the agent (click
...
and select Test run). It should start a session successfully - Add the agent to a project. It should work. Visit the project's Automate > agents. You should be able to delete it.
- Now toggle Duo feature off for the project that owns the agent. Settings > General. Expand GitLab Duo. Toggle off GitLab Duo.
- Try adding an agent to the project. It should say you do not meet the prerequisites.
- Open GitLab in a new private browsing session, to view anonymously, visit http://gdk.test:3000/explore/ai-catalog/agents. You should still see the public agent that was created.
Try creating an agent through the GraphQL mutation, for the project, it should not let you. Replace <ID of project>
with the project ID.
mutation {
aiCatalogAgentCreate(input: {
projectId: "gid://gitlab/Project/<ID of project>"
name: "My name"
description: "My description"
public: false
systemPrompt: "My system prompt"
userPrompt: "My user prompt"
}) {
errors
item {
id
}
}
}
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 #568176