Skip to content

Creates MlModelDelete mutation to replace MlModelDestroy

What does this MR do and why?

To better align with our usage of GraphQL, mlModelDestroy needs to be changed to mlModelDelete and the return type needs to be the model. The first step is to add new mutation mlModelDelete so that we can then change the frontend, otherwise the frontend can be deployed beforehand and will try to access an mlModelDelete that doesn't exist yet.

Deleting mlModelDestroy and changing the frontend to call mlModelDelete are followups.

How to set up and validate locally

  1. In rails console enable the experiment fully, and create a model

    Feature.enable(:model_registry)
    p = Project.find_by(id: 1)
    Ml::FindOrCreateModelService.new(p, "model_1").execute 
  2. Navigate to <gdk>/-/graphql-explorer, and execute the following mutation (replace values with your project and model id):

    mutation {
      mlModelDelete(input: { projectPath: "root/test-project", id: "gid://gitlab/Ml::Model/1" }){
        errors
      }
    }
    
  3. Model should be deleted without returning errors

Related to #461047 (closed)

Edited by Eduardo Bonet

Merge request reports

Loading