ado-workflows-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. ado_workflows_mcp-0.1.0/.copilot/README.md +13 -0
  2. ado_workflows_mcp-0.1.0/.envrc +35 -0
  3. ado_workflows_mcp-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  4. ado_workflows_mcp-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
  5. ado_workflows_mcp-0.1.0/.github/copilot-instructions.md +3 -0
  6. ado_workflows_mcp-0.1.0/.github/pull_request_template.md +22 -0
  7. ado_workflows_mcp-0.1.0/.github/secret_scanning.yml +2 -0
  8. ado_workflows_mcp-0.1.0/.github/workflows/ci.yml +61 -0
  9. ado_workflows_mcp-0.1.0/.github/workflows/release.yml +110 -0
  10. ado_workflows_mcp-0.1.0/.gitignore +36 -0
  11. ado_workflows_mcp-0.1.0/.pre-commit-config.yaml +15 -0
  12. ado_workflows_mcp-0.1.0/CHANGELOG.md +7 -0
  13. ado_workflows_mcp-0.1.0/CODE_OF_CONDUCT.md +40 -0
  14. ado_workflows_mcp-0.1.0/CONTRIBUTING.md +134 -0
  15. ado_workflows_mcp-0.1.0/LICENSE +21 -0
  16. ado_workflows_mcp-0.1.0/PKG-INFO +216 -0
  17. ado_workflows_mcp-0.1.0/README.md +186 -0
  18. ado_workflows_mcp-0.1.0/SECURITY.md +32 -0
  19. ado_workflows_mcp-0.1.0/docs/ARCHITECTURE.md +109 -0
  20. ado_workflows_mcp-0.1.0/pyproject.toml +141 -0
  21. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/__init__.py +16 -0
  22. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/mcp_instance.py +15 -0
  23. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/py.typed +0 -0
  24. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/server.py +17 -0
  25. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/tools/__init__.py +45 -0
  26. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/tools/_helpers.py +32 -0
  27. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/tools/pr_comments.py +220 -0
  28. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/tools/pr_review.py +114 -0
  29. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/tools/pull_requests.py +117 -0
  30. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/tools/repositories.py +88 -0
  31. ado_workflows_mcp-0.1.0/src/ado_workflows_mcp/tools/repository_context.py +117 -0
  32. ado_workflows_mcp-0.1.0/tests/__init__.py +0 -0
  33. ado_workflows_mcp-0.1.0/tests/test_pr_comments.py +632 -0
  34. ado_workflows_mcp-0.1.0/tests/test_pr_review.py +391 -0
  35. ado_workflows_mcp-0.1.0/tests/test_pull_requests.py +323 -0
  36. ado_workflows_mcp-0.1.0/tests/test_repositories.py +193 -0
  37. ado_workflows_mcp-0.1.0/tests/test_repository_context.py +228 -0
  38. ado_workflows_mcp-0.1.0/uv.lock +1827 -0
