Files
reno-stars-coordinator/.gitea/workflows/ci.yml
T
renostars 6cd62fe17c
ci / reno-work MCP — per-function unit tests (push) Successful in 13s
fix(secrets): don't cache an EMPTY platform fetch — the actual root cause
Diagnosed live on the box (temp debug tool, now removed): the secrets self-fetch
returns all 21 secrets fine (GCAL/RESEND/SHEETS present) — the base URL was never the
real problem (this tenant sets MOLECULE_API_URL, which the prior code already read; the
PLATFORM_URL commit's fallback covers both). The real bug was SecretResolver caching the
FIRST fetch even when it returned {}: something reads a platform-only secret during the
boot window before the secrets endpoint/token is ready → fetch returns {} → `if
self._platform is None` cached that empty map for the whole process lifetime, so every
POSTed secret (GCAL_*/RESEND/EMAIL_FROM/SHEETS_*) stayed unresolvable → forward/rsvp/
scan/append_sales_sheet all inert.

Fix: cache only a NON-empty fetch (`if not self._platform`) — keep retrying until the
endpoint answers, then memoize. Removed the temporary debug_secret_env tool. 138 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-29 17:33:24 -07:00

49 lines
1.8 KiB
YAML

# ci.yml — per-function CI for the reno-work work-MCP.
#
# Complements .github/workflows/enterskill-gate.yml (structural manifest lint):
# this job unit-tests every one of the 12 MCP tools with NO live Odoo and NO
# network — mcp/test_server.py stubs the module-level _odoo with a recording
# fake and asserts the exact Odoo JSON-2 payload shape (writes) / search domain
# (reads), plus the MCP stdio protocol. Live writes are impossible in CI
# (RENO_WORK_DRY_RUN gating + the stub), so it is safe and hermetic.
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
mcp-unit:
name: reno-work MCP — per-function unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install pytest
run: pip install --quiet pytest
- name: Unit-test every MCP tool (no live Odoo)
run: pytest mcp/ -v
- name: stdio protocol smoke (real process — initialize + tools/list)
run: |
out=$(printf '%s\n%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
| python3 mcp/server.py)
echo "$out"
echo "$out" | grep -q '"name": "reno-work"' || { echo "FAIL: no reno-work serverInfo"; exit 1; }
echo "$out" | python3 -c "import sys,json; \
rows=[json.loads(l) for l in sys.stdin if l.strip()]; \
tools=[r for r in rows if r.get('id')==2][0]['result']['tools']; \
assert len(tools)>=31, f'expected >=31 tools, got {len(tools)}'; \
print(f'stdio smoke OK: {len(tools)} tools')"