Submind YouTube summaries
Thumbnail for GitLab + Claude Code: Streamlining Bug Fixes and Code Reviews

GitLab + Claude Code: Streamlining Bug Fixes and Code Reviews

Watch on YouTube

Video summary

In this video, Michael from GitLab demonstrates a seamless workflow integrating Claude Code with the GitLab platform to streamline bug fixing and code reviews using the Tanuki IoT project as a case study. The scenario begins when an Arduino-based IoT collector crashes during its build process due to specific errors in the C++ source code. By invoking Cloud Code directly from the terminal, Michael provides a natural language prompt asking for assistance with the crash. Claude Code immediately takes action by analyzing the environment and executing `make` commands along with Apple Clang compilers to diagnose and fix the underlying issues within the application logic. Once the bugs are resolved, the workflow continues automatically as Cloud Code handles Git operations such as creating a new branch, committing changes, and pushing them to the remote repository without requiring manual command-line intervention for users who may not be familiar with every Git syntax detail. Upon triggering these actions, GitLab's CI/CD pipelines kick off immediately to verify that the fixes work correctly in an automated testing environment. The system also generates a merge request based on the input provided by Cloud Code, which includes detailed descriptions of the changes made and sets up necessary approval workflows involving configured code owners before any merging can occur. The review process is further enhanced through GitLab Duo Agent Platform, which automatically initiates a comprehensive code review session as soon as the merge request is created. Users can observe the agent's reasoning in real-time via detailed logs or stick to high-level summaries that highlight key improvements like proper exception handling and corrected memory management using smart pointers compliant with project style guides. Additionally, GitLab Advanced Security Scanning runs concurrently against C++ codebases to ensure no new vulnerabilities are introduced; notably, addressing the original crash bug inadvertently fixed a separate security issue as well, resulting in clean scan results across all checks. Ultimately, this demonstration illustrates how combining Claude Code's generative capabilities with GitLab Direction Platform creates an efficient loop for developers that covers analysis, fixing, testing, reviewing, and securing code within a single cohesive workflow. The integration allows teams to maintain high standards of quality while reducing the manual effort required to navigate complex build environments or adhere to strict coding conventions in C++. By automating repetitive tasks like branch creation, pipeline triggering, and security scanning, developers can focus more on architectural decisions rather than routine maintenance, proving that modern AI tools significantly enhance productivity without compromising safety or code integrity.
Read the full video transcript
Hello everyone. My name is Michael and I'm a developer advocate here at GitLab. Today I want to dive into Cloud Code and how to how it works with GitLab. The project that we can see here is the Tanuki IoT platform. It's comprised of different sensors collecting metrics um from the IoT stack showcasing different programming languages. Um with Cloud Code, we want to dive into fixing a bug um in one of the work items which we can see over here. And um specifically the IoT collector for the Arduino sensor doesn't work. Um the build fails and there are certain information for um available for that. One of the one of the things I can do now, um I can switch to Cloud Code in my terminal. Which we can do just in a second over here. Launch Cloud Code using the CLI command. And we can see um the interface here. Um please help me fix the uh Arduino IoT collector sensor. It crashes. And then Cloud goes to work. And uh we can see here it invokes C make, which is the building infrastructure tooling um to actually um configure the project. And now it's running um the compiler. Which is Mac OS here Apple clang um to actually build and verify the changes um directly over here. Um now it's fixed the two bugs. And the next step is to um um create um a Git branch. We can either do that manually like typing exclamation mark Git checkout -b fix uh Arduino sensor. This would be one way. Uh or we could also say please help me create a merge request um in GitLab or create a branch. Uh please help me commit the changes. And it should figure figure that out. So, it it really depends on whether you're capable of whether you know all the Git commands or you want additional help from from Cloud Code here. Yes, we want to proceed. Um it shows a preview of the Git commit. And the next step is to actually run Git push. And we can see here that we have the remote message to create a new merge request. So, we switch back um to the GitLab UI here. And uh we can see that it creates the merge request um description from um from that input. And let's just create that. And the next step is a GitLab or following the GitLab workflow here um to trigger off the pipelines, which have been kicked off. We also see that this merge request requires an approval. So, there are code owners configured um and the merge request is not allowed to being merged without any specific reviews. And um everything else was a must continue. Now, um for the review itself, we can either assign a reviewer like a human, or as you can see here, GitLab Duo Agent Platform, the code review flow already started. So, it's automatically whenever um a merge request gets created, um a new review session um kicks off. So, we will get immediate review feedback as well. Um and then additionally, uh can work on that specific feedback. Let's see. Uh over here on the right-hand side, we have the GitLab sessions, or GitLab Duo sessions, uh where we can immediately follow along um how it's building up the review context. Uh it's currently running. I triggered that. I could also go deep into um the remote flow executor, uh the not the remote flow, the flow executor that's running on a GitLab CI CD runner, um or just follow along which actions it takes um to conduct the review. Uh let's click on that quickly, and we can see a lot of deep down output and in uh insights. So, it's it's helpful when you want to debug why or how uh a flow is behaving. Um but essentially, it's easier um to follow along the high-level summaries. Um you can see the agent reasoning here. And after a while, it completes the review and will post a comment for us in uh the merge request, which we can navigate back here quickly. We can see the pipelines are running. And um GitLab Duo finished the the review. It summarizes it to the crash bug have bugs have been fixed. Exception handling was implemented. Memory management was corrected. So, it correctly uses um smart pointers, which is a custom instruction in this repository to to implement code style best practices. And this Yeah. The summary the code review worked correctly. Pipelines are still running. Um but we can see the Arduino collector built correctly. So, the changes are correct. And last but not least, we also see that the security scanners also have run. So, we have um GitLab Advanced SAS here. We also have GitLab Advanced SAS specifically for C++. Um there are no new security findings. Um everything is green here. So, we don't have um that specific vulnerability. And um we can also see we fixed um a vulnerability while addressing the crash itself. So, the verification here is okay. I can approve that merge request now. And when I do that, I'm I can actually merge that into the main branch. I won't do that now um because we want to do a little more um on on this specific use case. But that's basically it for now. To summarize, we learned how to use Cloud Code. Um it analyzed an application crash. And we were able to create a fix, push a merge request, trigger CI/CD pipelines automatically, trigger security scans um automatically, and use GitLab Direction Platform code review flow to get immediate review feedback following the the style guides that are required for this project in C++ and everything looks good. We even fixed the security vulnerability and this shows how GitLab Direction Platform and Cloud Code can work together. Thanks for your attention and see you next time.