If playback doesn't begin shortly, try restarting your device.
•
You're signed out
Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer.
CancelConfirm
Share
An error occurred while retrieving sharing information. Please try again later.
We asked GitLab Duo Chat how to start a new C# project and learned how to use the dotnet CLI. The first Code Suggestions challenge is not tiny - query the GitLab REST API and print the response. The code works -- we asked Chat for help with .gitignore and CI/CD configuration for C#. The CI/CD jobs fail, and Root Cause Analysis helps out.
Next, we explore code tasks and let Chat /explain the REST API calls in the source code. To create tests later, we ask GitLab Duo to /refactor the selected code into a function. We refined the prompt to `/refactor into the public class` to get code that can be accessed from the test project.
The code gets /tests generated using a code task in Duo Chat.
We also learned that C# solutions should contain the application and test project side-by-side to avoid import inception problems. After solving them, we added more tests with the help of code suggestions. The coffee chat concludes with running tests in CI/CD…...more
GitLab Duo Coffee Chat: Get started with C# and use code task /explain, /refactor, /tests prompts
6Likes
829Views
2024Jan 30
We asked GitLab Duo Chat how to start a new C# project and learned how to use the dotnet CLI. The first Code Suggestions challenge is not tiny - query the GitLab REST API and print the response. The code works -- we asked Chat for help with .gitignore and CI/CD configuration for C#. The CI/CD jobs fail, and Root Cause Analysis helps out.
Next, we explore code tasks and let Chat /explain the REST API calls in the source code. To create tests later, we ask GitLab Duo to /refactor the selected code into a function. We refined the prompt to `/refactor into the public class` to get code that can be accessed from the test project.
The code gets /tests generated using a code task in Duo Chat.
We also learned that C# solutions should contain the application and test project side-by-side to avoid import inception problems. After solving them, we added more tests with the help of code suggestions. The coffee chat concludes with running tests in CI/CD, our first C# solution with the help of GitLab Duo.
Guest: Lee Tickett, Fullstack Engineer, Contributor Success, @leeticket-gitlab
Resources
Table of Content
0:00 Introduction
1:30 Ask Duo Chat how to setup C#
2:35 Move Duo Chat to the right panel in VS Code
5:00 Install C# VS Code extension
8:55 dotnet new console CLI
10:55 Code Suggestions in C#: Query REST API
12:40 Use /explain to explain generated code
14:54 Organize code with .gitignore, add CI/CD, ask Duo Chat
16:10 Chat Beta feedback: Context missing, suggestions improvements
18:50 Refine prompts with more context, or start over
22:25 CI/CD broken - use Root Cause Analysis
26:00 Fixed CI/CD
26:30 /refactor code into testable function
28:50 Explain await/async in C#
32:00 /tests to generate tests
33:30 Test project? Help needed
35:30 Chat Beta feedback: Refined prompts
40:35 Test directory in the solution
47:00 Debug Test import errors with Chat
51:12 Dogfooding thoughts
56:05 Confused by structure, test and app should be side by side
58:50 Explain the compiler error with Chat
1:00:00 Refined prompts for code tasks: /refactor into public class
1:05:50 Add more C# tests
1:15:18 Run tests in CI/CD
1:19:15 Success and conclusion…...more