Backend: Use latest_released_version, instead of latest_version, within our flow builder
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
About
Within our flow building services we currently often use Item#latest_version to grab the latest version of a flow or agent.
This has been fine up until now as the UI has not supported draft versions, and so every "latest version" has been guaranteed to be a released one.
However, as part of &18749 we need to replace some instances of latest_version with latest_released_version to ensure we are using a released version.
Proposal
A raw WIP is Draft: Use latest_released_version in AI Catalog (!205329 - closed) but that can be taken over by anyone who wants to pick up this issue (or abandoned)!
Once #554673 (closed) has completed we can:
- Write a regular (non-post) data migration to set the
latest_released_versionproperty for allAi::Catalog::Items that are lacking on (ones created before !205321 (merged) was deployed). - Update our app to use
latest_released_versionin place oflatest_versionwhenever necessary (particularly in flow building classes, but could be elsewhere). - Look for references of this issue
https://gitlab.com/gitlab-org/gitlab/-/issues/572145in code, and address those TODOs.
Note the data migration is important as we can't deploy the change to update our app to use latest_released_version until all existing items have one. The data migration should be a regular (non-post) migration and must be merged either before the app changes, or with the app changes, but not after. If the data migration needs to be a post-migration then instead we will need to have the app changes go out in the milestone after the migrations merge (but I think the data migration ought to be able to be a regular non-post migration as the amount of data being migrated will be very small).