fix: report fork-PR resolution errors instead of a traceback - #56
Conversation
|
Warning Review limit reachedNext included review available in 37 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis change improves fork-reference failures by showing clean CLI errors and by distinguishing same-repository pull requests from deleted or missing forks. Runtime coverage confirmed that ordinary fork-resolution errors now exit cleanly and that same-repository and deleted-fork responses receive the intended messages. A malformed GitHub pull-request response still escapes as an uncaught JSON decoding exception, leaving users without a useful error message. Confidence Score: 4/5Not ready to merge until malformed pull-request responses are converted into the same user-facing resolution error path. The affected command path was exercised with an authored runtime harness, which reproduced the uncaught JSON decoding exception while also confirming the intended clean handling for normal resolution errors. Files Needing Attention: pr_split/git_ops/prs.py needs to normalize malformed GitHub response data before it reaches the CLI handler; pr_split/cli.py catches only the project exception hierarchy.
What T-Rex did
|
|
Addressed the Greptile finding: |
c64678a to
1707218
Compare
There was a problem hiding this comment.
Greptile has paused reviews on this repository — it used its 100 free open-source review credits for this billing period. Reviews resume automatically on September 2. To continue before then, an organization admin can keep reviews running past the free credits — those bill as normal usage.
Errors from fetch_fork_pr / fetch_fork_branch (PR not found, fetch failed) escaped split as raw GitOperationError tracebacks. Catch them and print the prepared message. Also distinguish a same-repo PR from a missing one so the user is told to pass the branch name instead.
1707218 to
da2e12f
Compare
Summary
pr-split split '#999'(oruser:branch) printed a Python stack trace whenfetch_fork_pr/fetch_fork_branchraised: nothing insplitcaughtGitOperationErrorand there is no top-level handler. The call is now wrapped and the preparedErrorMsgprinted with exit code 1.fetch_fork_prreported a same-repo PR as "not found or is not from a fork". It now raises a distinctPR_NOT_FROM_FORKmessage telling the user to pass the head branch name instead; a deleted fork (head.reponull) still reportsPR_NOT_FOUND.Test plan
uv run ruff check/ruff format --checkcleanuv run pytest -q— 446 passed