Skip to content

Add allowed status endpoint for AI Assist

Fred de Gier requested to merge feat/add-ai-assist-endpoints into master

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR adds the module ML to EE licensed features with the first endpoint being aiassist.

asassist is a GET endpoint used to check if a user is allowed to use AI Assist in the VS Code extension. The endpoint will be called server side (once per hour) to ensure GitLab has control over which users are using our resources. At the moment the criteria is 1) ultimate customer and 2) feature flag enabled.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Run GDK
  2. Retrieve an access token for a user
export GITLAB_PAT=<your api token>
  1. Call the end point
curl --request GET --header "PRIVATE-TOKEN: $GITLAB_PAT" "http://127.0.0.1:3000/api/v4/ml/aiassist"
Output:
{"user_is_allowed":false}
  1. Enable the feature flag
rails console
Feature.enable(:ai_assist)
  1. Call the end point
curl --request GET --header "PRIVATE-TOKEN: $GITLAB_PAT" "http://127.0.0.1:3000/api/v4/ml/aiassist"
Output:
{"user_is_allowed":true}

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 Fred de Gier

Merge request reports