Repository names greater than 62 characters are truncated

XMLWordPrintable

    • 1
    • 181

      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 &#x27;<user>:<password>&#x27; &#x27;https://api.bitbucket.org/2.0/repositories/<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using-api&#x27; | 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 &#x27;<user>:<password>&#x27; &#x27;https://api.bitbucket.org/2.0/repositories/<team>/repo-with-long-name-exceeding-62-chars-cant-be-found-using-api1&#x27; | 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 &#x27;<user>:<password>&#x27; &#x27;https://api.bitbucket.org/2.0/repositories/<team>?pagelen=100&#x27; | jq &#x27;.values | .[] | select(.name == "repo-with-long-name-exceeding-62-chars-cant-be-found-using-api1")&#x27;
      {
        ...
        "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.

            Assignee:
            Unassigned
            Reporter:
            Sergey Zhemzhitsky
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: