You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Related to Codium-ai#1148
Update `_parse_pr_url` method in `pr_agent/git_providers/bitbucket_server_provider.py` to handle URLs with `/users/`.
* Add logic to check for both `/projects/` and `/users/` in the URL path and process them accordingly.
* Modify the method to raise a `ValueError` if neither `/projects/` nor `/users/` is found in the URL.
* Update the `workspace_slug` to include a `~` prefix if the URL contains `/users/`.
Add test case for URL with `/users/` in `tests/unittest/test_bitbucket_provider.py`.
* Ensure the new test case verifies the correct parsing of URLs with `/users/`.
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: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
toprojects
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:
pr-agent/pr_agent/git_providers/bitbucket_server_provider.py
Lines 329 to 336 in aef9a04
pr-agent/pr_agent/git_providers/bitbucket_server_provider.py
Lines 339 to 364 in aef9a04
The text was updated successfully, but these errors were encountered: