DEV Community

Cover image for ✨ Discovering GitLab Duo 🤖
Jean-Phi Baconnais for Zenika

Posted on • Edited on

✨ Discovering GitLab Duo 🤖

✨ Artificial Intelligence

Artificial Intelligence (AI) is everywhere: in your email, translation, social networks, streaming, IOT, image generators and for some months, in development tools.

Some people, especially those unfamiliar with software development, might fear that AI will replace developers’ jobs. True? Perhaps, but not anytime soon. This debate will not be part of this blog post.

I prefer asking myself why not use AI to help us to accelerate software development?

Last year, GitLab introduced a new project : GitLab Duo. I heard about this while attending GitLab DevSecOps World Tour in Paris. This was a great day with talks, workshops and a lot of discussions.

Tweet du DevSecOps World Tour Paris

🤖 GitLab DUO : AI

GitLab has launched this new project with a new branding for it, highlighting its focus on AI integration within the DevOps platform. The number of features it brings spotlight the importance of this project for GitLab. I am sure that this project is at the top of the priorities for the GitLab teams. GitLab has a partnership with Google, and I am not surprised to see that GitLab and Google teams work together to deliver great features for the future. I am excited to see how the power of GitLab and Google will bring AI in our life.

GitLab Duo branding

GitLab Duo introduces AI in the entire DevOps lifecycle, helping from issue management to the code completion and also security of your project.

In order to handle the big scope of this project, GitLab has splitted the project into sub-projects, like Code Suggestion and GitLab Duo Chat.

These features are still in progress. To enjoy them, you can activate in your GitLab group this property : “Use Experiment and Beta features” available in the menu Settings > General > Permissions and group features > Experiment and Beta features.

Code suggestion

The first one I would like to speak about is Code **Suggestion. **This continuously improving feature is currently available, since April 2024, through the GitLab Duo Pro add-on. I learned that GitLab offers the possibility to use add-on in their platform with this project (cf GitLab Duo Pro paragraph).

Code suggestion offers multiple ways to interact with in: directly in the GitLab WebIDE, in Vscode (with VS Code GitLab Workflow extension), Jetbrains (with GitLab Duo plugin), and Neovim (with this plugin).

This powerful feature helps developers by suggesting code completions, such as an entire Javascript function or a Kubernetes descriptor, in real time as you type. Code Suggestion check comments you are typing and will attempt to generate the associated code as you can see in this example:

Code Suggestion

Pressing the Tab key inserts the suggested code into your file.

Code add in your code

Code Suggestion supports around 14 languages, including Go, Python, Java, Javascript, PHP and Rust). However, please check this page to verify the availability of your language in your IDE: https://docs.gitlab.com/ee/user/project/repository/code_suggestions/supported_extensions.html#supported-languages.

💬 GitLab Duo Chat

With the rise of AI tools in development, many people use them to ask anything about development, or to get advice on technical things.

That’s why GitLab introduced a new AI assistant, GitLab Duo Chat.

It is a chat available in the GitLab UI, on Web IDE, and on Vs Code. Its goal is to help you respond to your questions without leaving GitLab. Having this in GitLab is a great advantage and allows you to stay in the same tab to interact with AI.

It is available on the menu at the bottom left of your screen

Acces to GitLab Duo Chat

GitLab Duo Chat

and recently with a button at the top on the left.

Button on the top of GitLab UI

You can for example ask GitLab Duo Chat how to create a Go project, initiate a GitLab CI pipeline or explain how to start with a .gitignore file for a Java project.

Example of a response by GitLab Duo Chat

GitLab Duo Chat can also explain selected code. If you open a file in GitLab:

Display a tooltip to explain selected code

You can select code and click the “?” icon.

Explanation by GitLab Duo Chat

Of course you can also write the command directly after selecting the code you want to get explanations.

🌏 IA is everywhere in GitLab

AI in GitLab is not limited to Code Suggestion and GitLab Duo Chat. From issue management to supervision of your application, GitLab integrated AI in all the software DevOps lifecycle.

DevSecOps representation
From https://about.gitlab.com/press/press-kit/

Plan

Issues are the backbone of project planning in GitLab. Now, the “AI actions” button offers a single button to generate a description using the power of AI:

AI tooltip

AI actions

Generate description

From this text :



in this issue I would like to initiate a new API working on Nantes communities_


Enter fullscreen mode Exit fullscreen mode

GitLab Duo generates this description:



_#1 - New API for Nantes communities_

_The goal of this issue is to initiate development of a new API focused on serving data related to communities in Nantes, France. This API would provide programmatic access to information about various neighborhoods, organizations, events and other data relevant to residents and groups in the city._

_***_

__Description was generated using AI__


Enter fullscreen mode Exit fullscreen mode

This feature is an effective way to improve the quality of the description.

Another AI functionality in issues is the summary. When you read or work on an issue, with a lengthy description and many comments, it’s easy to miss important information. GitLab Duo offers the “View summary” button to automatically generate a summary of the issue.

View summary button

The generated summary is visible only by users who activated this feature. For this issue, this is the summary proposed by GitLab Duo:

Text generated by AI

Code

In addition to code, GitLab Duo extends features to merge requests (MR). First, it integrates with Code Owners files, helping users to assign the most suitable reviewer for an issue.

AI can also help to describe your merge requests. The “Summarize code changes” button provides you with a summary of your modifications, saving you time and effort. GitLab Duo can also summarize comments on a merge request.

Summarize code changes

Test

Writing tests can be a repetitive task. To help developers, GitLab Duo comes with the “/tests” command which generate test suggestions for the code selected:

Tests suggestion

Deployment

With the “Root cause analysis” feature, GitLab Duo brings AI within the CI/CD to explain the cause of your failure.

Root cause analysis button

Security

Security vulnerabilities are critical on a project and require quick attention. GitLab Duo helps users to understand these vulnerabilities and can create a merge request to resolve them.

All features are detailed here.

👷 GitLab Duo Pro

GitLab introduced in this blog post (published earlier in this year) an Add-on called GitLab Duo Pro. Available for Ultimate and Premium customers, it boosts developer efficiency. Privacy is a major concern with AI. That’s why GitLab released GitLab Duo as an experimental project. The GitLab Duo Pro add-on assures users that their code stays confidential and is not used to train their AI models.

Try GitLab Duo Pro free

GitLab Duo Pro Add on

🚀 The next steps

AI won’t replace developers, but it will become a great daily friend. GitLab Duo will boost developers efficiency and offer the possibility to create projects faster while assisting for taks we are less comfortable with.

This project is truly promising and I can't wait to see new features rolling out with each release of GitLab.

🙏 Thanks to Guillaume and Jimmy for their review.

Links

Top comments (0)