[go: up one dir, main page]

Skip to content

Backend: GitLab "official" flows and agents

About

To help customers choose flows and agents from the AI Catalog, we can label some as "official" flows and agents.

On GitLab.com, these would be flows and agents created by GitLab, most likely associated with either gitlab-org group or gitlab-org/gitlab project.

frontend counterpart issue

This issue is being considered the backend issue and #561516 is the frontend issue, at time of writing the feature is being discussed on #561516.

Proposal

We will couple to the CI Catalog's existing method of setting GitLab official #557843 (comment 2695386850).

This will involve updating Ci::Catalog::VerifyNamespaceService to operate on AI Catalog items as a well as CI components.

  1. database :
    1. New verification_level enum column to ai_catalog_items default 0 to match catalog_resources table.
    2. Indexed
  2. Allow scoping by this property:
    1. Add scope Ai::Catalog::Item.with_verification_level.
    2. Update Ai::Catalog::ItemsFinder to optionally scope by given verification level enum
    3. Update aiCatalogItems query to support optional verification_level argument.
  3. Update Ci::Catalog::VerifyNamespaceService to set the verification_level to true for all ai_catalog_items belonging to projects of a root namespace, similar to how it does for CI components. This will mean that all existing items for a project within a verified namespace get the correct verification_level set.
  4. Update our services to set Item.verification_level to the right level when root namespace of a project is a verified namespace, similar to how the CI Catalog does. This will mean that any new items for a project within a verified namespace will get the correct verification_level set.
    1. Agents::CreateService
    2. Agents::UpdateService
    3. Flows::CreateService
    4. Flows::UpdateService
  5. Expose new verificationLevel field on Types::Ai::Catalog::ItemInterface, of type Types::Ci::Catalog::Resources::VerificationLevelEnum
  6. Renamespace classes:
    • Ci::Catalog::VerifyNamespaceService => Namespaces::VerifyNamespaceService
    • Ci::Catalog::VerifiedNamespace => Namespaces::VerifiedNamespace
    • Mutations::Ci::Catalog::VerifiedNamespace::Create => Mutations::Namespaces::VerifiedNamespace::Create
    • Types::Ci::Catalog::Resources::VerificationLevelEnum => Types::Namespaces::VerificationLevelEnum
    • Note unfortunately we will need to keep the name of CiCatalogResourceVerificationLevel because to change it would be a breaking change to our API. But we could add a comment to that class to mention that it's also used by AI Catalog.
  7. Make a change request to set gitlab-org namespace (ID: 9970) as a gitlab_maintained verified namespace #557843 (comment 2776550862)
Edited by 🤖 GitLab Bot 🤖