GitLab Duo Chatに質問する
- プラン: Premium、Ultimate
- アドオン: GitLab Duo Core、Pro、またはEnterprise。
- 提供形態: GitLab.com、GitLab Self-Managed、GitLab Dedicated
GitLab Duo Chatは以下をサポートします:
- コード、エラー、GitLab機能の説明を入手できます。
- コードの生成やリファクタリング、テストの作成、問題の修正を行います。
- CI/CD設定の作成、ジョブ失敗のトラブルシューティングを行います。
- イシュー、エピック、およびマージリクエストを要約します。
- セキュリティ脆弱性を解決します。
次の例では、Duo Chatの機能について詳しく説明します。
その他の実践的な例については、GitLab Duoのユースケースを参照してください。
スラッシュコマンドを含むこのページの質問例は、意図的に一般的なものになっています。現在の目標に特化した質問をすることで、Chatからより有用な回答を得られる場合があります。例「clean_missing_dataのdata_cleaning.py関数は、どの行を削除するかをどのように決定しますか?」。
GitLabについて質問する
GitLabの動作方法について質問できます。例:
Explain the concept of a 'fork' in a concise manner.Provide step-by-step instructions on how to reset a user's password.
GitLab Duo Chatは、GitLabリポジトリのGitLabドキュメントをソースとして使用します。
Chatをドキュメントで最新の状態に保つために、ナレッジベースは毎日更新されます。
- GitLab.comでは、ドキュメントの最新バージョンが使用されます。
- GitLab Self-ManagedおよびGitLab Dedicatedでは、インスタンスのバージョンに対応するドキュメントが使用されます。
特定のイシューについて質問する
- アドオン: GitLab Duo Enterprise
特定のGitLabイシューについて質問できます。例:
Generate a summary for the issue identified via this link: <link to your issue>- GitLabでイシューを表示しているときに、
Generate a concise summary of the current issue.と尋ねることができます How can I improve the description of <link to your issue> so that readers understand the value and problems to be solved?
イシューに大量のテキスト(40,000語以上)が含まれている場合、GitLab Duo Chatはすべての単語を考慮できない場合があります。AIモデルには、一度に処理できる入力量に制限があります。
GitLab Duo Chatでイシューとエピックの生産性を向上させる方法のヒントについては、GitLab Duo Chatで生産性を向上させるを参照してください。
特定エピックについて質問する
- アドオン: GitLab Duo Enterprise
特定のGitLabエピックについて質問できます。例:
Generate a summary for the epic identified via this link: <link to your epic>- GitLabでエピックを表示しているときに、
Generate a concise summary of the opened epic.と尋ねることができます What are the unique use cases raised by commenters in <link to your epic>?
エピックに大量のテキスト(40,000語以上)が含まれている場合、GitLab Duo Chatはすべての単語を考慮できない場合があります。AIモデルには、一度に処理できる入力量に制限があります。
特定のマージリクエストについて質問する
- アドオン: GitLab Duo Enterprise
表示中のマージリクエストについてGitLabに質問できます。質問できる内容は次のとおりです:
- タイトルまたは説明。
- コメントとスレッド。
- 変更タブの内容。
- ラベル、ソースブランチ、作成者、マイルストーンなどのメタデータ。
マージリクエストでChatを開き、質問を入力します。例:
Why was the .vue file changed?What do the reviewers say about this merge request?How can this merge request be improved?Which files and changes should I review first?
特定のコミットについて質問する
- アドオン: GitLab Duo Enterprise
特定のGitLabコミットについて質問できます。例:
Generate a summary for the commit identified with this link: <link to your commit>How can I improve the description of this commit?- GitLabでコミットを表示しているときに、
Generate a summary of the current commit.と尋ねることができます
特定のパイプラインジョブについて質問する
- アドオン: GitLab Duo Enterprise
特定のGitLabパイプラインジョブについて質問できます。例:
Generate a summary for the pipeline job identified via this link: <link to your pipeline job>Can you suggest ways to fix this failed pipeline job?What are the main steps executed in this pipeline job?- GitLabでパイプラインジョブを表示しているときに、
Generate a summary of the current pipeline job.と尋ねることができます
特定の作業アイテムについて質問する
- アドオン: GitLab Duo Enterprise
特定のGitLab作業アイテムについて質問できます。例:
Generate a summary for the work item identified via this link: <link to your work item>- GitLabで作業アイテムを表示しているときに、
Generate a concise summary of the current work item.と尋ねることができます How can I improve the description of <link to your work item> so that readers understand the value and problems to be solved?
作業アイテムに大量のテキスト(40,000語以上)が含まれている場合、GitLab Duo Chatはすべての単語を考慮できない場合があります。AIモデルには、一度に処理できる入力量に制限があります。
選択したコードについて説明する
- アドオン: GitLab Duo Core、Pro、またはEnterprise、GitLab Duo with Amazon Q
GitLab Duo Chatに、選択したコードの説明を依頼できます:
考慮すべき追加の指示を含めることもできます。例:
/explain the performance/explain focus on the algorithm/explain the performance gains or losses using this code/explain the object inheritance(クラス、オブジェクト指向)/explain why a static variable is used here(C++)/explain how this function would cause a segmentation fault(C)/explain how concurrency works in this context(Go)/explain how the request reaches the client(REST API、データベース)
詳細については、以下を参照してください:
GitLab UIでは、以下でもコードを説明できます:
コードについて質問または生成する
- アドオン: GitLab Duo Core、Pro、またはEnterprise。
GitLab Duo Chatのウィンドウにコードを貼り付けて、コードに関する質問ができます。例:
Provide a clear explanation of this Ruby code: def sum(a, b) a + b end.
Describe what this code does and how it works.Chatにコードの生成を依頼することもできます。例:
Write a Ruby function that prints 'Hello, World!' when called.Develop a JavaScript program that simulates a two-player Tic-Tac-Toe game. Provide both game logic and user interface, if applicable.Create a regular expression for parsing IPv4 and IPv6 addresses in Python.Generate code for parsing a syslog log file in Java. Use regular expressions when possible, and store the results in a hash map.Create a product-consumer example with threads and shared memory in C++. Use atomic locks when possible.Generate Rust code for high performance gRPC calls. Provide a source code example for a server and client.
フォローアップの質問をする
- アドオン: GitLab Duo Core、Pro、またはEnterprise。
フォローアップの質問をして、トピックやタスクをより深く掘り下げることができます。これにより、さらなる明確化、詳細化、または追加の支援が必要な場合でも、特定のニーズに合わせて調整された、より詳細かつ正確な回答を得ることができます。
質問Write a Ruby function that prints 'Hello, World!' when calledへのフォローアップは次のようになります:
Can you also explain how I can call and execute this Ruby function in a typical Ruby environment, such as the command line?
質問How to start a C# project?へのフォローアップは次のようになります:
Can you also explain how to add a .gitignore and .gitlab-ci.yml file for C#?
エラーについて質問する
- アドオン: GitLab Duo Core、Pro、またはEnterprise。
ソースコードのコンパイルを必要とするプログラミング言語は、わかりにくいエラーメッセージをスローする場合があります。同様に、スクリプトまたはWebアプリケーションはスタックトレースをスローする可能性があります。コピーしたエラーメッセージの前に、たとえばExplain this error message:のようなプレフィックスを付けて、GitLab Duo Chatに質問できます。プログラミング言語などの具体的なコンテキストを追加します。
Explain this error message in Java: Int and system cannot be resolved to a typeExplain when this C function would cause a segmentation fault: sqlite3_prepare_v2()Explain what would cause this error in Python: ValueError: invalid literal for int()Why is "this" undefined in VueJS? Provide common error cases, and explain how to avoid them.How to debug a Ruby on Rails stacktrace? Share common strategies and an example exception.
IDE内の特定のファイルについて質問する
- アドオン: GitLab Duo Core、Pro、またはEnterprise。
/includeと入力してファイルを選択することで、VS CodeまたはJetBrains IDEでDuo Chatの会話にリポジトリファイルを追加します。
前提要件:
- ファイルはリポジトリの一部である必要があります。
- ファイルはテキストベースである必要があります。PDFや画像のようなバイナリファイルはサポートされていません。
手順:
- IDEのGitLab Duo Chatで
/includeと入力します。 - ファイルを追加するには、次のいずれかを実行します:
- リストからファイルを選択します。
- ファイルパスを入力します。
たとえば、eコマースアプリを開発している場合は、cart_service.pyファイルとcheckout_flow.jsファイルをChatのコンテキストに追加して、次のように質問できます:
How does checkout_flow.js interact with cart_service.py? Generate a sequence diagram using Mermaid.Can you extend the checkout process by showing products related to the ones in the user's cart? I want to move the checkout logic to the backend before proceeding. Generate the Python backend code and change the frontend code to work with the new backend.
Quick Chatを使用して、ファイルを追加したり、Chatのコンテキストに追加したファイルについて質問したりすることはできません。
IDEでコードをリファクタリングする
- アドオン: GitLab Duo Core、Pro、またはEnterprise、GitLab Duo with Amazon Q
GitLab Duo Chatに、選択したコードのリファクタリングを依頼できます:
- IDEでコードを選択します。
- Duo Chatで、
/refactorと入力します。
考慮すべき追加の指示を含めることができます。例:
- 特定のコードパターンを使用します。例:
/refactor with ActiveRecord、/refactor into a class providing static functions。 - 特定のライブラリを使用します。例:
/refactor using mysql。 - 特定の関数/アルゴリズムを使用します。例: C++で
/refactor into a stringstream with multiple lines。 - 別のプログラミング言語にリファクタリングします。例:
/refactor to TypeScript。 - パフォーマンスに焦点を当てます。例:
/refactor improving performance。 - 潜在的な脆弱性に焦点を当てます。例:
/refactor avoiding memory leaks and exploits。
/refactorは、Repository X-Rayを使用して、より正確なコンテキスト認識型の提案を提供します。
詳細については、以下を参照してください:
IDEでコードを修正する
- アドオン: GitLab Duo Core、Pro、またはEnterprise、GitLab Duo with Amazon Q
GitLab Duo Chatに、選択したコードの修正を依頼できます:
- IDEでコードを選択します。
- Duo Chatで、
/fixと入力します。
考慮すべき追加の指示を含めることができます。例:
- 文法とタイプミスに焦点を当てます。例:
/fix grammar mistakes and typos。 - 具体的なアルゴリズムまたは問題の説明に焦点を当てます。例:
/fix duplicate database inserts、/fix race conditions。 - 直接表示されない潜在的なバグに焦点を当てます。例:
/fix potential bugs。 - コードのパフォーマンスの問題に焦点を当てます。例:
/fix performance problems。 - コードがコンパイルされない場合のビルドの修正に焦点を当てます。例:
/fix the build。
/fixは、Repository X-Rayを使用して、より正確なコンテキスト認識型の提案を提供します。
IDEでテストを作成する
- アドオン: GitLab Duo Core、Pro、またはEnterprise、GitLab Duo with Amazon Q
GitLab Duo Chatに、選択したコードのテストを作成するよう依頼できます:
- IDEでコードを選択します。
- Duo Chatで、
/testsと入力します。
考慮すべき追加の指示を含めることができます。例:
- 特定のテストケースフレームワークを使用します。例:
/tests using the Boost.test framework(C ++)、/tests using Jest(JavaScript)。 - 極端なテストケースに焦点を当てます。例:
/tests focus on extreme cases, force regression testing。 - パフォーマンスに焦点を当てます。例:
/tests focus on performance。 - リグレッションと潜在的なエクスプロイトに焦点を当てます。例:
/tests focus on regressions and potential exploits。
/testsは、Repository X-Rayを使用して、より正確なコンテキスト認識型の提案を提供します。
詳細については、VS CodeでGitLab Duo Chatを使用するを参照してください。
CI/CDについて質問する
- アドオン: GitLab Duo ProまたはEnterprise
GitLab Duo ChatにCI/CD設定の作成を依頼できます:
Create a .gitlab-ci.yml configuration file for testing and building a Ruby on Rails application in a GitLab CI/CD pipeline.Create a CI/CD configuration for building and linting a Python application.Create a CI/CD configuration to build and test Rust code.Create a CI/CD configuration for C++. Use gcc as compiler, and cmake as build tool.Create a CI/CD configuration for VueJS. Use npm, and add SAST security scanning.Generate a security scanning pipeline configuration, optimized for Java.
エラーメッセージをコピーして貼り付け、Explain this CI/CD job error message, in the context of <language>:のようにプレフィックスを付けることで、特定のジョブエラーの説明を依頼することもできます:
Explain this CI/CD job error message in the context of a Go project: build.sh: line 14: go command not found
または、GitLab Duo根本原因分析を使用して、失敗したCI/CDジョブのトラブルシューティングを行うこともできます。
根本原因分析を使用して失敗したCI/CDジョブのトラブルシューティングを行う
- アドオン: GitLab Duo Enterprise、GitLab Duo with Amazon Q
GitLab Duo ChatでGitLab Duo根本原因分析を使用して、CI/CDジョブの失敗を迅速に特定して修正できます。ジョブログの最後の100,000文字を分析して失敗の原因を特定し、修正例を提供します。
この機能には、マージリクエストのパイプラインタブから、またはジョブログから直接アクセスできます。
根本原因分析は、以下をサポートしていません:
- トリガージョブ
- ダウンストリームパイプライン
エピック13872で、この機能に関するフィードバックをお寄せください。
前提要件:
- CI/CDジョブを表示する権限が必要です。
- 有料のGitLab Duo Enterpriseシートが必要です。
マージリクエストから
マージリクエストから失敗したCI/CDジョブのトラブルシューティングを行うには:
- 左側のサイドバーで、検索または移動先を選択して、プロジェクトを見つけます。
- マージリクエストに移動します。
- パイプラインタブを選択します。
- 失敗したジョブウィジェットから、次のいずれかを行います:
- ジョブIDを選択してジョブログに移動します。
- トラブルシューティングを行うを選択して、失敗を直接分析します。
ジョブログから
ジョブログから失敗したCI/CDジョブのトラブルシューティングを行うには:
- 左側のサイドバーで、検索または移動先を選択して、プロジェクトを見つけます。
- ビルド > ジョブを選択します。
- 失敗したCI/CDジョブを選択します。
- ジョブログの下で、次のいずれかを行います:
- トラブルシューティングを行うを選択します。
- GitLab Duo Chatを開き、
/troubleshootと入力します。
脆弱性について説明する
- プラン: Ultimate
- アドオン: GitLab Duo Enterprise、GitLab Duo with Amazon Q
SAST脆弱性レポートを表示しているときに、GitLab Duo Chatに脆弱性について説明するように依頼できます。
詳細については、脆弱性の説明を参照してください。
新しい会話を作成する
- アドオン: GitLab Duo ProまたはEnterprise
- 提供形態: GitLab.com
- エディタ: GitLab UI
GitLab 17.10以降では、Chatと複数の同時会話を行うことができます。
- Chatドロワーの左上隅で、新しいチャットを選択します。
- テキストボックスに
/newと入力し、Enterキーを押すか、送信を選択します。
会話を削除または新しい会話を開始する
会話を削除するには、チャット履歴を使用します。
チャットウィンドウをクリアして同じ会話スレッドで新しい会話を開始するには、/resetと入力し、送信を選択します。
どちらの場合も、新しい質問をするときに会話履歴は考慮されません。コンテキストを切り替えるときに新しい会話を開始すると、Duo Chatが無関係な会話によって混乱することがないため、回答の改善に役立つ場合があります。
GitLab Duo Chatスラッシュコマンド
Duo Chatには、ユニバーサル、GitLab UI、IDEコマンドのリストがあり、それぞれの前にスラッシュ(/)が付きます。
コマンドを使用すると、特定のタスクをすばやく実行できます。
ユニバーサル
- アドオン: GitLab Duo Core、Pro、またはEnterprise。
- エディタ: GitLab UI、Web IDE、VS Code、JetBrains IDE
| コマンド | 目的 |
|---|---|
| /new | 新しい会話を開始するが、以前の会話はチャットの履歴に保持する |
| /reset | チャットウィンドウをクリアして、会話をリセットする |
| /help | Duo Chatの動作について詳しく学ぶ |
GitLab.comでは、GitLab 17.10 以降、複数の会話を行っている場合、/clearおよび/resetスラッシュコマンドは/newスラッシュコマンドに置き換えられます。
GitLab UI
- アドオン: GitLab Duo Enterprise
- エディタ: GitLab UI
これらのコマンドは動的であり、Duo Chat使用時にGitLab UIでのみ使用できます:
| コマンド | 目的 | エリア |
|---|---|---|
| /summarize_comments | 現在のイシューに関するすべてのコメントの要約を生成する | イシュー |
| /troubleshoot | 根本原因分析を使用して失敗したCI/CDジョブのトラブルシューティングを行う | ジョブ |
| /vulnerability_explain | 現在の脆弱性について説明する | 脆弱性 |
IDE
- アドオン: GitLab Duo Core、Pro、またはEnterprise。
- エディタ: Web IDE、VS Code、JetBrains IDE
これらのコマンドは、サポートされているIDEでDuo Chatを使用する場合にのみ機能します:
| コマンド | 目的 |
|---|---|
| /tests | テストケースを作成する |
| /explain | コードを説明する |
| /refactor | コードをリファクタリングする |
| /fix | コードを修正する |
| /include | ファイルのコンテキストを含める |
