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 (closed) is the frontend issue, at time of writing the feature is being discussed on #561516 (closed).
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_levelenum column toai_catalog_itemsdefault0to matchcatalog_resourcestable. - Indexed
- New
- Allow scoping by this property:
- Add scope
Ai::Catalog::Item.with_verification_level. - Update
Ai::Catalog::ItemsFinderto optionally scope by given verification level enum - Update
aiCatalogItemsquery to support optionalverification_levelargument.
- Add scope
- Update
Ci::Catalog::VerifyNamespaceServiceto set theverification_leveltotruefor allai_catalog_itemsbelonging 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_levelset. - Update our services to set
Item.verification_levelto 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_levelset.Agents::CreateServiceAgents::UpdateServiceFlows::CreateServiceFlows::UpdateService
- Expose new
verificationLevelfield 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
CiCatalogResourceVerificationLevelbecause 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-orgnamespace (ID:9970) as agitlab_maintainedverified namespace #557843 (comment 2776550862)
Edited by 🤖 GitLab Bot 🤖