Skip to content

Adding SemanticVersionable concern to Ml::ModelVersion

What does this MR do and why?

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/42864+ this MR splits out the semver components for an ML Model Version's version attribute. When given a valid semver, this change will persist major, minor, patch, and prerelease attributes to the model so they can be queried via SQL. This MR also extracts the parsing and validation logic to the SemanticVersionable concern so it can be used by other models needing the same capabilities.

Proposed rollout

  1. Add the concern and the migration to add the columns to the DB. (this MR)
  2. Create and run a backfill to parse valid semver components into the next columns.
  3. Create and run a new migration that enforces the constraints on the columns, adds the index(s), and enforces the validation in the model.

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

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

Edited by Darby Frey

Merge request reports

Loading