Migrates show_ml_model_version to graphql
What does this MR do and why?
Migrates show_ml_model_version to graphql
Updates components so what show_ml_model_version fetches the version data using graphql instead of passing as a prop.
An intermediary state for ModelVersionDetail was added since https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/ml/model_registry/components/model_detail.vue still uses it. Once show_ml_model is migrated, we can clean up this intermediary state.
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
Error | Loaded data |
---|---|
![]() |
![]() |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
In rails console enable the experiment fully and create a model and model version
Feature.enable(:model_registry) p = Project.find_by(id: 1) Ml::CreateModelService.new(p, "model_1").execute version = Ml::FindOrCreateModelVersionService.new(p, { model_name: "model_1", version: "1.0.0" }).execute candidate = version.candidate Ml::CandidateParam.create!(candidate: candidate, name: 'param1', value: 'value1') Ml::CandidateMetadata.create!(candidate: candidate, name: 'metadata1', value: 'metadataValue1') Ml::CandidateMetric.create!(candidate: candidate, name: 'metric1', value: 0.3, step: 0)
-
Visit the project where the model was created
-
Click on
Deploy > Model registry
, and navigate to the created model, select the latest version -
Verify everything is rendered as previously
-
Click on the overflow menu, than on delete, and verify the model is deleted.