Blog Post

Healthcare and Life Sciences Blog
4 MIN READ

OpenAI’s GPT-3  to Triage Azure DevOps Bugs

VinodSoni's avatar
VinodSoni
Icon for Microsoft rankMicrosoft
Feb 28, 2023

 

How do you track and manage defects in your code? How do you make sure software problems and customer feedback get addressed quickly to support high-quality software deployments? And, how do you make good progress on new features and address your technical debt?

 

At a minimum, you need a way to capture your software issues, prioritize them, assign them to a team member, and track progress. And, you want to manage your code defects in ways that align with your Agile practices.

 

To support these scenarios, Azure Boards provides a specific work item type to track code defects named Bug.

 

When attempting to resolve bugs, we sometimes don’t always have all the information we need, especially when dealing with urgent production issues. In these cases, we often create a bug in Azure DevOps system with some information e.g. repro steps. 

 

For this kind of urgent issue our development team members need some primary analysis or troubleshooting steps. Developer has to browse the internet and look the solution around the problem in a normal part of the software development cycle (e.g. some kind triage notes).

 

OpenAI’s GPT-3 is a game-changer in the bug hunting industry. Its ability to generate natural language content with high accuracy and coherence makes it an invaluable tool for identifying potential security vulnerabilities in software applications.

 

In this article, I will explain how you can implement an automation solution to triage a bug and best practices in Azure DevOps. We can implement this solution using Power Automate, Logic Apps and integration with OpenAI GPT-3 & Azure DevOps. I am going to use Power Automate in this article. 

 

Below are standard steps.

 

Step 1: Go to link - Microsoft Flow(Power Automate) to setup new  workflow.

 

Step 2: Go to create option to setup new workflow using automate cloud flow option.

 

 

Step 3: First step in the workflow is to add action called “Create a work item” to trigger the workflow (as shown in below screenshot). You can specify your Azure DevOps organization, teams details and specify the type of work item. In my example work item type is “Bug”. So whenever a bug will introduce in system my workflow will be triggered.

 

 

Step 4: In next step, we can store the "repro steps" of bugs in a separate variable. We are storing it in a separate variable so we can remove the formatting applied to the "repro steps" in Azure DevOps editor. 

 

 

Note: You can see below sample work item "Bug" in Azure DevOps. We can see there are different kind of formatting styles (e.g. bold, italic, bullet, underline) are applied at text and we have to pass the “repro steps” as plain text to Open AI (without any special characters). 

 

Step 5: In the next step we will use HTML action to remove the formatting applied to “Repro Steps” and convert it into variable as plain text (look below two steps).

 

 

Step 6: Next step is very important in this workflow. In this step we are calling OpenAI API. We can interact with the API through HTTP requests from any language or actions. The OpenAI API uses API keys for authentication. Visit your API Keys page to retrieve the API key you'll use in your requests. You can refer the documentation how to setup OpenAI free account and setup API keys - API Reference - OpenAI API

 

In my case I am using “HTTP” action to call the API by passing URL, Headers and Body. You can see in body, I passed variable value as plaintext (which contains bug repro steps).

 

HTTP actions enable you to interact with APIs and send web requests that perform various operations, such as uploading and downloading data and files.

 

To send an API request, like POST, GET, PUT, or DELETE, use the Invoke web service action.

In the action's properties, you must populate the service's URL and the appropriate HTTP method. Additionally, you must choose the request and response content type, such as XML and JSON. You can read more about “HTTP” action at this link - HTTP actions reference - Power Automate | Microsoft Learn.

 

I am using GPT-3 > text-davinci-003 model in request body which can understand and generate natural language. If you want to know more about GPT-3 models you can refer the link for more details - Models - OpenAI API

 

 

Step 7: In next step we have to store the “choices” and “text” received as response from “HTTP” action (after submitting the POST request) and update the “History” filed of work item “bug”.

 

 

In below example you can see I just passed the work item “Repro steps” as plaintext (e.g. some terraform help) and the response result updated in the discussion section. These triage notes can be very helpful for a team member for initial analysis about the bug.

 

 

Finally our workflow will look like this. You can integrate more steps as per business requirement needs and extend the functionality.

 

 

Conclusion

 

OpenAI’s GPT-3 is a game-changer in the bug hunting industry. Its ability to generate natural language content with high accuracy and coherence makes it an invaluable tool for identifying potential security vulnerabilities in software applications.

 

Feel free to leave your comment and share feedback. 

 

Updated Feb 28, 2023
Version 2.0
No CommentsBe the first to comment