feat: Implement github_create_issue in write_tools.py + test#2
Merged
Conversation
|
👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow. |
There was a problem hiding this comment.
QA Audit — PR #2 | feat: Implement github_create_issue in write_tools.py + test
VERDICT: WARN (CI test still queued — provisional; final verdict on terminal CI)
CI Status
- test: queued
Diff Review
write_tools.py: Replaced stub withgh issue createimpl. Importscheck_gh_error+run_gh; validates repo viabad_repo(), builds argv, returns issue URL or error. Clean, follows existing patterns.tests/test_write_tools.py(new): 5 async tests — success path, no-labels, comma labels with blanks, bad-repo short-circuit, gh error propagation. All patch in correct namespace (ghplugin.write_tools).
Observations
- LOW:
labels.split(",")would AttributeError on explicitlabels=None(default""makes this unlikely). Consider(labels or "").split(","). - LOW:
body=Nonewould produce--body Nonein argv. Same rarity — default""covers normal calls.
No blocking findings. Implementation is sound, tests are thorough.
— Quinn, QA Engineer
|
Submitted COMMENT review on #2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'll start by reading the canonical instructions and the files I need to modify.I'll start by reading the canonical instructions and the files I need to modify.Let me look at
read_tools.pyfor the implemented-tool conventions and the existing tests for style.Let me read the existing test files to match conventions.Now I have everything I need. Let me implement the changes. First, update the import inwrite_tools.py:Now replace the stub body ofgithub_create_issue:Let me check the test config for async support before writing the test.asyncio_mode = "auto"is set andpytest-asynciois a dev dep, so async test functions run directly. The tool callsrun_gh/check_gh_errorvia theghplugin.write_toolsmodule namespace, so I'll patch there. Now I'll write the test:Let me verify my work by running the lint and test gate.Ruff passes. The pytest failures are environmental — the homebrew pytest lackspytest-asyncio, soasyncio_mode=autois unrecognized (the 6 sync tests pass). Let me confirm the new tests actually pass with the real dev deps in a clean venv.All 11 tests pass (6 existing + 5 new) and ruff check/format both pass. Let me clean up the temp venv.Done. Here's what I implemented:write_tools.pyfrom .gh_cli import bad_repo, check_gh_error, run_gh.github_create_issuestub body with a realgh issue createinvocation:repoviabad_repo()first (short-circuits).["issue", "create", "--repo", repo, "--title", title, "--body", body].labelson comma, strips each, skips blanks, and appends a--label <name>pair per label.run_gh, checks failures viacheck_gh_error, and returnsout.strip()(the issue URL).TODO(team)docstring line withReturns the new issue URL.(kept it a plain string literal per §6).github_commentandgithub_create_prwere left untouched.tests/test_write_tools.py(new)Mocks
run_ghin theghplugin.write_toolsnamespace (where the tool resolves it) and asserts:gh issue createargv (repo/title/body);--labelflag;--labelflags, stripped, blanks dropped;bad_repoerror and never shells out;check_gh_errorstring.Verification
ruff check .→ all checks passed;ruff format --check .→ 8 files already formatted.pytest -qin a clean 3.12 venv withrequirements-dev.txt→ 11 passed (6 existing + 5 new). (The system pytest lackedpytest-asyncio, hence the need for the venv to honorasyncio_mode=auto.)All acceptance criteria are satisfied.