- Prerequisites
- Use GitLab Duo Workflow in VS Code
- The context Duo Workflow is aware of
- Current limitations
- Troubleshooting
- Give feedback
GitLab Duo Workflow
-
Introduced in GitLab 17.4 with a flag named
duo_workflow
. Enabled for GitLab team members only. This feature is an experiment.
Automate tasks and help increase productivity in your development workflow by using GitLab Duo Workflow.
GitLab Duo Workflow, as part of your IDE, takes the information you provide and uses AI to walk you through an implementation plan.
GitLab Duo Workflow supports a wide variety of use cases. Here are a few examples:
- Bootstrapping a new project
- Writing tests
- Fixing a failed pipeline
- Implementing a proof of concept for an existing issue
- Commenting on a Merge Request with suggestions
- Optimize GitLab CI
These are examples of known GitLab Duo Workflow that have successfully executed, but it can be used for many more use cases.
Prerequisites
Before you can use GitLab Duo Workflow in VS Code:
- Install the GitLab Workflow extension for VS Code. Minimum version 5.8.0.
- In VS Code, set the Docker socket file path.
Install Docker and set the socket file path
Duo Workflow needs an execution platform where it can execute arbitrary code, read and write files, and make API calls to GitLab.
Automated setup
Installs Docker, Colima, and sets Docker socket path in VS Code settings.
You can run the script with the --dry-run
flag to check the dependencies
that get installed with the script.
- Download the script.
-
Run the script.
chmod +x duo_workflow_runtime.sh ./duo_workflow_runtime.sh
Manual setup
Sets socket path if you have Docker or Docker alternatives installed already.
- Access VS Code settings:
- On Mac: Cmd + ,
- On Windows and Linux: Ctrl + ,
- In the upper-right corner, select the Open Settings (JSON) icon.
-
Ensure the Docker socket settings are configured. If not, add this line to
settings.json
and save:-
For Rancher Desktop
"gitlab.duoWorkflow.dockerSocket": "/Users/<username>/.rd/docker.sock"
-
For Colima
"gitlab.duoWorkflow.dockerSocket": "/Users/<username>/.colima/default/docker.sock"
-
Use GitLab Duo Workflow in VS Code
To use GitLab Duo Workflow:
- In VS Code, open the GitLab project.
- The namespace must have an Ultimate subscription.
- You must check out the branch for the code you would like to change.
- Access the Command Palette:
- On Mac: Cmd + Shift + P
- On Windows and Linux: Ctrl + P.
- Type
Duo Workflow
and select GitLab: Show Duo Workflow. - In the Duo Workflow panel, type your command, along with the merge request ID and project ID. Copy-paste is not currently possible.
- Merge request ID: In GitLab, the ID is in the merge request URL.
- Project ID: In GitLab, the ID is on the project overview page. In the upper-right corner, select the vertical ellipsis () to view it.
The context Duo Workflow is aware of
GitLab Duo Workflow is aware of the context you’re working in, specifically:
Area | How to use GitLab Duo Workflow |
---|---|
Merge requests | Enter the merge request ID and project ID in the Duo Workflow panel |
In addition, Duo Workflow has read-only access to:
- The GitLab API for fetching project and merge request information.
- Merge request’s CI pipeline trace to locate errors in the pipeline job execution.
Current limitations
Duo Workflow has the following limitations:
- No copy and paste functionality. For details, see issue 380.
- No theme support.
- Project-specific workflow execution only.
Troubleshooting
If you encounter issues:
- Check that your open project in VS Code corresponds to the GitLab project you want to interact with.
- Ensure that you’ve checked out the branch as well.
- Check your Docker and Docker socket configuration:
- Try manual Docker socket configuration.
-
If using Colima and encountering issues, try restarting it:
colima stop colima start
- For permission issues, ensure your operating system user has the necessary Docker permissions.
- Check the Language Server logs:
- To open the logs in VS Code, select View > Output. In the output panel at the bottom, in the top-right corner, select GitLab Workflow or GitLab Language Server from the list.
- Review for errors, warnings, connection issues, or authentication problems.
- For more output in the logs, open the settings:
- On Mac: Cmd + ,
- On Windows and Linux: Ctrl + ,
- Search for the setting GitLab: Debug and enable it.
- Examine the Duo Workflow Service production LangSmith trace.
Give feedback
Duo Workflow is an experiment and your feedback is crucial. To report issues or suggest improvements, complete this survey.