Configuring Unravel in Azure DevOps
Configuring Unravel with Azure Devops enhances collaboration and insights within your development process. This integration promotes efficient code reviews, insights-driven decisions, and optimized application deployment.
Prerequisites
Create a new account named Unravel-Bot with an administrator role. Perform the configuration steps with the newly created Unravel-Bot account.
Configuration Steps:
Note
You can directly place the azure-pipelines.yml file and the azuredevopsclient.py script in the Repos. However, even after placing these files directly, you'll still need to configure the required variables to enable Unravel insights within your Azure DevOps environment.
Create a New Pipeline.
Go to Pipelines and select New Pipeline.
Choose Azure Repos Git and specify the relevant repository.
Under Configure your Pipeline, click Starter Pipeline to select a starter pipeline.
Note
The pipeline that you create is compatible with multiple repositories.
Open the
azure-pipelines.yml
file. Clear its content and replace it with the content provided by Unravel.Define Mandatory Variables.
Click Variables and select New Variable.
Create the following mandatory variables:
Important
Select Keep this Value a Secret while adding the secrets.
unravel_url: Enter your Unravel instance's URL
unravel_jwt_token:
Obtain this token by logging in to Unravel. Click on your user icon and then click Copy Login Token.
Paste the token in a text editor and add JWT (all upper case followed by a space) in the beginning of the token. Enclose the token after adding JWT in single quotes as shown here:
'JWT <Your Token>'
Copy the entire token and paste it in the Value fiel.
Personal Access Token (pat): Generate a pat with full access. To do this, navigate to user settings, then personal access tokens. Provide details such as Name, Organization, Expiration (UTC), and select Full Access under Scopes. Click Create to generate the token.
Configure Optional Variables (Slack and Jira).
Important
Only unravel_url, unravel_jwt_token, and pat are mandatory for successful configuration. The remaining variables are optional and should only be configured if you wish to enable notifications in those channels.
For Slack notifications, configure the following variable:
SLACK_WEBHOOK: If you want to receive Slack notifications, provide your Slack webhook URL.
For Jira integration, set up the following variables:
JIRA_PROJECT_KEY: Enter your Jira project key.
JIRA_EMAIL: Add the email ID of your Jira administrator.
JIRA_DOMAIN: Specify your Jira domain.
JIRA_API_TOKEN: Provide the API token of your Jira administrator.
Save and Apply Variables.
Enable Pipelines.
Note
Whenever you create a new pipeline, you must return to the Branch Policies and enable it to ensure Unravel integration.
Go to Repos --> Branches, and select your main branch.
Access More Options and select Branch Policies.
All the pipelines are listed under the Branch Policies. Enable the pipelines that you intend to use.
Unravel is successfully configured in Azure DevOps.
Viewing insights in pull Requests with Unravel-Bot
When a pull request is raised, the Unravel-Bot account (mentioned as Unravel-Bot) provides insightful comments during the code review process. These comments are aimed at helping you make informed decisions based on comprehensive data. Here's how you can view the insights provided by the Unravel Bot:
Pull request
Raise a pull request.
Paste the link of your Databricks job run in the PR description.
Unravel-Bot analyzes the changes made in the code and provides recommendations.
Unravel-Bot's comment
As part of the code review, Unravel-Bot posts a comment on the pull request, sharing valuable insights. The Unravel Bot retrieves crucial details from the cluster. This includes Workspace, Run ID, and Job ID. Utilizing the collected information, the Unravel Bot compiles extensive data related to the application.
Unravel-Bot's comment
As part of the code review, the Unravel-Bot post a comment on the pull request, sharing valuable insights. The Unravel Bot will retrieve crucial details from the cluster. This includes Workspace, Run ID, and Job ID. Utilizing the collected information, the Unravel Bot compiles extensive data related to the application.
The insights the Unravel Bot shares include App ID within Databricks, cluster ID, estimated cost, executor node type, driver node details, applied tags, and auto-scale settings.
Click the App ID or Cluster ID to view more information about the APP or Cluster. You can also view the Unravel insights and take necessary actions based on the recommendations.
Unravel's Insights
The comments will present the factual data and provide Unravel's valuable insights associated with the cluster. The insights comment will highlight critical factors such as bottlenecks, application failures, and cost efficiency.
By incorporating these insights into the code review process, the Unravel Bot empowers you to make well-informed decisions. This holistic approach considers technical aspects, performance, cost, and efficiency considerations. This proactive integration of insights fosters a culture of data-driven development, helping you create optimized applications with enhanced performance and reduced costs.