GitLab duo uses snippets rather than the docs as context for some responses

Summary

ZD Customer Ticket Link (internal only)

GitLab duo will use snippets as context for some questions regarding variables. For example if you have $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME defined in a snippet in a project, then ask duo to tell you about this variable you will get the following response:

Unfortunately, I could not find any documentation specifically about the "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" predefined variable in the provided GitLab documentation snippets.

image

Steps to reproduce

  1. Create a snippet a project snippet with a reference to the variable in question. Ex:

test.rb

$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME = Something

  1. Click back on the project home page so it has the project's context.
  2. Ask duo: "Tell me more about "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME""
  3. The response should be the same as the screenshot.

Example Project

I recreated this behavior in one of my test projects.

What is the current bug behavior?

GitLab duo seems to try to use the snippet as the source of the definition for this variable.

What is the expected correct behavior?

GitLab duo should provided information regarding what the variable does in the context of the GitLab documentation. Screenshot attached from a project that doesn't have a snippet:

image

Edited by 🤖 GitLab Bot 🤖