Extract Azure DevOps Pull Request metrics to SQLite and generate PowerBI-compatible CSVs.
Project description
ADO Git Repo Insights
[!NOTE] Python Compatibility: Requires Python 3.12 or later. Uses pandas 3.x.
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.
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.
What you get
# 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
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
📚 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 |
| Demo Data Versioning | Canonical demo build and parity policy |
| UI Bundle Sync | Dashboard UI synchronization process |
| Changelog | Version history and release notes |
📋 Governance
| Document | Description |
|---|---|
| Invariants | 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
- Extract — Fetches completed PRs from Azure DevOps REST API
- Store — Persists data in SQLite with UPSERT semantics
- Generate — Produces PowerBI-compatible CSVs and dashboard aggregates
- 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).
Comment extraction is opt-in via --include-comments on extract; to cover PR comments for history that predates enabling it, run the one-time backfill-comments subcommand — see the extension guide or CLI guide.
🤖 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:
- task: ExtractPullRequests@2
inputs:
generateAggregates: true
enablePredictions: true
Features:
- Cycle time forecasts using historical trends
- Throughput predictions for capacity planning
- Confidence intervals for forecast accuracy
AI Insights (Optional)
Enable AI-powered analysis of your PR patterns. Requires an OpenAI API key.
Setup:
- Get an API key from platform.openai.com/api-keys
- Add
OPENAI_API_KEYas a secret variable in your ADO pipeline or variable group - Add to your pipeline YAML:
- task: ExtractPullRequests@2
inputs:
generateAggregates: true
enableInsights: true
openaiApiKey: $(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.12+ (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.jsonuses npm for semantic-release tooling. Only theextension/directory uses pnpm.
Python Development
# Install with development dependencies
pip install -e ".[dev]"
# Run tests
python scripts/run_pytest.py
# Run linting
ruff check .
Demo Parity Build
The public demo and CLI synthetic demo are governed by one canonical demo publish flow:
python scripts/build_demo.py
This rebuilds the extension UI shell, republishes the GitHub Pages demo surface, regenerates artifacts/demo-enterprise/, and promotes the published mirror under docs/data/.
For manual generated-asset sync outside the full demo build, use:
python scripts/manage_generated_artifacts.py sync --scope ui
python scripts/manage_generated_artifacts.py sync --scope all
Manual Demo Preview
For local manual testing of the synthetic demo dashboard in PowerShell:
cd extension
pnpm install
pnpm run build:ui
cd ..
python scripts/publish-demo-surface.py --source extension/dist/ui --docs-dir docs
python scripts/build-demo-dataset.py
cd docs
python -m http.server 8080
Open http://localhost:8080.
For repeat runs after dependencies are already installed:
cd extension
pnpm run build:ui
cd ..
python scripts/publish-demo-surface.py --source extension/dist/ui --docs-dir docs
python scripts/build-demo-dataset.py
cd docs
python -m http.server 8080
🔒 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
- Issues & Features: GitHub Issues
- Publisher: OddEssentials
📄 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ado_git_repo_insights-101.12.2.tar.gz.
File metadata
- Download URL: ado_git_repo_insights-101.12.2.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a13943fd143e80b0dfe712ac706466a89b7e22623afb8d7e6019f899b728320
|
|
| MD5 |
fef690c718ff95cd8d8d10ed71c6da56
|
|
| BLAKE2b-256 |
886dee4f9078555ab4d0da1036bb20cf69b4475d49faadff9c66554b8e6f2ea3
|
Provenance
The following attestation bundles were made for ado_git_repo_insights-101.12.2.tar.gz:
Publisher:
release.yml on oddessentials/ado-git-repo-insights
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ado_git_repo_insights-101.12.2.tar.gz -
Subject digest:
8a13943fd143e80b0dfe712ac706466a89b7e22623afb8d7e6019f899b728320 - Sigstore transparency entry: 1342797204
- Sigstore integration time:
-
Permalink:
oddessentials/ado-git-repo-insights@878bd771bc4ac5b15a619c1c6045fabf4530a547 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/oddessentials
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@878bd771bc4ac5b15a619c1c6045fabf4530a547 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ado_git_repo_insights-101.12.2-py3-none-any.whl.
File metadata
- Download URL: ado_git_repo_insights-101.12.2-py3-none-any.whl
- Upload date:
- Size: 275.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9cabfed4b0b9438ff891b3c8f3962371fbe96eb3c37cf6de79340cba491bc4f
|
|
| MD5 |
0e7f1133fe02bbd2588e601e8e932c8d
|
|
| BLAKE2b-256 |
1c4c6d79731f8f83c2944d1ed090ae49258ab40f7ba6328eec9d7c77a385885a
|
Provenance
The following attestation bundles were made for ado_git_repo_insights-101.12.2-py3-none-any.whl:
Publisher:
release.yml on oddessentials/ado-git-repo-insights
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ado_git_repo_insights-101.12.2-py3-none-any.whl -
Subject digest:
c9cabfed4b0b9438ff891b3c8f3962371fbe96eb3c37cf6de79340cba491bc4f - Sigstore transparency entry: 1342797218
- Sigstore integration time:
-
Permalink:
oddessentials/ado-git-repo-insights@878bd771bc4ac5b15a619c1c6045fabf4530a547 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/oddessentials
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@878bd771bc4ac5b15a619c1c6045fabf4530a547 -
Trigger Event:
push
-
Statement type: