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.
-
database :
- New
verification_level
enum column toai_catalog_items
default0
to matchcatalog_resources
table. - Indexed
- New
- Allow scoping by this property:
- Add scope
Ai::Catalog::Item.with_verification_level
. - Update
Ai::Catalog::ItemsFinder
to optionally scope by given verification level enum - Update
aiCatalogItems
query to support optionalverification_level
argument.
- Add scope
- Update
Ci::Catalog::VerifyNamespaceService
to set theverification_level
totrue
for allai_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 correctverification_level
set. - 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 correctverification_level
set.Agents::CreateService
Agents::UpdateService
Flows::CreateService
Flows::UpdateService
- Expose new
verificationLevel
field onTypes::Ai::Catalog::ItemInterface
, of typeTypes::Ci::Catalog::Resources::VerificationLevelEnum
- 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.
-
- Make a change request to set
gitlab-org
namespace (ID:9970
) as agitlab_maintained
verified namespace #557843 (comment 2776550862)
Edited by 🤖 GitLab Bot 🤖