Skip to content

Model Registry: Get latest Semantic Version

What does this MR do and why?

This MR changes the behavior of the endpoint ml/get_latest_versions it now returns the highest / latest Semantic Version instead of the highest ID. Allowing users to provide beta releases, patch versions for older models, etc while still pointing to the latest / highest released version.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Open GDK: http://127.0.0.1:3000/flightjs/Flight/-/ml/models
  2. Create model if one doesn't exist, give it a model name and version (1.0.0, click Create
  3. Create another model version for the same model with a lower server e.g. 0.0.1
  4. Perform the following cURL
curl -X GET --header "Authorization: Bearer glpat-<redacted>" "http://127.0.0.1:3000/api/v4/projects/7/ml/mlflow/api/2.0/mlflow/registered-models/get-latest-versions?name=<model-name>"
  1. This should return version 1.0.0, note the version name is presented in the key aliases.
{"model_versions":[{"name":"my-model2","version":"17","creation_timestamp":1726563129,"last_updated_timestamp":1726814967,"user_id":null,"current_stage":"development","description":"abc","source":"http://127.0.0.1:3000/flightjs/Flight/-/ml/models/4/versions/17","run_id":"beb67dce-a0ca-4e6d-b171-c34351505aa9","status":"READY","status_message":"","tags":[],"run_link":"","aliases":["1.0.0"]}]}

Numbered steps to set up and validate the change are strongly suggested.

Related to #428644

Edited by Fred de Gier

Merge request reports