Details
-
Bug
-
Resolution: Won't Fix
-
Low
-
181
-
1
-
Description
Currently we have discovered that repository names are truncated if length of theirs names is greater than 62.
For example, consider the following name (62 chars)
repo-with-long-name-exceeding-62-chars-cant-be-found-using-api
This name works just fine and there are no any issues with it
$ curl -u '<user>:<password>' 'https://api.bitbucket.org/2.0/repositories/<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using-api' | jq . { ... "name": "repo-with-long-name-exceeding-62-chars-cant-be-found-using-api", "links": { ... "branches": { "href": "https://api.bitbucket.org/2.0/repositories/<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using-api/refs/branches" }, ... "html": { "href": "https://bitbucket.org/<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using-api" }, ... }, ... "full_name": "<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using-api", ... }
As you can see name and full_name as well as all the links are consistent with the original repository name.
Now rename the repository by appending to its name just one character to look like the following
repo-with-long-name-exceeding-62-chars-cant-be-found-using-api1
Then try to find it by its name and observe 404 http response code
$ curl -u '<user>:<password>' 'https://api.bitbucket.org/2.0/repositories/<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using-api1' | jq . { "error": { "message": "Repository <team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using-api1 not found" } }
although the repository cannot be found by its name, it can be found in the list of all the repositories
$ curl -u '<user>:<password>' 'https://api.bitbucket.org/2.0/repositories/<team>?pagelen=100' | jq '.values | .[] | select(.name == "repo-with-long-name-exceeding-62-chars-cant-be-found-using-api1")' { ... "name": "repo-with-long-name-exceeding-62-chars-cant-be-found-using-api1", "links": { ... "branches": { "href": "https://api.bitbucket.org/2.0/repositories/<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using/refs/branches" }, ... "html": { "href": "https://bitbucket.org/<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using" }, ... }, ... "full_name": "<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using", ... }
and now we can see that its full name is
<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using
although the original name we just set is
repo-with-long-name-exceeding-62-chars-cant-be-found-using-api1
and all the links are inconsistent with the original name too.
Attachments
Issue Links
- is related to
-
BCLOUD-21136 Repository URL doesn't get the completely name when it's longer than 62 characters
- Closed