Code Suggestions development guidelines
Code Suggestions development setup
The recommended setup for locally developing and debugging Code Suggestions is to have all 3 different components running:
- IDE Extension (for example, GitLab Workflow extension for VS Code).
- Main application configured correctly (for example, GDK).
- AI gateway.
This should enable everyone to locally see how any change made in an IDE is sent to the main application to be transformed into a prompt before being sent to the respective model.
Setup instructions
- Install and locally run the GitLab Workflow extension for VS Code:
- Add the
"gitlab.debug": true
info to the Code Suggestions development config:- In VS Code, go to the Extensions page and find "GitLab Workflow" in the list.
- Open the extension settings by clicking a small cog icon and select "Extension Settings" option.
- Check a "GitLab: Debug" checkbox.
- If you'd like to test that Code Suggestions is working from inside the GitLab Workflow extension for VS Code, then follow the authenticate with GitLab steps with your GDK inside the new window of VS Code that pops up when you run the "Run and Debug" command.
- Once you complete the steps below, to test you are hitting your local
/code_suggestions/completions
endpoint and not production, follow these steps:- Inside the new window, in the built in terminal select the "Output" tab then "GitLab Language Server" from the drop down menu on the right.
- Open a new file inside of this VS Code window and begin typing to see Code Suggestions in action.
- You will see completion request URLs being fetched that match the Git remote URL for your GDK.
- Once you complete the steps below, to test you are hitting your local
- Add the
Setup instructions to use GDK with the Code Suggestions
See the instructions for setting up GitLab Duo features in the local development environment
Bulk assign users to Duo Pro/Duo Enterprise add-on
After purchasing the Duo add-on, existing eligible users can be assigned/un-assigned to the Duo add_on_purchase
in bulk. There are a few ways to perform this action, that apply for both GitLab.com and GitLab Self-Managed instances,
The above methods make use of the BulkAssignService/BulkUnassignService, which evaluates eligibility criteria preliminarily before assigning/un-assigning the passed users in a single SQL operation.
Setting up Duo on your staging GitLab.com account
For more information, see setting up Duo on your GitLab.com staging account.
Video demonstrations of installing and using Code Suggestions in IDEs
For more guidance, see the following video demonstrations of installing and using Code Suggestions in: