Disallow creation of new external agents

What does this MR do and why?

This MR disallows the creation of new external agents except for users that have a new feature flag enabled for them.

The requirements from https://gitlab.com/gitlab-org/gitlab/-/work_items/583687:

  1. Remove ability to create new external agents
  2. Remove ability to configure new manually created external agents https://gitlab.com/gitlab-org/gitlab/-/work_items/583687#note_2984091046
  3. Allow users to invoke previously created external byok agents until further notice
  4. Allow users to continue to edit previously created external byok agents until further notice
  5. Allow users to continue to enable previously created external byok agents until further notice - this includes the handful of existing public external agents that have been created by customers

References

Screenshots or screen recordings

Creating an agent at explore-level, removes ability to select type (defaulting to custom agent creation):

Before After (when flag is disabled)
image image

How to set up and validate locally

Enable the following (existing) feature flags

Feature.enable(:global_ai_catalog)
Feature.enable(:ai_catalog_third_party_flows)

In this state, you should NOT be able to create external agents.

  • Go to http://gdk.test:3000/explore/ai-catalog/agents/new. You should not see the option to create an external agent.
  • Go to project's Automate > Agents page, and select New agent. You should not see the option to create an external agent.
  • Go to project's Automate > Triggers page.
    • Select New trigger. You should not see the option to create a trigger with a configuration path.
    • Any existing triggers that were defined with a configuration path will remain visible, and editable. Including the ability to change its configuration path.
    • You can edit an existing trigger for an AI Catalog item but you cannot switch it to one with a configuration path.

But you can:

  • Enable, disable and trigger existing external agents that have been created/enabled.
  • Edit existing external agents at explore and project-level

If you also disable the flows and external agents flags:

Feature.disable(:ai_catalog_flows)
Feature.disable(:ai_catalog_third_party_flows)

You should not see the New trigger button any longer on the Automate > Triggers page. This is because you can no longer create a new trigger in this state (AI catalog flows, and external agents are disabled, and the ability to create a new "manual" external agent with a configuration path is also disabled).

Now enable the new flag:

Feature.enable(:ai_catalog_create_third_party_flows) # New flag
Feature.enable(:ai_catalog_third_party_flows) # Re-enable this flag too if you disabled it in the above step

You should now be able to do all of the listed things you were previously not allowed to do.

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 #583687

Edited by Luke Duncalfe

Merge request reports

Loading