Skip to content

pr-review cannot target a PR directly: /pull/ URL rejected, /issues/ form fails linked-PR discovery #119

Description

@ellen-goc

askcc pr-review (0.2.15) cannot review a PR directly — both URL forms fail when the PR has no separate same-repo tracking issue.

Repro

Target: a PR whose tracking issue lives in another repo (epic workflow), e.g. weyucou/cookiecutter-smb-scheduling PR #1 tracked by weyucou/task-management#67.

1. PR URL is rejected by the parser:

$ askcc --cwd ~/projects/cookiecutter-smb-scheduling pr-review -g https://github.com/weyucou/cookiecutter-smb-scheduling/pull/1
...
  File ".../askcc/functions.py", line 47, in _parse_issue_url
    raise ValueError(msg)
ValueError: Invalid GitHub issue URL: https://github.com/weyucou/cookiecutter-smb-scheduling/pull/1

2. The equivalent /issues/N URL parses, but linked-PR discovery finds nothing (the issue is the PR, and a PR is not "linked" to itself):

$ askcc --cwd ~/projects/cookiecutter-smb-scheduling pr-review -g https://github.com/weyucou/cookiecutter-smb-scheduling/issues/1
...
  File ".../askcc/functions.py", line 226, in fetch_pr_content
    raise ValueError(msg)
ValueError: No linked pull request found for issue #1 in weyucou/cookiecutter-smb-scheduling

Pointing at the tracking issue instead is not a workaround here because it is cross-repo (#57).

Suggested fix

In _parse_issue_url (or a pr-review-specific path), accept .../pull/N URLs; when the target is already a PR, skip linked-PR discovery and use it directly. That also gives cross-repo epics a clean workaround for #57: pass the PR URL itself.

Impact

PRs opened under an epic in another repo (fan-out template repos, DO-NOT-MERGE reference PRs) cannot be reviewed via askcc at all; the review has to be done manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions