Perform orchestrated test of the flow
We want to perform an orchestrated test of the new auth flow for Self Managed instances.
We will run:
-
gitlab-rails
in Omnibus Customers staging
MG production
- Script or terminal call to imitate the VSCode extension
Omnibus VM
URL: http://35.204.94.39/
-
Deploy a package that includes !125563 (merged) to Google Cloud -
Link Omnibus to CDot staging - Set ENV
GITLAB_LICENSE_MODE
totest
- Set ENV
CUSTOMER_PORTAL_URL
tohttps://customers.staging.gitlab.com
- Create an account on https://customers.staging.gitlab.com, "buy" a new subscription.
- You have to follow the URL in this table
- and can use the test CC info here, then activate the license on your SM instance
- Set ENV
-
Point to the staging Model Gateway by setting ENV CODE_SUGGESTIONS_BASE_URL
tohttps://model-gateway-n2bsxg.staging.runway.gitlab.net
-
Enable FFs below
::Feature.enable(:self_managed_code_suggestions_completion_api)
::Feature.enable(:code_suggestions_tokens_api)
::Feature.enable(:code_suggestions_for_instance_admin_enabled, current_user)
::Feature.enable(:code_suggestions_tokens_from_customers_dot)
CustomersDot Staging
-
Make sure https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/7745 is released to staging -
Enable create_code_suggestions_token
FF via Unleash: https://gitlab.com/gitlab-org/customers-gitlab-com/-/feature_flags/225/edit
MG staging
-
Blocked by gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!227 (merged) being deployed to MG, to accept CDot tokens -
Be able to hit (staging) MG that has CUSTOMER_PORTAL_BASE_URL
set tohttps://customers.staging.gitlab.com
VSCode extension (or faking it)
-
Run the command below
curl --request POST --header "Authorization: Bearer LOCAL_PAT_TOKEN" --header "Content-type: application/json" --data '{"prompt_version":"1","current_file":{"file_name":"dog.js","content_above_cursor":"class Car:\n def __init__(self, make, model, year, color):\n self.make = make\n self.model = model\n self.year = year\n self.color = color\n self.is_running = False\n self.speed = 0\n \n def start(self):\n if not self.is_running:\n self.is_running = True\n print(\"The car is now running.\")\n else:\n print(\"The car is already running.\")\n \n def stop(self):\n if self.is_running:\n self.is_running = False\n self.speed = 0\n print(\"The car has stopped.\")\n else:\n print(\"The car is already stopped.\")\n \n def accelerate(self, increment):","content_below_cursor":""},"project_id":"23"}' 'http://35.204.94.39/api/v4/code_suggestions/completions'
Replace LOCAL_PAT_TOKEN
with your token
Steps to follow once everything is done:
- Set the correct checkboxes! http://35.204.94.39/admin/application_settings/general#js-ai-access-settings
- Force resync of subscription http://35.204.94.39/admin/subscription
- Create LOCAL_PAT_TOKEN with api scope http://35.204.94.39/-/profile/personal_access_tokens
- Run above command at
VSCode extension (or faking it)
Edited by Roy Zwambag