Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-8243

Cannot create personal repositories (due to lazy creation of personal project) unless user has already created a personal repository

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 4.12.0
    • 3.8.1
    • None
    • None

    Description

      HTR

      1. Create a user "testuser2"
      2. Execute:

      francois:reproad twong$ curl --user admin:admin -X POST -H "Content-Type: application/json" "http://localhost:7990/rest/api/1.0/users/testuser2/repos"
      

      Expected behavior

      Successfully create personal repository.

      Actual behavior

      {"errors":[{"context":null,"message":"Project ~testuser2 does not exist.","exceptionName":"com.atlassian.stash.exception.NoSuchProjectException"}]}
      

      Further testing 1

      1. Log in as "testuser2".
      2. Execute:

      francois:reproad twong$ curl --user admin:admin -X POST -H "Content-Type: application/json" "http://localhost:7990/rest/api/1.0/users/testuser2/repos"
      

      Expected behavior

      Successfully create personal repository.

      Actual behavior

      {"errors":[{"context":null,"message":"Project ~testuser2 does not exist.","exceptionName":"com.atlassian.stash.exception.NoSuchProjectException"}]}
      

      Further testing 2

      1. Log in as "testuser2" results in the same error as above.
      2. Create a personal repository.
      3. Execute:

      francois:reproad twong$ curl --user admin:admin  -X POST -H "Content-Type: application/json" -d '{"name" : "testsuccess"}'  "http://localhost:7990/rest/api/1.0/users/testuser2/repos"
      

      4. Success!

      {"slug":"testsuccess","id":26,"name":"testsuccess","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"~TESTUSER2","id":44,"name":"testuser2 testuser2","type":"PERSONAL","owner":
      {"name":"testuser2","emailAddress":"testuser2@testuser.com","id":67,"displayName":"testuser2 testuser2","active":true,"slug":"testuser2","type":"NORMAL","link":{"url":"/users/testuser2","rel":"self"},"links":{"self":[{"href":"http://localhost:7990/users/testuser2"}]}},"link":{"url":"/users/testuser2","rel":"self"},"links":{"self":[{"href":"http://localhost:7990/users/testuser2"}]}},"public":false,"link":{"url":"/users/testuser2/repos/testsuccess/browse","rel":"self"},"cloneUrl":"http://admin@localhost:7990/scm/~testuser2/testsuccess.git","links":{"clone":[{"href":"ssh://git@localhost:7999/~testuser2/testsuccess.git","name":"ssh"},{"href":"http://admin@localhost:7990/scm/~testuser2/testsuccess.git","name":"http"}],"self":[{"href":"http://localhost:7990/users/testuser2/repos/testsuccess/browse"}]}}
      

      Attachments

        Activity

          People

            crolf Christian
            twong Tim Wong (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: