BE - Update createAiCatalogItemConsumer to add agents to group
When adding right now, we get this error:
Could not enable agent: GitLab Analytics Agent
Service account must be blank
This diff seems to fix the issue:
diff --git a/ee/app/services/ai/catalog/item_consumers/create_service.rb b/ee/app/services/ai/catalog/item_consumers/create_service.rb
index e0e24abd21eb..dcb684b7ba27 100644
--- a/ee/app/services/ai/catalog/item_consumers/create_service.rb
+++ b/ee/app/services/ai/catalog/item_consumers/create_service.rb
@@ -79,7 +79,7 @@ def create_item_consumer(service_account)
def create_service_account
# In case we don't need to create the service account (because this is not group level), we should return
# no_op, and continue creating the item consumer.
- return [:no_op, nil] if group.nil?
+ return [:no_op, nil] if group.nil? || item.agent?
service_account_params = {
namespace_id: group.id,
Edited by Justin Ho Tuan Duong
