Skip to content

Pass down resource_id for AI features

Nicolas Dular requested to merge nd/chat-resource-id into master

What does this MR do and why?

Pass down resource_id for AI features

To get more knowledge about the current resource the chat is acting on, we inject the resource_id from the backend. For now we only pass it down for issues issues and will extend the resource types later.

Screenshots or screen recordings

Screenshot_2023-06-14_at_13.55.03

Screenshot_2023-06-14_at_13.56.32

How to set up and validate locally

  1. Set up AI features locally https://docs.gitlab.com/ee/development/ai_features.html#test-ai-features-locally
  2. Enable Feature.enable(:gitlab_duo)
  3. Go to a any page that is not an issue -> the resource_id will fallback to user_id
  4. Go to an issue page -> the resource_id will be the global ID from the issue
  5. You can either verify by checking the aiSubscriptionResponse in the Network -> WS (Websockets) tab, or when performing a chat request with something like "Summarize this issue" and check the GraphQL mutation for the resourceId

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nicolas Dular

Merge request reports