Add version pinning to enabled items (backend)

There is a corresponding frontend issue FE: Add version upgrade check and option for ag... (#578590).

About

We will complete a minimal iteration of versioning that will automatically version pin items. See related issues.

Table of all uses of AI Catalog items that will need to observe pinned version

See Meta: Table of all uses of AI Catalog items tha... (#581252 - closed).

Proposal

Based on this thread: #578589 (comment 2848619969).

  1. When item is added to top-level group, it is pinned at a specific version (example 1.2.0)
  2. When projects enable the item, they are all automatically version-pinned to that same specific version
Click to read original proposal
  1. Automatically version pin to the specific latest version of an AI Catalog item (example "1.2.0") for every project that does not "own" the agent, when they enable/add the item to the project. Do not version pin when items are added to top-level group as it will serve no function.
  2. Allow the project that "owns" the item to be the singular project which we do not version pin when they enable/add the item - as their maintainer+ are the only people who can edit the item and so we can presume they can trust their own latest changes.

2 is a quality-of-life change for projects that create an item and want to use it themselves. It would be possible not do 2 if required, however, it feels like it would add unnecessary friction.

Note, this will work the same regardless of whether the item first needed to be added to a top-level group or not #578589 (comment 2870433136). As such, do not version pin when items are added to top-level group as it will serve no function.

Update customer documentation with this information.

Technical proposal

In ItemConsumers::CreateService:

  • For groups, set pinned_version_prefix to the latest released version of the AI Catalog item. Example, if the latest released version is 1.5.0, we will automatically set the pinned_version_prefix to that value.
  • For projects, set pinned_version_prefix to the same value as the top-level group (parent_item_consumer.group within the service)
  • Should return an error message if pinned_version_prefix argument is provided and it is not the latest version of the item. This is for the benefit of people using our the GraphQL mutation directly.

In ItemConsumers::UpdateService, return an error if pinned_version_prefix is passed (as a temporary measure we will remove when we allow updating a version pin in a later iteration)

Edited by Luke Duncalfe