OpenAI’s GPT-3  to Triage Azure DevOps Bugs
Published Feb 27 2023 04:18 PM 5,122 Views
Microsoft

VinodSoni_0-1677543177273.png

 

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.

 

VinodSoni_1-1677543177295.png

 

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.

 

VinodSoni_2-1677543177298.png

VinodSoni_3-1677543177299.png

 

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. 

 

VinodSoni_4-1677543177300.png

 

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). 

VinodSoni_5-1677543177302.png

 

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).

 

VinodSoni_6-1677543177304.png

 

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

 

VinodSoni_7-1677543177306.png

 

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”.

 

VinodSoni_8-1677543177308.png

 

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.

 

VinodSoni_9-1677543177312.png

 

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

 

VinodSoni_10-1677543177313.png

 

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. 

 

Co-Authors
Version history
Last update:
‎Feb 28 2023 05:59 AM
Updated by: