OpenAI’s GPT-3  to Triage Azure DevOps Bugs

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.

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 bug in Azure DevOps system with some initial steps (e.g. about issue, replication 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. 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 specific your Azure DevOps organization, teams details and specify the type of work item. In my example it’s work item type is “Bug”. So whenever a bug will introduce in system my workflow will trigger.

 

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 separate variable so we can remove the formatting applied to test in Azure DevOps.

 

VinodSoni_4-1677543177300.png

 

Note: Sample Work item Bug in Azure DevOps – You can see there are different kind of formatting styles are applied at text and we want to pass the “repro steps” as plain text to Open AI.

VinodSoni_5-1677543177302.png

 

 

Step 5: In the next step we are using 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” retrieve as response from “HTTP” action and update the “History” filed of work item “bug”.

 

VinodSoni_8-1677543177308.png

 

In below example you can see I passed the work item “Repro steps” as plaintext (e.g. some terraform help) and response update 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

 

At the end the workflow will be 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. 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.