Skip to content

Check Duo Chat access via GraphQL API

Gosia Ksionek requested to merge mk-new-endpoint-for-chat2 into master

What does this MR do and why?

Adds new graphql endpoint to check if user has access to chat.

We need this endpoint to create a check if a user has access to Duo Chat. If they do not have access, we will not show them Duo Chat in the VSCode extension.

Today, there is a sub-optimal UX where all VSCode users who have the GitLab Workflow extension installed are shown the Duo Chat window. Only when they try to use Duo Chat do they receive a "Returning from Service due to validation" error. Instead, we will use this API endpoint to check whether the user has access to Duo Chat. If they do not, we will not show them Duo Chat in the IDE.

This also prevents an even higher error rate for when we release Duo Chat to self-managed GitLab customers in 16.8. This API endpoint works for SaaS and self-managed. Without this endpoint, we will start showing Duo Chat in VSCode to all self-managed GitLab customers who use the GitLab workflow extension. By showing it to customers who do not have access, we will be creating lots of "Returning from Service due to validation" errors, which will increase our error rate.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. To check on self-managed, please follow the steps here: !140352 (merged)
  2. to check on SaaS, follow the steps here: https://docs.gitlab.com/ee/development/ai_features/index.html#test-saas-only-ai-features-locally
  3. Go into http://127.0.0.1:3000/-/graphql-explorer
  4. put
    query aiChatAccess {
      currentUser {
       canAccessDuoChat
      }
    }
  5. Observe results.
Edited by Jessie Young

Merge request reports