Skip to content

Clean/cicd#2

Merged
will-fawcett-trillium merged 20 commits intomainfrom
clean/cicd
Apr 28, 2026
Merged

Clean/cicd#2
will-fawcett-trillium merged 20 commits intomainfrom
clean/cicd

Conversation

@will-fawcett-trillium
Copy link
Copy Markdown
Contributor

@will-fawcett-trillium will-fawcett-trillium commented Apr 27, 2026

Summary

Adds CI/CD (GitHub Actions + pre-commit) and a test suite to eve-mcp, mirroring the setup landing in eve-api PR #1. Also fixes two real bugs that were on main and removes dead dev dependencies.

CI/CD

  • GitHub Actions workflow on push running a Python matrix (3.11 / 3.12 / 3.13 / 3.14) on ubuntu-latest, with Poetry dependency caching keyed on poetry.lock. Submodule init step uses ORG_PAT so the vendored lib/eve-api resolves on the runner.
  • .pre-commit-config.yaml runs detect-secrets, autoflake, black, isort, mypy, pylint, pytest+coverage, and a conditional Sphinx build.
  • Coverage gate set to 50% — the current measured total. To be ratcheted up as helpers.py and client.py gain tests.
  • .pylintrc and .secrets.baseline added.

Tests

tests/ tree added with full coverage of the simple modules:

  • tests/test_client.py
  • tests/test_server/test_app.py
  • tests/test_server/test_init.py
  • tests/test_server/test_main.py
  • tests/test_server/test_tools_collections.py
  • tests/test_server/test_tools_query.py

Coverage gaps remain in client.py (39%) and server/helpers.py (19%) — to be addressed in a follow-up PR.

Code changes

  • New src/eve_mcp/server/enums.py with EventType enum replacing magic strings in _query_eve.
  • helpers.py reformatted (black/isort), Optional[X]X | None, walrus operators, real exception docstrings. The buggy extract_tag regex (r'```{tag}(.*)```'.format(tag=tag)) is fixed to use an f-string.
  • tools_query.py: _assess_factuality_issue was registered as a tool but collided with the imported helper and had the wrong arity, so any call would self-recurse / TypeError. Renamed to assess_factuality_issue (tool wrapper) with the correct 6-arg signature forwarding to the helper.
  • helpers.py: closing tag in the factuality-issues prompt was </PYTHON CODE> (no underscore) against opening <PYTHON_CODE> — fixed so the LLM sees a well-formed XML block.

Dependency changes

  • Adds dev tooling that pre-commit invokes: pre-commit, autoflake, isort, mypy, pylint, pytest, pytest-asyncio, pytest-cov, pytest-testdox, pytest-mock, detect-secrets, pytest-env, pylint-per-file-ignores.
  • Drops unused type stubs types-requests and types-toml (nothing imports requests or toml).
  • Python floor lowered from ^3.12 to ^3.11; classifiers updated 3.11 → 3.14.
  • black target-version = ['py311', 'py312'] so generated code remains 3.11-runnable.
  • lib/eve-api submodule bumped 3c0a4681f8de11 (matches the head of eve-api's open clean/cicd PR; bump again to the merge commit when that PR lands).

Verification

  • All 4 matrix legs green: 3.11 / 3.12 / 3.13 / 3.14.
  • Local pre-commit run --all-files passes.
  • 50% coverage gate satisfied (measured: 50%).

Follow-ups (not in this PR)

  • Tests for helpers.py and client.py to push coverage to 80%.
  • PEP 621 [project] block + poetry-dynamic-versioning for full eve-api parity.
  • README expansion beyond the 1-line stub.
  • Bump submodule pin to eve-api's merged commit once that PR lands.

Note on history

Branch contains 19 commits (r-spiewak's CI/test setup + recent follow-ups). Suggest squash-merge to keep main history readable.

r-spiewak and others added 20 commits April 6, 2026 17:09
Mirrors eve-api's CI shape so both repos run a multi-version matrix
with cached .venv keyed on poetry.lock. Submodule init step is kept
on top because the eve-api dep is still vendored as a submodule.

Default runtime stays at 3.12 (pyproject floor is unchanged); the
matrix exists to catch regressions on 3.13 and 3.14 early.
Matches the measured total reported by the local pre-commit run.
client.py (39%) and helpers.py (19%) drag the average; the
test_server suite covers everything else at 100%. Ratchet up as
helpers/client tests land.
- black target-version py311 -> py312 (matches the ^3.12 floor)
- coverage.run source dropped "tests" (tests are omitted anyway)
- pytest.ini_options gains testpaths, addopts, and
  asyncio_default_fixture_loop_scope to mirror eve-api's setup
- pyproject.toml: python = ^3.12 -> ^3.11; classifier added; black
  target-version py312 -> py311 so generated code stays 3.11-valid
- poetry.lock regenerated against the new floor
- workflow matrix now spans 3.11/3.12/3.13/3.14, mirroring eve-api
Documents the intent: code is 3.12-shaped but must remain runnable
on 3.11. Black formats compatibly with both, so output runs across
the full 3.11-3.14 matrix.
Mismatched closing tag </PYTHON CODE> against opening <PYTHON_CODE>
in the factuality-issues prompt could confuse the LLM and bias the
extraction.
Neither package is imported anywhere in src/ or tests/; the stubs
were dead weight. Mirrors eve-api's cleanup pass.
src/stars/mcp_servers/python_toolbox/** and src/stars/docs/conf.py
do not exist in this repo and never have - leftover from a
copy-paste of the .pylintrc from a sibling project.
Copy link
Copy Markdown
Collaborator

@r-spiewak r-spiewak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup is good.
I didn't pull and test though.

@will-fawcett-trillium will-fawcett-trillium merged commit 3cbfe98 into main Apr 28, 2026
4 checks passed
@will-fawcett-trillium will-fawcett-trillium deleted the clean/cicd branch April 28, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants