Skip to content

Refactor CreateModelVersionService to return a ServiceResponse

What does this MR do and why?

CreateModelVersionService didn't conform to our style of returning a ServiceResponse, this refactors the return type and updates the consumers

How to set up and validate locally

  1. Enable model registry and create a model in a project
Feature.enable(:model_registry)
project = Project.find(26)
model = Ml::CreateModelService.new(project, 'FooModel20').execute.payload
puts model.id
  1. Use http://gdk.test:3000/-/graphql-explorer and create some versions
mutation {
  mlModelVersionCreate(input: { projectPath: "g1/p2", modelId: "gid://gitlab/Ml::Model/20" }) {
    modelVersion{
      version
      id
    }
    errors
  }
}

Related to #462868 (closed)

Edited by Eduardo Bonet

Merge request reports