Add version tag to metadata component

What does this MR do and why?

This adds the version tag to the agent/flow details page metadata component. This will make it easy for users to see what version of agent or flow they are currently looking at. This leverages the new pinned versioning work that is being/has been recently completed.

  • Add versionData prop to ai_catalog_item_metadata
  • Added tests

References

This MR depends on Add pinnedItemVersion field to catalog GraphQL ... (!213420 - merged), which provides the needed GraphQL query updates to function.

This MR also depends on Add version pinning logic in explore/project ar... (!213429 - merged), which provides changes to the shared components agents and flows use.

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Make sure to have a duo enabled project with the global_ai_catalog feature flag enabled
  2. In the AI catalog, create a new agent.
    • You should see version v1.0.0 in the metadata section of the agent’s details page
  3. Update that same agent
    • You should now see version v1.1.0
  4. Enable this agent in a duo enabled project
  5. Navigate to that project’s Automate > Agents page and click on the agent you created
    • You should see that the version has been pinned to v1.1.0
  6. Navigate back to the Explorer area and make an update to that agent
    • You should see that it's version has been bumped to v1.2.0
  7. Navigate back to that same agent in your duo enable and click on it to see its details
    • You should see that it's version is still pinned to v1.1.0
  8. Open up a rails console and update the pinned version of the agent you've been working with to v1.2.0

Ai::Catalog::ItemConsumer.last.update!(pinned_version_prefix: '1.2.0')

  1. Reload the project level agent page
    • You should see that the version has changed to the version you used in the rails console.

You can perform all these same steps to test flows as well.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #580382 (closed)

Edited by Angus Ryer

Merge request reports

Loading