Skip to content

Commit 1460535

Browse files
committed
ci(mcp): fix PR check failures
Signed-off-by: Drew Cain <groksrc@gmail.com>
1 parent 3d68a32 commit 1460535

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ Run `just test-smoke` when you specifically need the MCP smoke flow.
5656

5757
If testmon is “cold,” the first run may be long. Subsequent runs get much faster.
5858

59+
### PR CI Gate
60+
61+
Before opening or updating a PR, run the checks that mirror the common required CI failures:
62+
63+
- Run `just typecheck` in addition to targeted `ruff` and `pytest` commands when tests were added or changed.
64+
- Sign commits with `git commit -s` so DCO passes. If a PR branch already has unsigned commits, rewrite the branch with signed-off commits before asking for review.
65+
- Use a semantic PR title accepted by `.github/workflows/pr-title.yml`: `type(scope): summary`.
66+
- Use one of the allowed scopes: `core`, `cli`, `api`, `mcp`, `sync`, `ui`, `deps`, `installer`.
67+
5968
### Test Structure
6069

6170
- `tests/` - Unit tests for individual components (mocked, fast)

tests/mcp/test_tool_read_note.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from contextlib import asynccontextmanager
44
from types import SimpleNamespace
55
from textwrap import dedent
6+
from typing import Any, cast
67

78
import pytest
89

@@ -24,6 +25,10 @@ async def set_state(self, key: str, value: object, **kwargs) -> None:
2425
self._state[key] = value
2526

2627

28+
def _ctx(context: _ContextState) -> Any:
29+
return cast(Any, context)
30+
31+
2732
def test_parse_opening_frontmatter_handles_crlf():
2833
"""JSON read_note output should strip frontmatter from Windows-written markdown."""
2934
body, frontmatter = _parse_opening_frontmatter(
@@ -297,7 +302,7 @@ async def read(self, entity_id: str):
297302
"memory://todo",
298303
project="personal/main",
299304
output_format="json",
300-
context=context,
305+
context=_ctx(context),
301306
)
302307

303308
assert isinstance(result, dict)

tests/mcp/test_tool_search.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from contextlib import asynccontextmanager
55
from datetime import datetime, timedelta
66
from types import SimpleNamespace
7+
from typing import cast
78

89
from basic_memory.mcp.tools import write_note
910
from basic_memory.mcp.tools.search import (
@@ -269,7 +270,8 @@ async def search(self, payload, *, page, page_size):
269270
assert captured["project"] == "personal/main"
270271
assert captured["project_id"] is None
271272
assert captured["search_project_id"] == "11111111-1111-1111-1111-111111111111"
272-
assert captured["payload"]["permalink"] == "personal/main/tests/search-note"
273+
payload = cast(dict[str, object], captured["payload"])
274+
assert payload["permalink"] == "personal/main/tests/search-note"
273275
assert isinstance(response, dict)
274276
assert response["results"][0]["permalink"] == "personal/main/tests/search-note"
275277

0 commit comments

Comments
 (0)