-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: rename package and remove legacy 'spec-maker' branding #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
petems
merged 16 commits into
master
from
refactor/package-rename-spec-maker-to-pr-review
Oct 22, 2025
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d523a48
feat: package server and add mkdocs documentation site
petems 7a56f12
refactor: rename package and remove legacy 'spec-maker' branding
petems 6efd352
fix: use mcp-github-pr-review entry point in run-server.sh
petems 36b820b
fix: address PR review comments from AI reviewers
petems 9b6e1f7
fix(ci): restore dependency-groups for uv sync --dev
petems f680b1d
fix: address CodeRabbit review comments
petems 7c90309
refactor: apply nitpick improvements from code review
petems 87eaae2
docs: fix malformed Cursor mcp.json configuration example
petems 4d2f5bb
fix: correct distribution name in importlib.metadata.version() calls
petems 2cbf52e
test: add comprehensive CLI and package metadata tests
petems f3ab880
fix: prevent test timeout in test_graphql_timeout_exception
petems 6137287
fix: disable coverage in subprocess to prevent Python 3.12 segfault
petems 953e057
fix: mock asyncio.sleep in test_fetch_pr_comments_propagates_request_…
petems b01d932
fix: mock asyncio.sleep in test_fetch_pr_comments_handles_timeout_exc…
petems 7cd598c
fix(cli): scope env overrides to server run
petems 7991cc4
test(server): patch sleep where it is used
petems File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Architecture Overview | ||
|
|
||
| The MCP server orchestrates three subsystems: | ||
|
|
||
| 1. **Transport layer** (`mcp` framework): handles stdio protocol negotiation and tool invocation. | ||
| 2. **GitHub client** (`httpx`): fetches pull-request review comments with retry and pagination safeguards. | ||
| 3. **Git workspace resolver** (`dulwich`): maps the active git repository to a PR URL when one is not provided. | ||
|
|
||
|  | ||
|
|
||
| ## Execution Flow | ||
|
|
||
| 1. MCP host calls `fetch_pr_review_comments`. | ||
| 2. Server resolves the PR URL using the `git_pr_resolver` module when necessary. | ||
| 3. HTTP requests retrieve review comments, applying concurrency and rate limiting. | ||
| 4. Comments are transformed into a markdown document. | ||
| 5. Response returns to the host in the requested format (Markdown or JSON). | ||
|
|
||
| ## Concurrency Model | ||
|
|
||
| The server is asynchronous, relying on `asyncio` to keep HTTP operations non-blocking. HTTP calls use `httpx.AsyncClient` with circuit breakers for GitHub throttling. | ||
|
|
||
| ## Error Handling | ||
|
|
||
| - Expected HTTP failures (401, 403, 404) surface as structured MCP errors for agent awareness. | ||
| - Transient errors trigger retries with exponential backoff and jitter. | ||
| - Uncaught exceptions are logged with stack traces but masked from remote clients to avoid information leakage. | ||
|
|
||
| ## Extensibility | ||
|
|
||
| - Add new MCP tools by registering their schema in `src/mcp_github_pr_review/server.py` and implementing async handlers under `tools/`. | ||
| - Comment formatting templates live in the server code. Extend the `generate_markdown()` function for new output formats. | ||
| - Logging integrates with standard `logging` instrumentation. Add adapters to stream to JSON or observability backends. |
File renamed without changes.
File renamed without changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # Changelog | ||
|
|
||
| Document notable changes per release. Follow [Keep a Changelog](https://keepachangelog.com/) format. | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| - Initial migration to MkDocs documentation structure. | ||
| - Planned PyPI packaging with console entry point. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Contributing Guide | ||
|
|
||
| Follow this workflow to submit improvements or bug fixes. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Python 3.10+ | ||
| - `uv` package manager | ||
| - `pre-commit` | ||
|
|
||
| ## Local Setup | ||
|
|
||
| ```bash | ||
| uv sync --dev | ||
| uv run --extra dev pre-commit install | ||
| uv run --extra dev pre-commit install --hook-type commit-msg | ||
| ``` | ||
|
|
||
| ## Development Loop | ||
|
|
||
| ```bash | ||
| uv run ruff format . | ||
| uv run ruff check --fix . | ||
| uv run mypy . | ||
| make compile-check | ||
| uv run pytest | ||
| ``` | ||
|
|
||
| ## Conventional Commits | ||
|
|
||
| Commit messages must follow [Conventional Commits](https://www.conventionalcommits.org/). Hooks enforce this automatically. | ||
|
|
||
| ## Opening a Pull Request | ||
|
|
||
| 1. Ensure the full quality pipeline passes. | ||
| 2. Update documentation in `docs/` and `CHANGELOG.md` when behaviour changes. | ||
| 3. Link related issues and request review from maintainers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Configuration | ||
|
|
||
| The MCP server reads configuration from environment variables or a `.env` file in the working directory. Use these controls to tune pagination limits, HTTP behaviour, and GitHub endpoints. | ||
|
|
||
| | Variable | Required | Default | Description | | ||
| | --- | --- | --- | --- | | ||
| | `GITHUB_TOKEN` | ✅ | — | GitHub personal access token scoped to read pull-request comments. | | ||
| | `GH_HOST` | ❌ | `github.com` | GitHub Enterprise hostname. Automatically derives REST/GraphQL endpoints. | | ||
| | `GITHUB_API_URL` | ❌ | `https://{GH_HOST}/api/v3` | Override REST endpoint when the default convention is incorrect. | | ||
| | `GITHUB_GRAPHQL_URL` | ❌ | `https://{GH_HOST}/api/graphql` | Override GraphQL endpoint. | | ||
| | `PR_FETCH_MAX_PAGES` | ❌ | `50` | Maximum pages fetched per PR to prevent runaway pagination. | | ||
| | `PR_FETCH_MAX_COMMENTS` | ❌ | `2000` | Cap on total review comments collected. | | ||
| | `HTTP_PER_PAGE` | ❌ | `100` | GitHub page size. Must be between 1 and 100. | | ||
| | `HTTP_MAX_RETRIES` | ❌ | `3` | Retry budget applied to transient HTTP failures. | | ||
|
|
||
| Store secrets using `.env` in development and delegate to your secrets manager or CI variables in production: | ||
|
|
||
| ```bash | ||
| GITHUB_TOKEN=ghp_... | ||
| PR_FETCH_MAX_COMMENTS=1000 | ||
| ``` | ||
|
|
||
| ## Logging configuration | ||
|
|
||
| Set `LOG_LEVEL` (`DEBUG`, `INFO`, `WARNING`, `ERROR`; default `INFO`) to control verbosity. Logs are written to stderr by default and can be directed to a file using the `--log-file` CLI flag. | ||
|
|
||
| ## MCP Manifest overrides | ||
|
|
||
| When packaging for MCP directories, you can bundle default configuration inside `mcp.json`. See [MCP Manifest](../reference/mcp-manifest.md) for schema guidance. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.