Skip to main content

Extract Azure DevOps Pull Request metrics to SQLite and generate PowerBI-compatible CSVs.

Project description

ADO Git Repo Insights

AI Review CI Release

PyPI version Python Python Coverage Python Tests

TypeScript TypeScript Coverage TypeScript Tests

pnpm Node.js

Code Style: Prettier Conventional Commits PRs Welcome Last Commit

License Platform

[!NOTE] Python Compatibility: Python 3.10 uses pandas 2.x; Python 3.11+ uses pandas 3.x. Python 3.10 support will be evaluated in a future release.

Extract Azure DevOps Pull Request metrics to SQLite and generate PowerBI-compatible CSVs.


🚀 Quick Start

Choose your path:

I want to... Use
Analyze PRs for my team via Azure DevOps pipelines ADO Extension
Run analysis locally or integrate into custom CI/CD Python CLI

☁️ Azure DevOps Extension

The ADO Extension provides a self-contained pipeline task with a built-in PR Insights Dashboard directly in your Azure DevOps project.

Install from Marketplace

What you get:

  • Pipeline task that extracts PR metrics automatically
  • Interactive dashboard in your ADO project navigation
  • No Python installation required
  • PowerBI-compatible CSV exports

Get started: Extension User Guide

Minimal Pipeline Example

variables:
    - group: ado-insights-secrets # Contains PAT_SECRET

steps:
    - task: ExtractPullRequests@2
      inputs:
          organization: "MyOrg"
          projects: "Project1,Project2"
          pat: "$(PAT_SECRET)"

    - publish: $(Pipeline.Workspace)/aggregates
      artifact: aggregates

🐍 Python CLI

The Python CLI provides full control for local analysis, custom scripts, and non-ADO CI/CD systems.

Installation

Recommended: pipx (handles PATH automatically)

pipx install ado-git-repo-insights

Alternative: uv (fast, modern)

uv tool install ado-git-repo-insights

Advanced: pip (manual PATH setup may be needed)

pip install ado-git-repo-insights
# If 'ado-insights' not found, run: ado-insights setup-path

Verify installation: ado-insights --version

Diagnose issues: ado-insights doctor

Get started: CLI User Guide

Basic Usage

# Extract PR data
ado-insights extract \
  --organization MyOrg \
  --projects "Project1,Project2" \
  --pat $ADO_PAT \
  --database ./ado-insights.sqlite

# Generate CSVs for PowerBI
ado-insights generate-csv \
  --database ./ado-insights.sqlite \
  --output ./csv_output

# View local dashboard
ado-insights build-aggregates --db ./ado-insights.sqlite --out ./dataset
ado-insights dashboard --dataset ./dataset --open

📚 Documentation

👤 For End Users

Document Description
Extension User Guide Complete setup for ADO Extension users
CLI User Guide Complete setup for Python CLI users
Troubleshooting Common issues and solutions

📖 Reference

Document Description
CLI Command Reference All CLI commands and options
Task Input Reference Extension task configuration
CSV Schema PowerBI-compatible output format
Dataset Contract Dashboard data format specification
Architecture System design and data flow diagrams

⚙️ Operations

Document Description
Runbook Monitoring, recovery, and operational procedures
Data Retention Storage model and security posture

🛠️ For Developers

Document Description
Contributing Guide How to contribute to this project
Development Setup Setting up the development environment
Testing Guide Running and writing tests
UI Bundle Sync Dashboard UI synchronization process
Changelog Version history and release notes

📋 Governance

Document Description
Invariants 25 non-negotiable system invariants
Definition of Done Completion criteria for features
Victory Gates Verification checkpoints

⚖️ Feature Comparison

Feature CLI Extension
Installation pip install ADO Marketplace
Requires Python Yes No (bundled)
Pipeline syntax Script steps Task step
Works outside ADO Yes No
PR Insights Dashboard Local server Built into ADO
Configuration YAML file or CLI args Task inputs
Flexibility Higher Standard

⚡ How It Works

  1. Extract — Fetches completed PRs from Azure DevOps REST API
  2. Store — Persists data in SQLite with UPSERT semantics
  3. Generate — Produces PowerBI-compatible CSVs and dashboard aggregates
  4. Visualize — View metrics in the PR Insights Dashboard

