Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-9409

Import from git does not work with local BitBucket

XMLWordPrintable

    • Moderate
    • None
    • ODC Sprint 242
    • 1
    • Rejected
    • Unspecified
    • If docs needed, set a value

      ==> Description of problem:

      "Import from git" functionality with a local Bitbucket instance does not work, due to repository validation that requires to repository to be hosted on Bitbucket Cloud. [1][2]

      [1] https://github.com/openshift/console/blob/release-4.10/frontend/packages/git-service/src/services/bitbucket-service.ts#L63

      [2] https://github.com/openshift/console/blob/release-4.10/frontend/packages/git-service/src/services/bitbucket-service.ts#L18

      ==> Version-Release number of selected component (if applicable):

      Tested in OCP 4.10

      ==> How reproducible: 100%

      ==> Steps to Reproduce:
      1. Go to: Developer View > Add+ > From Git
      2. Fill the "Git Repo URL" field with the BitBucket repo URL (i.e. http://<bitbucket_url>/scm/<project>/<repository>.git)
      3. Select BitBucket from the "Git type" dropdowns button

      ==> Actual results:
      "URL is valid but cannot be reached. If this is a private repository, enter a source Secret in advanced Git options"

      ==> Expected results:

      This functionality should work also with hosted Bitbucket

      ==> Additional info:

      To retrieve slug information from hosted BitBucket we can query: http://<bitbucket_url>/rest/api/1.0/projects/<project>/repos/<repository>

      An example:

      ~~~
      curl -ks http://bitbucket-server-bitbucket.apps.gmeghnag.lab.cluster/rest/api/1.0/projects/test/repos/test-repo | jq
      {
      "slug": "test-repo",
      "id": 1,
      "name": "test-repo",
      "hierarchyId": "28fc5c8782050b43e223",
      "scmId": "git",
      "state": "AVAILABLE",
      "statusMessage": "Available",
      "forkable": true,
      "project": {
      "key": "TEST",
      "id": 1,
      "name": "test",
      "public": false,
      "type": "NORMAL",
      "links": {
      "self": [

      { "href": "http://bitbucket-server-bitbucket.apps.gmeghnag.lab.cluster/projects/TEST" }

      ]
      }
      },
      "public": true,
      "archived": false,
      "links": {
      "clone": [

      { "href": "http://bitbucket-server-bitbucket.apps.gmeghnag.lab.cluster/scm/test/test-repo.git", "name": "http" }

      ,

      { "href": "ssh://git@bitbucket-server-bitbucket.apps.gmeghnag.lab.cluster:7999/test/test-repo.git", "name": "ssh" }

      ],
      "self": [

      { "href": "http://bitbucket-server-bitbucket.apps.gmeghnag.lab.cluster/projects/TEST/repos/test-repo/browse" }

      ]
      }
      }
      ~~~

              avik6028 Avik Kundu
              rhn-support-gmeghnag Gabriel Meghnagi
              Sanket Pathak Sanket Pathak
              Red Hat Employee
              Christoph Jerolimov
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: