GitLab Duo Workflow

Tier: Ultimate Offering: GitLab.com Status: Experiment
History
The availability of this feature is controlled by a feature flag. For more information, see the history. This feature is available for internal GitLab team members for testing, but not ready for production use.
caution
This feature is considered experimental and is not intended for customer usage outside of initial design partners. We expect major changes to this feature.
This page contains information related to upcoming products, features, and functionality. It is important to note that the information presented is for informational purposes only. Please do not rely on this information for purchasing or planning purposes. The development, release, and timing of any products, features, or functionality may be subject to change or delay and remain at the sole discretion of GitLab Inc.

Automate tasks and help increase productivity in your development workflow by using GitLab Duo Workflow. GitLab Duo Workflow, currently only in 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:

  • Bootstrap a new project
  • Write tests
  • Fix a failed pipeline
  • Implement a proof of concept for an existing issue
  • Comment on a merge request with suggestions
  • Optimize CI configuration

These are examples of successful use cases, but it can be used for many more.

Prerequisites

Before you can use GitLab Duo Workflow:

  1. Install Visual Studio Code (VS Code).
  2. Install and set up the GitLab Workflow extension for VS Code. Minimum version 5.16.0.
  3. In VS Code, set the Docker socket file path.

Install Docker and set the socket file path

GitLab Duo Workflow needs an execution platform like Docker where it can execute arbitrary code, read and write files, and make API calls to GitLab.

Automated setup

The setup script installs Docker and Colima, pulls the Docker base image, 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.

  1. Download the setup script.
  2. Run the script.

    chmod +x duo_workflow_runtime.sh
    ./duo_workflow_runtime.sh
    

Manual setup

If you have Docker Desktop or a container manager other than Colima installed already:

  1. Pull the base Docker image:

    docker pull registry.gitlab.com/gitlab-org/duo-workflow/default-docker-image/workflow-generic-image:v0.0.4
    
  2. Set the Docker socket path in VS Code:

    1. Open VS Code, then open its settings:
      • On Mac: Cmd + ,
      • On Windows and Linux: Ctrl + ,
    2. In the upper-right corner, select the Open Settings (JSON) icon.
    3. Add the Docker socket path setting gitlab.duoWorkflow.dockerSocket, according to your container manager, and save your settings file. Some examples for common container managers on macOS, where you would replace <your_user> with your user’s home folder:

      • Rancher Desktop:

         "gitlab.duoWorkflow.dockerSocket": "/Users/<your_user>/.rd/docker.sock",
        
      • Colima:

         "gitlab.duoWorkflow.dockerSocket": "/Users/<your_user>/.colima/default/docker.sock",
        

Use GitLab Duo Workflow in VS Code

To use GitLab Duo Workflow:

  1. In VS Code, open a folder that has a Git repository for a GitLab project.
    • The GitLab namespace for the project must have an Ultimate subscription.
    • You must check out the branch for the code you would like to change.
  2. Open the command palette:
    • On Mac: Cmd + Shift + P
    • On Windows and Linux: Ctrl + P.
  3. Type Duo Workflow and select GitLab: Show Duo Workflow.

The context GitLab 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 support for VS Code themes.
  • Can only run workflows for the GitLab project that’s open in VS Code.

Troubleshooting

If you encounter issues:

  1. Ensure that you have the latest version of the GitLab Workflow extension.
  2. Check that your open folder in VS Code corresponds to the GitLab project you want to interact with.
  3. Ensure that you’ve checked out the branch as well.
  4. Check your Docker and Docker socket configuration:
    1. Install Docker and set the socket file path.
    2. Restart your container manager. For example, if using Colima:

      colima stop
      colima start
      
    3. For permission issues, ensure your operating system user has the necessary Docker permissions.
  5. Check the Language Server logs:
    1. 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.
    2. Review for errors, warnings, connection issues, or authentication problems.
    3. For more output in the logs, open the settings:
      • On Mac: Cmd + ,
      • On Windows and Linux: Ctrl + ,
    4. Search for the setting GitLab: Debug and enable it.
  6. 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.