Skip to content

Add MicrobotsLogAnalyzer custom ADO task support#141

Open
MadhurAggarwal wants to merge 1 commit intomicrosoft:mainfrom
MadhurAggarwal:madagg/log-analyzer-ado-task
Open

Add MicrobotsLogAnalyzer custom ADO task support#141
MadhurAggarwal wants to merge 1 commit intomicrosoft:mainfrom
MadhurAggarwal:madagg/log-analyzer-ado-task

Conversation

@MadhurAggarwal
Copy link
Copy Markdown
Member

Adds a custom Azure DevOps task, MicrobotsLogAnalyzer@0, for running Microbots LogAnalysisBot against log files using Azure OpenAI models, with authentication through an Azure Resource Manager Service Connection.

Overview

  • Added the MicrobotsLogAnalyzerTask Azure Pipelines task.
  • Added Azure DevOps extension manifest and npm dependencies required by the task for connecting to Service Connection.
  • Added documentation for Packaging, Publishing, and Using the task in a pipeline.
  • Added a sample Azure Pipelines YAML file.

Change Details

  • .gitignore: Ignores generated node_modules folders used while packaging the ADO task.
  • README.md: Added a brief guide for the new MicrobotsLogAnalyzerTask.
  • azure-pipelines/vss-extension.json: Defines the ADO extension that contributes the custom pipeline task. This file is needed for publishing the task.
  • azure-pipelines/MicrobotsLogAnalyzerTask/task.json: Defines the MicrobotsLogAnalyzer@0 task metadata, inputs, Node 20 handler, and task restrictions (restrictions ensure that LLM Outputs don't setup unwanted ENVs in ADO Pipeline, for example printing ##vso[task.setvariable as part of Log RCA)
  • azure-pipelines/MicrobotsLogAnalyzerTask/index.js: Implements Main Workflow: validates inputs, logs into Azure Service Connection, prepares Python venv, runs LogAnalysisBot, and prints the analysis.
  • azure-pipelines/MicrobotsLogAnalyzerTask/package.json: Declares the Node dependencies required by the task.
  • azure-pipelines/MicrobotsLogAnalyzerTask/package-lock.json: Locks task Node dependency versions for reproducible packaging.
  • docs/azure-pipelines-log-analyzer.md: Documents prerequisites, packaging, publishing, usage, inputs, and task behavior.
  • docs/examples/azure-pipelines/microbots-log-analyzer.yml: Provides a sample ADO YAML for using MicrobotsLogAnalyzer@0.
  • mkdocs.yml: Adds the new Azure Pipelines Log Analyzer guide to the docs navigation.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.25%. Comparing base (4505642) to head (cce98a7).

❗ There is a different number of reports uploaded between BASE (4505642) and HEAD (cce98a7). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (4505642) HEAD (cce98a7)
integration 1 0
slow-browser 1 0
ollama_local 1 0
slow-other 1 0
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
- Coverage   64.38%   58.25%   -6.13%     
==========================================
  Files          33       33              
  Lines        2333     2333              
==========================================
- Hits         1502     1359     -143     
- Misses        831      974     +143     
Flag Coverage Δ
integration ?
ollama_local ?
slow-browser ?
slow-other ?
unit 58.25% <ø> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}

function runLogAnalyzer(python, inputs) {
const script = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its good to put this script in a .py file and run it from here, instead of passing them as strings

const VENV_NAME = "microbots-log-analyzer-venv";
const VENV_READY_MARKER = ".microbots-venv-ready-v1";

function runCommand(command, args, env) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its good to add tests for this file


function microbotsEnvironment(inputs) {
return Object.assign({}, process.env, {
OPEN_AI_DEPLOYMENT_NAME: inputs.deploymentName,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#140 refer to this PR for the env variables, you should remove the OPEN_AI_* variables from these

OPEN_AI_API_VERSION: inputs.apiVersion,
AZURE_OPENAI_ENDPOINT: inputs.endpoint,
AZURE_OPENAI_API_VERSION: inputs.apiVersion,
AZURE_AUTH_METHOD: "azure_ad",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are passing the token_provider explicitly later in code , you dont need to set this env var, this gets overridden by the token_provider
https://github.com/microsoft/microbots/blob/main/docs/authentication.md#option-b-pass-a-token-provider-programmatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants