Fix the bulk enable mutation for AI catalog skills

What does this MR do and why?

Fix the bulk enable mutation for skills. Before this MR, aiCatalogItemConsumerBulkCreate returned a 500 with Unsupported item type: skill, so a user could not enable a skill from Explore.

This MR:

  • Adds a skill? branch to EnqueueBulkCreateService.
  • Adds a create_ai_catalog_skill_item_consumer ability, like the agent, flow, and external agent abilities. EnqueueBulkCreateService and CreateService check it for skills. Policies can then turn off skill enablement on its own, for example from the governance settings in #607798.
  • Fixes the enable modal for skills. The disclaimer treated a skill as a flow, read flow trigger text, and failed to render. The modal now shows a skill disclaimer. The disclaimer does not say that members can use the skill, because nothing consumes an enabled skill until gitlab-org#23978.
  • Adds skill messages, the Explore path, and the refetch query to the version alert.

Audit events for enabling and disabling skills are a follow-up in #630880 (comment 4210394672).

This is MR 5 of the split of !260396 (closed). All parts are behind the ai_catalog_skills flag (default off).

# MR Status
1 Add routes for AI catalog skills !266269 (merged) ✅ Merged
2 Add Skills project sidebar menu item !267449 (merged) ✅ Merged
3 Register skill as an AI catalog item type !267460 (merged) ✅ Merged
4 Fall back to the git author name in item attribution !267461 (merged) ✅ Merged
5 Fix the bulk enable mutation for AI catalog skills 👈 You are here
6 Add skills routes to the Explore and project Vue routers !267907 (merged) ✅ Merged
7 Add Skills tab to the Explore AI catalog !268368 (merged)
8 Add the skill details page !268788 (merged)

References

Screenshots or screen recordings

Before After
The enable modal has no disclaimer. skill-enable-before-modal The enable modal shows the skill disclaimer. skill-enable-after-modal
The bulk enable mutation returns a 500. skill-enable-before-result The skill is enabled. skill-enable-after-result

How to set up and validate locally

  1. In the Rails console, run Feature.enable(:ai_catalog_skills).
  2. Publish a skill in a project. See the steps in !268368 (merged).
  3. Visit a public skill at /explore/ai-catalog/skills/<id> and select Enable. The modal shows the skill disclaimer.
  4. Select a project and select Enable. The toast says Enabled in selected project(s).
  5. Visit /<project>/-/automate/skills. The skill is in the list.
  6. Open the skill and select Disable. The toast says Skill disabled in this project.

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.

🤖 Generated with Claude Code

Edited by Justin Ho Tuan Duong

Merge request reports

Loading
Loading