The system uses incremental extraction by default (daily) with optional backfill mode to catch late changes (reviewer votes, status updates).

PR Insights Dashboard


🤖 ML Features (Optional)

The dashboard supports optional ML-powered features for forecasting and insights. These features require additional pipeline configuration.

Predictions (Time-Series Forecasting)

Enable ML-powered forecasting for PR throughput and cycle times. Zero-config — no API key required.

Add to your pipeline YAML:

build-aggregates:
    run-predictions: true

Features:

  • Cycle time forecasts using historical trends
  • Throughput predictions for capacity planning
  • Confidence intervals for forecast accuracy

AI Insights (OpenAI-Powered)

Enable AI-powered analysis of your PR patterns. Requires an OpenAI API key.

Setup:

  1. Get an API key from platform.openai.com/api-keys
  2. Add OPENAI_API_KEY as a secret variable in your ADO pipeline or variable group
  3. Add to your pipeline YAML:
build-aggregates:
    run-insights: true
    openai-api-key: $(OPENAI_API_KEY)

Features:

  • Automated bottleneck identification
  • Reviewer workload recommendations
  • Process improvement suggestions

Cost: Approximately $0.001-0.01 per pipeline run (uses GPT-4o-mini).

Data Privacy: Only aggregated metrics are sent to OpenAI. The following are never sent:

  • PR titles, descriptions, or content
  • User identities or email addresses
  • Code changes or file contents
  • Comments or review feedback

Troubleshooting ML Features

State Cause Solution
Setup Required Artifact file not found Enable feature in pipeline YAML and run pipeline
No Data Empty forecasts/insights array Accumulate more historical data (min. 4 weeks recommended)
Invalid Artifact JSON parse or validation error Check pipeline logs for generation errors
Unsupported Schema Version mismatch Update dashboard extension to latest version

🛠️ Developer Setup

Prerequisites

  • Node.js 22+
  • Python 3.10+ (for backend/CLI)
  • pnpm (for extension development)

Extension Development

The extension uses pnpm exclusively. npm is not supported.

# Enable Corepack (provides pnpm)
corepack enable

# Install dependencies
cd extension
pnpm install

# Build
pnpm run build

# Run tests
pnpm test

# Package VSIX
pnpm run package:vsix

Note: The root package.json uses npm for semantic-release tooling. Only the extension/ directory uses pnpm.

Python Development

# Install with development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linting
ruff check .

🔒 Security

  • PAT with Code (Read) scope — Minimum required permission
  • PATs are never logged — Secrets are redacted from all output
  • No secrets stored at rest — Database contains only PR metadata
  • Dashboard access — Requires Build Read permission on the analytics pipeline

💬 Support


📄 License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ado_git_repo_insights-5.22.2.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ado_git_repo_insights-5.22.2-py3-none-any.whl (182.5 kB view details)

Uploaded Python 3

File details

Details for the file ado_git_repo_insights-5.22.2.tar.gz.

File metadata

  • Download URL: ado_git_repo_insights-5.22.2.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ado_git_repo_insights-5.22.2.tar.gz
Algorithm Hash digest
SHA256 2fcdd3d63ca3ffe585b26c1cf707d5f3813c010b08372c0939918b0586fc8e82
MD5 fda5dc22877ce5ccf75a8bf02d123372
BLAKE2b-256 3f277f19c688f2e00a726b038bdd79f681e9373edfc155870d862cf672c51a41

See more details on using hashes here.

Provenance

The following attestation bundles were made for ado_git_repo_insights-5.22.2.tar.gz:

Publisher: release.yml on oddessentials/ado-git-repo-insights

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ado_git_repo_insights-5.22.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ado_git_repo_insights-5.22.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0719123b228ca425961443bc7f15c02f50d66995c4aca6c570eaf7ca7c439d9b
MD5 6c80770bbdc1155b1e4106000dac8d92
BLAKE2b-256 001717ad3d54da639066aadb16e2a2c5aac5cbcb8e33c669e055ae4d126f25b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for ado_git_repo_insights-5.22.2-py3-none-any.whl:

Publisher: release.yml on oddessentials/ado-git-repo-insights

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page