Skip to content

Blocks deletion of model if it is being used

What does this MR do and why?

Blocks deletion of model if it is being used

When a self-hosted model is being used to power a feature setting, we prevent its deletion

MR acceptance checklist

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

Screenshots or screen recordings

2024-10-02_10.19.36

Before After
Table image image
Deletion modal image

How to set up and validate locally

Prequisites

You will need an active GitLab ultimate license.

  1. Start GDK instance in self-managed mode:

GITLAB_SIMULATE_SAAS=0 && gdk start

  1. In the rails console, enable Code Suggestions and the custom models experiment:
Feature.enable(:ai_custom_model)
ApplicationSetting.first.update(duo_features_enabled: true)
  1. Enable the admin ai-powered feature settings FF
Feature.enable(:custom_models_feature_settings_vue_app)

Test it!

  1. Log in as an admin
  2. Visit the page Admin Area > AI-Powered Features > Self-hosted models
  3. Create a mistral self-hosted model
  4. Visit Admin Area > AI-Powered Features > Features
  5. Set DuoChat, select 'self-hosted models' and select the model you created. click on save changes image
  6. Navigate back and try to delete the model, it shouldn't be possible

Related to #476258 (closed)

Edited by Eduardo Bonet

Merge request reports

Loading