Skip to content

Commit d644410

Browse files
tirth8205claude
andcommitted
fix: CI test + mypy failures on main
- mypy: rename inner http handler in `cli.py` visualize-serve path from `handler` to `http_handler`. The daemon dispatcher at the top of `main()` already binds `handler: Callable[[Namespace], None]`, and reusing the name for `functools.partial(SimpleHTTPRequestHandler, ...)` made mypy unify the two scopes and reject both the assignment and the HTTPServer call site. - test: align `test_install_qoder_config` with the canonical `_detect_serve_command()` pattern used by sibling tests in the same class (lines 528, 594). The hard-coded `"code-review-graph"` fallback predates PR #287, which switched the no-uvx fallback to `sys.executable -m code_review_graph serve` for venv robustness. On CI runners without `uvx` the test was asserting against a stale contract. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ed5e980 commit d644410

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

code_review_graph/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,13 +1034,13 @@ def main() -> None:
10341034

10351035
serve_dir = html_path.parent
10361036
port = 8765
1037-
handler = functools.partial(
1037+
http_handler = functools.partial(
10381038
http.server.SimpleHTTPRequestHandler,
10391039
directory=str(serve_dir),
10401040
)
10411041
print(f"Serving at http://localhost:{port}/graph.html")
10421042
print("Press Ctrl+C to stop.")
1043-
with http.server.HTTPServer(("localhost", port), handler) as httpd:
1043+
with http.server.HTTPServer(("localhost", port), http_handler) as httpd:
10441044
try:
10451045
httpd.serve_forever()
10461046
except KeyboardInterrupt:

tests/test_skills.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,7 @@ def test_install_qoder_config(self, tmp_path):
793793
assert "mcpServers" in data
794794
assert "code-review-graph" in data["mcpServers"]
795795
assert data["mcpServers"]["code-review-graph"]["type"] == "stdio"
796-
import shutil
797-
expected_cmd = "uvx" if shutil.which("uvx") else "code-review-graph"
796+
expected_cmd, _ = _detect_serve_command()
798797
assert data["mcpServers"]["code-review-graph"]["command"] == expected_cmd
799798

800799

0 commit comments

Comments
 (0)