Observed Behavior
GithubCLI.merged_pr_by_head() was introduced in src/treefort/gh.py to query merged PRs for branch pruning, but tests/test_gh.py only contains tests for pr_status and repo_status. merged_pr_by_head has zero unit test coverage.
Expected Behavior
GithubCLI.merged_pr_by_head() should have unit test coverage verifying command arguments, JSON parsing, --repo parameter inclusion, and exception handling.
Steps to Reproduce
- Inspect
tests/test_gh.py.
- Observe only
test_pr_status__calls_gh_and_parses_json, test_pr_status__with_owner_repo, and test_repo_status__calls_gh_and_parses_json are present.
Minimal Reproduction Environment / Conditions
- Version / Branch / Commit:
release-v0.5.x@6d07c0c
- Component:
tests/test_gh.py
Deliverables & Testing Requirements
- Add unit tests in
tests/test_gh.py for merged_pr_by_head:
- Standard call with head ref name, verifying
--head, --state merged, and --json arguments.
- Call with
owner_repo parameter, verifying --repo argument.
- Error condition handling when
self.run raises CalledProcessError.
- Regression Safety: All tests must execute cleanly under
pytest.
Technical Pointers & Root Cause Clues
- Suspected Components:
src/treefort/gh.py:43-65, tests/test_gh.py
- Related Commits:
21941c3, bd7ed4c
Notes & Edge Cases
- Conforms to
.aiassistant/rules/tests.md naming conventions.
Metadata
Severity / Priority: P2 (Medium)
Area: testing, gh
AI Usage
Drafted with Gemini following the DEEP framework based on code review findings against release-v0.5.x. Reproduction conditions and code references were verified in the codebase.
Observed Behavior
GithubCLI.merged_pr_by_head()was introduced insrc/treefort/gh.pyto query merged PRs for branch pruning, buttests/test_gh.pyonly contains tests forpr_statusandrepo_status.merged_pr_by_headhas zero unit test coverage.Expected Behavior
GithubCLI.merged_pr_by_head()should have unit test coverage verifying command arguments, JSON parsing,--repoparameter inclusion, and exception handling.Steps to Reproduce
tests/test_gh.py.test_pr_status__calls_gh_and_parses_json,test_pr_status__with_owner_repo, andtest_repo_status__calls_gh_and_parses_jsonare present.Minimal Reproduction Environment / Conditions
release-v0.5.x@6d07c0ctests/test_gh.pyDeliverables & Testing Requirements
tests/test_gh.pyformerged_pr_by_head:--head,--state merged, and--jsonarguments.owner_repoparameter, verifying--repoargument.self.runraisesCalledProcessError.pytest.Technical Pointers & Root Cause Clues
src/treefort/gh.py:43-65,tests/test_gh.py21941c3,bd7ed4cNotes & Edge Cases
.aiassistant/rules/tests.mdnaming conventions.Metadata
Severity / Priority: P2 (Medium)
Area:
testing,ghAI Usage
Drafted with Gemini following the DEEP framework based on code review findings against
release-v0.5.x. Reproduction conditions and code references were verified in the codebase.