Skip to content

CI pipeline has no linting, type checking, or coverage gates; opencode_go module has zero test coverage #47

Description

@tg12

Summary

The CI workflow (ci.yml) runs tests against Python 3.11 and 3.12 only, while pyproject.toml declares requires-python = ">=3.11". No linting (Ruff), type checking (mypy/pyright), or formatting (Black) steps are included in CI. The test suite does not cover the opencode_go.py module at all, and there are no integration tests for the actual upstream forwarding paths (ChatGPT passthrough, _chatgpt_passthrough, _post_openai_chat with a real mock upstream).

Evidence

.github/workflows/ci.yml:

steps:
  - name: Compile check
    run: python -m compileall codex_shim/ -q
  - name: Run tests
    run: python -m pytest tests/ -q

No ruff check, black --check, or mypy step. No Python 3.13 matrix entry despite the workspace CLAUDE.md targeting 3.13.

tests/ directory listing — no test_opencode_go.py file exists.

pyproject.toml dev dependencies:

[project.optional-dependencies]
dev = [
  "pytest>=8",
  "pytest-asyncio>=0.23",
]

No ruff, mypy, black, or coverage in dev dependencies.

Why this matters

  1. Without static analysis in CI, type errors and unreachable code paths (such as the event-loop deadlock documented in a separate issue) go undetected until production failures.
  2. Without coverage enforcement, critical paths like _resolve_api_key fallback chain, _maybe_intercept_web_search, and opencode_go.py are untested.
  3. Without formatting/linting in CI, code quality gates are purely voluntary.
  4. opencode_go.py makes live HTTP calls (urlopen) with no mocking; its error handling paths (network failure, malformed response, HTTP 4xx from the probe endpoints) are completely untested.

Root cause

The project is early-stage and CI was added as a basic smoke-test gate rather than a comprehensive quality pipeline.

Recommended fix

Add the following CI steps:

- name: Lint
  run: python -m ruff check codex_shim/ tests/
- name: Format check
  run: python -m black --check codex_shim/ tests/
- name: Type check
  run: python -m mypy codex_shim/ --ignore-missing-imports
- name: Tests with coverage
  run: python -m pytest tests/ -q --cov=codex_shim --cov-fail-under=70

Add ruff, black, mypy, and pytest-cov to dev dependencies in pyproject.toml. Add test_opencode_go.py covering at minimum: successful model discovery, HTTP error handling, and the write_opencode_go_models merge logic.

Acceptance criteria

  • CI includes lint, format, and type-check steps that fail the build on violations.
  • Code coverage is measured and reported.
  • opencode_go.py has at least basic test coverage for error paths.
  • Python 3.13 is added to the test matrix.

Suggested labels

ci-cd, testing, technical-debt

Priority

P2

Severity

Low — no direct security or reliability impact, but absence of quality gates allows regressions to reach users undetected.

Confidence

Confirmed — ci.yml and pyproject.toml are explicit about what is and is not checked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions