Skip to content

[BUG] [v0.0.7] cortex pr fails to parse GitHub remote URL with mixed-case host, resulting in incorrect repository detection #53520

Description

@andrirevo

Project

cortex

Description

The cortex pr command incorrectly parses GitHub repository information when the remote URL contains a mixed-case hostname (e.g., GitHub.com instead of github.com).

Because the parsing logic appears to rely on a case-sensitive substring check, valid Git remotes are not recognized correctly. This results in incorrect repository detection and failed API requests.

Error Message

Error: Repository not found (404)

Debug Logs

$ git remote -v
origin  https://GitHub.com/user/repo.git (fetch)
origin  https://GitHub.com/user/repo.git (push)

$ cortex pr
Fetching pull requests...
Error: Repository not found (404)

System Information

OS: macOS
Cortex CLI version: v0.0.7

Screenshots

https://github.com/springoliver/bounty_challenge_report_image/blob/main/49118.mp4

Steps to Reproduce

  1. Configure a Git remote using mixed-case host:
    git remote set-url origin https://GitHub.com/user/repo.git
  2. Verify remote:
    git remote -v
  3. Run:
    cortex pr
  4. Observe the result

Expected Behavior

cortex pr should correctly parse GitHub remotes regardless of hostname case
Repository should be detected correctly
Pull request data should be fetched successfully

Actual Behavior

Remote is not parsed correctly
Incorrect repository is inferred or rejected
API request fails with 404

Additional Context

Git remote URLs are case-insensitive for hostnames. CLI tools should normalize hostnames before parsing to ensure consistent behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions