New help command in GitLab Duo Chat
Release notes
Discover GitLab Duo Chat's powerful features effortlessly! Just type help in the chat message field to explore everything it can do for you.
Give it a try and see how GitLab Duo Chat can make your work smoother and more efficient!
https://docs.gitlab.com/ee/user/gitlab_duo_chat/examples.html
Problem
Typically users do not know what kind of question can be answered by the chat. Then some users are not aware that slash commands can be used for asking common questions nor which ones exist.
There are many ways we can (and also will) improve this. This issue here is about implementing a simple help function. (This feature proposed here will become more discoverable through Hint avaiblity of /help on Duo Chat splash screen (#472278 - closed) • Jannik Lehmann • 17.6 and will become more usable through First iteration of the slash command menu UI on... (#470703 - closed).)
Proposal
- Add a
/help
command to the Duo Chat experience to for users to get guidance on the chat's capabilities and how to use it. This help command shall work in GitLab and in the IDEs. - If it does not grow the effort of this issue include the request (i.e.
/help
) as well as the answer in the chat history so that when users ask follow-up questions the behavior is consistent with the other interactions with the chat. If it does grow the effort the engineer working on this issue should create a follow-up issue and let @tlinz know of it. - Ensure that there is a process in place that contributors that enhance the chat with new contexts and new capabilities are aware that they should also adjust the help text so that this help feature does not start rotting. (The how is up to the engineer. Maybe add a text to the contribution guide.)
Static copy in GitLab:
GitLab Duo Chat is your personal AI-powered assistant for boosting productivity. GitLab Duo Chat can help with:
- Questions about an issue or an epic, for example:
Summarize this issue in 5 bullet points.
Rewrite the description of this epic to make to be more concise.
- Questions about merge requests, for example:
Summarize this merge request in one sentence
Summarize the comments in this merge request: <merge request URL>.
- Note: GitLab Duo Chat does not yet have the context of the diff or the files in an MR.
- Explaining or generating code, for example:
Create a regular expression for parsing IPv4 and IPv6 addresses in Python.
Create a CI/CD configuration to build and test Rust code.
Explain when this C function would cause a segmentation fault: sqlite3_prepare_v2()
-
On a code file, select the lines you want explained, then on the left side, select the question mark
(**{question}**)
.
- Questions about how GitLab works, for example:
How do I add CI/CD variables to a project?
-
Troubleshooting a failed pipeline (Requires Ultimate and is part of GitLab Duo Enterprise):
- On the job log page, select Troubleshoot or open GitLab Duo Chat and type
/troubleshoot
.
- On the job log page, select Troubleshoot or open GitLab Duo Chat and type
-
Explain a vulnerability found by a SAST scanner (Requires Ultimate and is part of GitLab Duo Enterprise):
- In the upper right, from the Resolve with merge request dropdown list, select Explain vulnerability, then select Explain vulnerability.
- Or, open GitLab Duo Chat and type
/vulnerability_explain
.
Ask follow-up questions to dig deeper into or expand on the conversation with GitLab Duo. If you want to switch topics, type /reset
and you might get better results.
Use GitLab Duo Chat in your IDE to explain, create, or refactor code, or to generate tests. After you set up Chat in your IDE type /help
in the IDE to learn how to use it.
Learn more about GitLab Duo Chat in the documentation.
Static copy in the IDE:
GitLab Duo Chat is your personal AI-powered assistant for boosting productivity. You can ask GitLab Duo Chat questions about code by selecting the code and asking a question. GitLab Duo Chat can help with:
- Generating or change code, for example:
- Select the code that you have a question about and ask your question.
Create a regular expression for parsing IPv4 and IPv6 addresses in Python.
Create a CI/CD configuration to build and test Rust code.
- Explaining code (you can also use
/explain
), for example:- Select the code you want explain and then ask questions like the following
Explain when this C function would cause a segmentation fault: sqlite3_prepare_v2()
/explain why a static variable is used here
- Refactoring code, (you can also use
/refactor
), for example:- Select the code you want refactored and then ask questions like the following
/refactor to avoid memory leaks
- Fixing code (you can also use
/fix
), for example:- Select the code you want fixed and then ask questions like the following
/fix duplicate database inserts
- Writing tests (you can also use
/tests
), for example:- Select the code you want to have tests written for and then ask questions like the following
Write tests using the Boost.test framework
/tests
Ask follow-up questions to dig deeper into or expand on the conversation with Duo. If you want to switch topics, type /reset
and you might get better results.
Use GitLab Duo Chat in GitLab to ask questions about issues, epics, merge requests, comments, or to ask questions about GitLab or general DevSecOps questions. The Git Lab Duo Chat button is on the top-right in group and project pages. To use it, ask /help
in GitLab to learn how.
Learn more about GitLab Duo Chat can do in the documentation.
Implementation Plan draft:
- Implement a
/help
command in the backend similar to other slash commands we already have - Built logic to distinguish which host system is making the request (this is already partially done: gitlab-vscode-extension!1757 (merged))
- return correct help text depending on host system
- Make this slash command its own unit primitive so that we can measure usage. Make it available to GitLab Duo Pro and Gitlab Duo Enterprise.