Pass down resource_id for AI features
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
How to set up and validate locally
- Set up AI features locally https://docs.gitlab.com/ee/development/ai_features.html#test-ai-features-locally
- Enable
Feature.enable(:gitlab_duo)
- Go to a any page that is not an issue -> the
resource_id
will fallback touser_id
- Go to an issue page -> the
resource_id
will be the global ID from the issue - 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 theresourceId
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Nicolas Dular