Skip to content

Start using :read_ai_catalog_item ability

What does this MR do and why?

Starts using the :read_ai_catalog_item ability we introduced in !196886 (merged)

References

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Enable the :global_ai_catalog feature flag
  2. Make note of the item ids returned when you create them in the following steps
  3. Create a public catalog item in any project (rails only, no API yet): FactoryBot.create(:ai_catalog_item, project_id: 1000000c, public: true)
  4. Create a private catalog item in a project you are a developer+ of (rails only, no API yet): FactoryBot.create(:ai_catalog_item, project_id: 1000000c)
  5. Create a private catalog item in a project you are a developer+ of (rails only, no API yet): FactoryBot.create(:ai_catalog_item, project_id: 1000000c)
  6. Make a GraphQL query:
    {
      aiCatalogItems {
        nodes {
          id
        }
      }
    }
  7. Ensure the public item and private one you are developer+ in the project appear, but the other one does not!
  8. Query each item individually to ensure you can/can't access as expected:
     {
       aiCatalogItem(id: "gid://gitlab/Ai::Catalog::Item/3") {
         id
       }
     }

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.

Related to #553928 (closed)

Edited by Lee Tickett

Merge request reports

Loading