Skip to content

feat: Implement github_comment in write_tools.py + test#4

Merged
mabry1985 merged 1 commit into
mainfrom
feat/github-plugin-1ez.5
Jun 21, 2026
Merged

feat: Implement github_comment in write_tools.py + test#4
mabry1985 merged 1 commit into
mainfrom
feat/github-plugin-1ez.5

Conversation

@mabry1985

Copy link
Copy Markdown
Contributor

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.py helpers to confirm signatures.I have everything I need. The pattern from github_create_issue is clear. Let me implement github_comment.Now let me append tests for github_comment to the test file, following the existing conventions.Done. Both files are implemented and the acceptance criteria are met.

Changes

write_tools.py — replaced the github_comment stub body (only that function touched):

  • Validates the repo with bad_repo() (early return on invalid).
  • Builds ["issue", "comment", str(number), "--repo", repo, "--body", body]number is stringified since it arrives as int.
  • Runs via run_gh, checks errors via check_gh_error, returns out.strip() (the comment URL gh prints).
  • Updated the docstring (plain string literal, per §6) — dropped the TODO(team) line, added "Returns the new comment URL."

The module-top from .gh_cli import bad_repo, check_gh_error, run_gh was already present from the prior feature, so no import change was needed.

tests/test_write_tools.py — appended four tests mirroring the existing github_create_issue conventions (patching run_gh in the ghplugin.write_tools namespace, 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 int number reaches gh as "7".
  • test_comment_bad_repo_short_circuits — invalid repo returns Error: with owner/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_issue tests are untouched.

@protoquinn

protoquinn Bot commented Jun 21, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_comment stub with a working gh issue comment call via run_gh/check_gh_error, mirroring the github_create_issue pattern 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_gh already 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

@protoquinn

protoquinn Bot commented Jun 21, 2026

Copy link
Copy Markdown

Submitted COMMENT review on protoLabsAI/github-plugin#4.

@mabry1985 mabry1985 merged commit cba1a88 into main Jun 21, 2026
1 check passed
@mabry1985 mabry1985 deleted the feat/github-plugin-1ez.5 branch June 21, 2026 19:56

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CI terminal-green, no blockers on prior review — auto-approving on green (#748).

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