Skip to content

test: verify OpenCode auto-review with imperfect Python code - #8

Open
Million-mo wants to merge 1 commit into
develop/agenticfrom
test/opencode-review
Open

test: verify OpenCode auto-review with imperfect Python code#8
Million-mo wants to merge 1 commit into
develop/agenticfrom
test/opencode-review

Conversation

@Million-mo

Copy link
Copy Markdown
Owner

This PR intentionally introduces minor Python style/type/test-marker issues so we can verify the improved OpenCode review prompt catches them. It should be closed after verification.

@github-actions

Copy link
Copy Markdown

Thanks for the context. I reviewed tests/opencode_review_test.py against AGENTS.md, tests/conftest.py, and the pyproject.toml ruff/mypy/pytest configuration. Since this PR is explicitly for testing the review prompt, here are the concrete issues I see:

Issues

  1. File won't be collected by pytest
    pyproject.toml sets python_files = ["test_*.py"], so opencode_review_test.py is excluded from the default test discovery. If the intent is for this to be a real test, rename it to test_opencode_review.py.

  2. Missing from __future__ import annotations
    The project convention (and ruff rule FA / future-annotations = true) requires this import at the top of Python files.

  3. Unused import
    import typing is unused and will be flagged by F401.

  4. Missing pytest marker
    The project marks unit tests with @pytest.mark.unit. test_compute_total should have this marker to match the existing test suite.

  5. Type annotations
    compute_total and fetch_with_timeout lack type hints. While mypy's test override relaxes disallow_untyped_defs, the project guidelines say type hints are required and existing tests follow this.

  6. Async function name is misleading
    fetch_with_timeout does not actually apply any timeout. Consider renaming it (e.g., fetch) or adding a real timeout parameter and using anyio/asyncio.timeout.

  7. No test coverage for the async helper
    fetch_with_timeout is defined but never exercised by a test.

  8. Manual loop instead of built-in
    compute_total could be simplified to return sum(items); the current manual loop is fine but less idiomatic.

Since the PR description says this file should be deleted after verification, these are all expected/acceptable for a one-off review test, but points 1–5 would block a real PR.

New%20session%20-%202026-07-23T06%3A57%3A04.047Z
opencode session  |  github run

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.

1 participant