pr-agent icon indicating copy to clipboard operation
pr-agent copied to clipboard

[Feature Request] Support pull requests in personal spaces in bitbucket server without requiring any URL hacks

Open JimiHFord opened this issue 6 months ago • 1 comments

If you use a repository hosted in a personal space in Bitbucket Server (e.g. https://bitbucket.company-server.url/users/username/repos/my-repo/pull-requests/1, you'll get:

ValueError: The provided URL 'https://bitbucket.company-server.url/users/username/repos/my-repo/pull-requests/1' does not appear to be a Bitbucket PR URL

A workaround/hack our team found was to modify the url from this:

https://bitbucket.company-server.url/users/username/repos/my-repo/pull-requests/1

to this:

https://bitbucket.company-server.url/projects/~username/repos/my-repo/pull-requests/1

(i.e. Change users to projects and add a ~ in front of the username)

This works, but ideally the first URL should work too (i.e. https://bitbucket.company-server.url/users/username/repos/my-repo/pull-requests/1).

Relevant sections of code:

  • https://github.com/Codium-ai/pr-agent/blob/aef9a04b32adbf9a21b51ed74d5b704308a84466/pr_agent/git_providers/bitbucket_server_provider.py#L329-L336
  • https://github.com/Codium-ai/pr-agent/blob/aef9a04b32adbf9a21b51ed74d5b704308a84466/pr_agent/git_providers/bitbucket_server_provider.py#L339-L364

JimiHFord avatar Aug 15 '24 17:08 JimiHFord