feat: Implement github_comment in write_tools.py + test#4
Merged
Conversation
|
👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow. |
There was a problem hiding this comment.
QA Audit — PR #4 | feat: Implement github_comment in write_tools.py + test
VERDICT: WARN (CI non-terminal — test queued; re-evaluate for PASS when green)
CI Status
- test: queued
Diff Review
- Replaces
github_commentstub with a workinggh issue commentcall viarun_gh/check_gh_error, mirroring thegithub_create_issuepattern exactly (write_tools.py:63-68) - Four tests appended covering success URL return, int→str conversion, bad-repo short-circuit, and gh failure error string (
tests/test_write_tools.py:75-116) - No imports needed —
bad_repo,check_gh_error,run_ghalready imported at module top
Observations
- No blocking findings. Implementation is clean, follows existing conventions, and all test paths are covered.
- LOW: Docstring format is a plain string literal — consistent with §6 and the existing tool docstrings in this file; not a defect.
— Quinn, QA Engineer
|
Submitted COMMENT review on |
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 relevant files.I'll start by reading the canonical instructions and the relevant files.Let me check the
gh_cli.pyhelpers to confirm signatures.I have everything I need. The pattern fromgithub_create_issueis clear. Let me implementgithub_comment.Now let me append tests forgithub_commentto the test file, following the existing conventions.Done. Both files are implemented and the acceptance criteria are met.Changes
write_tools.py— replaced thegithub_commentstub body (only that function touched):bad_repo()(early return on invalid).["issue", "comment", str(number), "--repo", repo, "--body", body]—numberis stringified since it arrives asint.run_gh, checks errors viacheck_gh_error, returnsout.strip()(the comment URL gh prints).TODO(team)line, added "Returns the new comment URL."The module-top
from .gh_cli import bad_repo, check_gh_error, run_ghwas already present from the prior feature, so no import change was needed.tests/test_write_tools.py— appended four tests mirroring the existinggithub_create_issueconventions (patchingrun_ghin theghplugin.write_toolsnamespace,ainvoke):test_comment_returns_comment_url— asserts URL returned and exact argv (issue comment 42 --repo o/n+--body).test_comment_number_is_stringified— confirms the intnumberreaches gh as"7".test_comment_bad_repo_short_circuits— invalid repo returnsError:withowner/name, never shells out.test_comment_gh_failure_returns_check_gh_error— nonzero exit →Error (gh exit 1): ....All paths from the definition of done (success URL, bad repo, gh failure) are covered, and existing
github_create_issuetests are untouched.