Skip to content

bug: prr submit fails with 'path does not start with slash' #80

Description

@TineoC

Description

prr submit fails with Error: Invalid URI / path does not start with slash on every submission attempt. The error comes from http::Uri::builder().path_and_query() which requires the path component to start with / per RFC 3986.

Root cause

In src/prr.rs, both submit_review() and submit_file_comment() construct API paths without a leading slash:

  • Line 391: format!("repos/{}/{}/pulls/{}/reviews", ...)
  • Line 441: format!("repos/{}/{}/pulls/{}/comments", ...)

These produce paths like repos/owner/repo/pulls/123/reviews which lack the required / prefix.

Fix

Add a leading / to both format strings:

- format!("repos/{}/{}/pulls/{}/reviews", owner, repo, pr_num)
+ format!("/repos/{}/{}/pulls/{}/reviews", owner, repo, pr_num)
- format!("repos/{}/{}/pulls/{}/comments", owner, repo, pr_num)
+ format!("/repos/{}/{}/pulls/{}/comments", owner, repo, pr_num)

Workaround

Pipe the JSON from prr submit --debug 2>/dev/null into gh api --method POST repos/.../pulls/.../reviews --input - to bypass prr broken HTTP client.

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