@@ -0,0 +1,13 @@
1
+ # .copilot Directory
2
+
3
+ This directory contains development notes, collaboration documents, and scripts used during development with GitHub Copilot. These files are excluded from git commits.
4
+
5
+ ## Purpose
6
+
7
+ This folder is for:
8
+ - Development notes and design discussions
9
+ - Scripts and tools used during development
10
+ - AI collaboration artifacts
11
+ - Temporary documentation
12
+
13
+ None of these files are needed for the extension to function or for others to contribute to the project.
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Auto-activate uv virtual environment
4
+ if ! has uv; then
5
+ echo "❌ uv is not installed. Please install it first:"
6
+ echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
7
+ exit 1
8
+ fi
9
+
10
+ # Create virtual environment if it doesn't exist
11
+ if [[ ! -d ".venv" ]]; then
12
+ echo "📦 Creating virtual environment with uv..."
13
+ uv venv
14
+ fi
15
+
16
+ # Activate the virtual environment
17
+ source .venv/bin/activate
18
+
19
+ # Source .envrc.local if present (for user/machine-specific settings)
20
+ if [[ -f ".envrc.local" ]]; then
21
+ echo "🔒 Sourcing .envrc.local..."
22
+ source .envrc.local
23
+ fi
24
+
25
+ # Sync dependencies (including dev dependencies)
26
+ echo "🔄 Syncing dependencies..."
27
+ uv sync --all-extras
28
+
29
+ # Install pre-commit hooks if they don't exist
30
+ if [[ -f ".pre-commit-config.yaml" ]] && ! uv run pre-commit --version >/dev/null 2>&1; then
31
+ echo "🪝 Installing pre-commit hooks..."
32
+ uv run pre-commit install
33
+ fi
34
+
35
+ echo "✅ Environment ready"
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Something isn't working as expected
4
+ title: ""
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Who / What / Why
10
+
11
+ - **WHO:** Who is affected? (e.g., developer using `uvx`, MCP client consumer)
12
+ - **WHAT:** What behavior is broken or unexpected?
13
+ - **WHY:** Why does it matter? What's the impact?
14
+
15
+ ## Steps to Reproduce
16
+
17
+ 1. ...
18
+ 2. ...
19
+ 3. ...
20
+
21
+ ## Expected Behavior
22
+
23
+ What you expected to happen.
24
+
25
+ ## Actual Behavior
26
+
27
+ What actually happened. Include the full error message if applicable.
28
+
29
+ ## Environment
30
+
31
+ - OS: [e.g., Ubuntu 24.04]
32
+ - Python version: [e.g., 3.12.x]
33
+ - MCP client: [e.g., VS Code Copilot, Claude Desktop]
34
+ - Package version: [e.g., 0.1.0]
35
+
36
+ ## Additional Context
37
+
38
+ Any other context — logs, error tracebacks, or MCP inspector output.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a new feature or improvement
4
+ title: ""
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Who / What / Why
10
+
11
+ - **WHO:** Who needs this? (e.g., developer, MCP client, CI pipeline)
12
+ - **WHAT:** What capability or behavior is needed?
13
+ - **WHY:** Why does it matter? What problem does it solve?
14
+
15
+ ## Proposed Solution
16
+
17
+ How do you think it should work?
18
+
19
+ ## Alternatives Considered
20
+
21
+ Any other approaches you thought about and why they're less ideal.
22
+
23
+ ## Additional Context
24
+
25
+ Anything else — related issues, MCP tool API sketches, or workflow examples.
@@ -0,0 +1,3 @@
1
+ ```instructions
2
+ Before starting any task, read and follow the skill-compliance skill.
3
+ ```
@@ -0,0 +1,22 @@
1
+ ## What
2
+
3
+ Brief description of the change.
4
+
5
+ ## Why
6
+
7
+ What problem does this solve or what behavior does it add?
8
+
9
+ ## How
10
+
11
+ Key implementation details — what approach was taken and why.
12
+
13
+ ## Testing
14
+
15
+ - [ ] All checks pass (`task check`)
16
+ - [ ] New BDD tests added, fully specifying the new behavior
17
+ - [ ] Existing tests unmodified (or explain why changes were needed)
18
+ - [ ] Coverage maintained at target level
19
+
20
+ ## Notes
21
+
22
+ Anything reviewers should pay attention to.
@@ -0,0 +1,2 @@
1
+ paths-ignore:
2
+ - "tests/**"
@@ -0,0 +1,61 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.12", "3.13"]
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+
24
+ - name: Install uv
25
+ uses: astral-sh/setup-uv@v4
26
+
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ run: uv python install ${{ matrix.python-version }}
29
+
30
+ - name: Install dependencies
31
+ run: uv sync --extra dev
32
+
33
+ - name: Lint with ruff
34
+ if: matrix.python-version == '3.13'
35
+ run: uv run ruff check src/ tests/
36
+
37
+ - name: Type check with pyright
38
+ if: matrix.python-version == '3.13'
39
+ run: uv run pyright src/ tests/
40
+
41
+ - name: Run tests with coverage
42
+ run: uv run pytest --cov=ado_workflows_mcp --cov-report=term-missing --cov-report=json
43
+
44
+ - name: Extract coverage percentage
45
+ if: github.ref == 'refs/heads/main' && matrix.python-version == '3.13'
46
+ run: |
47
+ COVERAGE=$(python -c "import json; print(int(json.load(open('coverage.json'))['totals']['percent_covered']))")
48
+ echo "COVERAGE_PCT=$COVERAGE" >> $GITHUB_ENV
49
+
50
+ - name: Update coverage badge
51
+ if: github.ref == 'refs/heads/main' && matrix.python-version == '3.13'
52
+ uses: schneegans/dynamic-badges-action@v1.7.0
53
+ with:
54
+ auth: ${{ secrets.GIST_SECRET }}
55
+ gistID: ${{ vars.COVERAGE_GIST_ID }}
56
+ filename: ado-workflows-mcp-coverage-badge.json
57
+ label: coverage
58
+ message: ${{ env.COVERAGE_PCT }}%
59
+ valColorRange: ${{ env.COVERAGE_PCT }}
60
+ minColorRange: 50
61
+ maxColorRange: 100
@@ -0,0 +1,110 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write # create tags and GitHub Releases
9
+ id-token: write # OIDC token for PyPI trusted publishing
10
+
11
+ jobs:
12
+ release:
13
+ runs-on: ubuntu-latest
14
+ # Skip release commits made by semantic-release itself
15
+ if: "!startsWith(github.event.head_commit.message, 'chore(release):')"
16
+ outputs:
17
+ released: ${{ steps.tag.outputs.released }}
18
+ tag: ${{ steps.tag.outputs.tag }}
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0 # full history needed for commit analysis
24
+ fetch-tags: true
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v4
28
+
29
+ - name: Set up Python
30
+ run: uv python install 3.13
31
+
32
+ - name: Install python-semantic-release
33
+ run: uv tool install python-semantic-release
34
+
35
+ - name: Run semantic-release
36
+ env:
37
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38
+ run: semantic-release version --no-push --no-vcs-release --skip-build
39
+
40
+ - name: Push tag and create release
41
+ id: tag
42
+ env:
43
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44
+ run: |
45
+ NEW_TAG=$(git tag --points-at HEAD | grep '^v' | head -1)
46
+ if [ -n "$NEW_TAG" ]; then
47
+ echo "New version: $NEW_TAG"
48
+ git push origin "$NEW_TAG"
49
+ gh release create "$NEW_TAG" \
50
+ --title "$NEW_TAG" \
51
+ --generate-notes \
52
+ --latest
53
+ echo "released=true" >> "$GITHUB_OUTPUT"
54
+ echo "tag=$NEW_TAG" >> "$GITHUB_OUTPUT"
55
+ else
56
+ echo "No new version — no feat: or fix: commits since last tag"
57
+ echo "released=false" >> "$GITHUB_OUTPUT"
58
+ fi
59
+
60
+ build:
61
+ needs: release
62
+ if: needs.release.outputs.released == 'true'
63
+ runs-on: ubuntu-latest
64
+ steps:
65
+ - uses: actions/checkout@v4
66
+ with:
67
+ ref: ${{ needs.release.outputs.tag }}
68
+
69
+ - name: Install uv
70
+ uses: astral-sh/setup-uv@v4
71
+
72
+ - name: Set up Python
73
+ run: uv python install 3.12
74
+
75
+ - name: Install dependencies
76
+ run: uv sync --extra dev
77
+
78
+ - name: Lint
79
+ run: uv run ruff check src/ tests/
80
+
81
+ - name: Type check
82
+ run: uv run pyright src/ tests/
83
+
84
+ - name: Test
85
+ run: uv run pytest --cov=ado_workflows_mcp --cov-report=term-missing
86
+
87
+ - name: Build
88
+ run: uv build
89
+
90
+ - name: Upload dist artifacts
91
+ uses: actions/upload-artifact@v4
92
+ with:
93
+ name: dist
94
+ path: dist/
95
+
96
+ publish:
97
+ needs: build
98
+ runs-on: ubuntu-latest
99
+ environment: pypi # GitHub Environment for deployment protection
100
+ permissions:
101
+ id-token: write # OIDC token for PyPI trusted publishing
102
+ steps:
103
+ - name: Download dist artifacts
104
+ uses: actions/download-artifact@v4
105
+ with:
106
+ name: dist
107
+ path: dist/
108
+
109
+ - name: Publish to PyPI
110
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,36 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+
8
+ # Virtual environments
9
+ .venv/
10
+
11
+ # IDE
12
+ .idea/
13
+ .vscode/
14
+ *.swp
15
+ *.swo
16
+
17
+ # Testing
18
+ .pytest_cache/
19
+ htmlcov/
20
+ .coverage
21
+ coverage.json
22
+
23
+ # Linting / type-checking caches
24
+ .ruff_cache/
25
+ .mypy_cache/
26
+
27
+ # Environment
28
+ .envrc.local
29
+
30
+ # OS
31
+ .DS_Store
32
+ Thumbs.db
33
+
34
+ # Copilot work plans
35
+ .copilot/*
36
+ !.copilot/README.md
@@ -0,0 +1,15 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.8.6
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
8
+ - repo: local
9
+ hooks:
10
+ - id: pyright
11
+ name: pyright
12
+ entry: uv run pyright src/ tests/
13
+ language: system
14
+ types: [python]
15
+ pass_filenames: false
@@ -0,0 +1,7 @@
1
+ # CHANGELOG
2
+
3
+ <!-- version list -->
4
+
5
+ ## v0.1.0 (2026-03-09)
6
+
7
+ - Initial Release
@@ -0,0 +1,40 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to a positive environment:
15
+
16
+ - Using welcoming and inclusive language
17
+ - Being respectful of differing viewpoints and experiences
18
+ - Gracefully accepting constructive criticism
19
+ - Focusing on what is best for the community
20
+ - Showing empathy towards other community members
21
+
22
+ Examples of unacceptable behavior:
23
+
24
+ - The use of sexualized language or imagery and unwelcome sexual attention
25
+ - Trolling, insulting/derogatory comments, and personal or political attacks
26
+ - Public or private harassment
27
+ - Publishing others' private information without explicit permission
28
+ - Other conduct which could reasonably be considered inappropriate
29
+
30
+ ## Enforcement
31
+
32
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
33
+ reported to the project maintainer. All complaints will be reviewed and
34
+ investigated and will result in a response that is deemed necessary and
35
+ appropriate to the circumstances.
36
+
37
+ ## Attribution
38
+
39
+ This Code of Conduct is adapted from the
40
+ [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
@@ -0,0 +1,134 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in contributing to ado-workflows-mcp. This document
4
+ covers the development setup, coding standards, testing philosophy, and
5
+ PR process.
6
+
7
+ ---
8
+
9
+ ## Development Setup
10
+
11
+ ```bash
12
+ # Clone
13
+ git clone https://github.com/grimlor/ado-workflows-mcp.git
14
+ cd ado-workflows-mcp
15
+
16
+ # Install with dev dependencies (creates .venv automatically)
17
+ uv sync --extra dev
18
+
19
+ # Optional: auto-activate venv
20
+ direnv allow
21
+ ```
22
+
23
+ ## Running Checks
24
+
25
+ All checks must pass before submitting a PR:
26
+
27
+ ```bash
28
+ task check # runs lint → type → test
29
+ ```
30
+
31
+ Or individually:
32
+
33
+ ```bash
34
+ task lint # ruff check src/ tests/
35
+ task format # ruff format src/ tests/
36
+ task type # pyright type checking
37
+ task test # pytest -v
38
+ task cov # pytest with coverage report
39
+ ```
40
+
41
+ ## Code Style
42
+
43
+ - **Python 3.12+** — use modern syntax (`X | Y` unions, `@dataclass`).
44
+ - **`from __future__ import annotations`** at the top of every module.
45
+ - **ruff** handles formatting and import sorting. Don't fight it.
46
+ - **pyright** — all functions need type annotations. No `Any` unless
47
+ you have a good reason and document it.
48
+ - **Line length:** 99 characters (configured in `pyproject.toml`).
49
+ - **Quote style:** double quotes.
50
+
51
+ ## Testing Standards
52
+
53
+ Tests are the living specification. Every test class documents a behavioral
54
+ requirement, not a code structure.
55
+
56
+ ### Test Class Structure
57
+
58
+ ```python
59
+ class TestYourFeature:
60
+ """
61
+ REQUIREMENT: One-sentence summary of the behavioral contract.
62
+
63
+ WHO: Who depends on this behavior (calling code, operator, AI agent)
64
+ WHAT: What the behavior is, including failure modes
65
+ WHY: What breaks if this contract is violated
66
+
67
+ MOCK BOUNDARY:
68
+ Mock: ado_workflows SDK functions (library I/O edge)
69
+ Real: tool functions, error construction, AIGuidance
70
+ Never: construct expected output and assert on the construction
71
+ """
72
+
73
+ def test_descriptive_name_of_scenario(self) -> None:
74
+ """
75
+ Given some precondition
76
+ When an action is taken
77
+ Then an observable outcome occurs
78
+ """
79
+ ...
80
+ ```
81
+
82
+ ### Key Principles
83
+
84
+ 1. **Mock I/O boundaries, not implementation.** Mock the `ado-workflows`
85
+ library functions — never mock internal helpers or dataclass construction.
86
+
87
+ 2. **Failure specs matter.** For every happy path, ask: what goes wrong?
88
+ Write specs for those failure modes. An unspecified failure is an
89
+ unhandled failure.
90
+
91
+ 3. **Missing spec = missing requirement.** If you find a bug, the first
92
+ step is always adding the test that should have caught it, then fixing
93
+ the code to pass that test.
94
+
95
+ 4. **Every assertion includes a diagnostic message.** Bare assertions are
96
+ not permitted.
97
+
98
+ ## Architecture
99
+
100
+ See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for the tool layers,
101
+ error propagation, and design decisions.
102
+
103
+ ## Commit Messages
104
+
105
+ Use [Conventional Commits](https://www.conventionalcommits.org/) format:
106
+
107
+ ```
108
+ feat: add repository context caching with session persistence
109
+
110
+ - set_repository_context() validates and caches org/project/repo
111
+ - get_repository_context_status() surfaces cached state for debugging
112
+ - clear_repository_context() resets to force fresh discovery
113
+ ```
114
+
115
+ Common prefixes: `feat:`, `fix:`, `test:`, `docs:`, `build:`, `refactor:`,
116
+ `style:`, `ci:`, `chore:`.
117
+
118
+ ## Pull Requests
119
+
120
+ 1. **Branch from `main`.**
121
+ 2. **All checks must pass** — `task check` (lint + type + test).
122
+ 3. **Include tests** for any new behavior or bug fix.
123
+ 4. **One concern per PR** — don't mix a new feature with unrelated refactoring.
124
+ 5. **Describe what and why** in the PR description.
125
+
126
+ ## Reporting Issues
127
+
128
+ When filing an issue:
129
+
130
+ - **Bug:** Include the error message, what you expected, and steps to
131
+ reproduce. Include the Python version and how ado-workflows-mcp was
132
+ installed.
133
+ - **Feature request:** Describe the problem you're trying to solve, not
134
+ just the solution you have in mind.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 grimlor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.