No Bitbucket repos with VS Code

Issue #387 resolved
Phill Fernandes created an issue

I can’t seem to get the Atlassian plugin for VS Code to even recognize the active repository in the current Workspace.

Create PR: https://i.imgur.com/jMSNNiK.png
SCM: https://i.imgur.com/cJatk0e.png

Plugin: 2.4.10
VS Code: 1.43.1
Bitbucket: 6.4.1

Comments (11)

  1. Pramod Busam Account Deactivated

    @Phill Fernandes Can you run Atlassian: Show Bitbucket sites info from VS Code's command palette and paste the output from that after scrubbing any sensitive info?

  2. Phill Fernandes reporter

    @{557058:a30b5736-f3cf-41d7-aad0-99c9ffac78ce} please see the output below:

                "remotes": [
                    {
                        "name": "oc-main",
                        "url": "ssh://git@ssh.opencad.io:7999/oc/opencad-app.git",
                        "host": "ssh.opencad.io",
                        "matchingBitbucketSite": "Not found"
                    },
    

    This is also try for my personal fork on the same server. Just as a measure of overpreparedness…

    Results of “git remote -v” from VS Code’s terminal view:

    oc-main ssh://git@ssh.opencad.io:7999/oc/opencad-app.git (fetch)
    oc-main ssh://git@ssh.opencad.io:7999/oc/opencad-app.git (push)
    origin  ssh://git@ssh.opencad.io:7999/~pfernandes/opencad-app.git (fetch)
    origin  ssh://git@ssh.opencad.io:7999/~pfernandes/opencad-app.git (push)
    

  3. Pramod Busam Account Deactivated

    @Phill Fernandes The extension tries to match the host field in the remote (ssh.opencad.io) to the Bitbucket site (you should also see a list of authenticated sites above the remotes section pasted above) and it looks like it's failing.

    Could you try cloning using the https protocol and see if that helps?

  4. Phill Fernandes reporter

    That works in a completely different project but not the one I am having issues in. Because our BB deployment is behind nginx and we use that ssh.opencad.io hostname that makes it technically broken for contributors. Is it possible for there to be a way to override the plugins detection of URLs or if it already exists how is it done?

  5. Phill Fernandes reporter

    This is why we don’t do this stuff before we have a cup of coffee. 🙂

    I am sorry… I completely glossed over the word cloning in your question. That works as well.

  6. Phill Fernandes reporter

    This does work in an unrelated project.

    It DOES NOT work in the project I am working on. Are you trying to say that either this is a limitation of the plugin or a modification I need to make to my Bitbukcet deployment? As you saw earlier the project uses ssh.opencad.io to connect to the SSH port of the server as the repo.opencad.io points to an nginx reverse proxy. I can authenticate to BB with the plugin but no repositories are found.

    As I asked earlier: is it possible for there to be a way to override the plugins detection of URLs or if it already exists how is it done?

  7. Pramod Busam Account Deactivated

    @Phill Fernandes I have created an issue in our backlog to relax the matching criteria so that we only look for opencad.io if the complete host name does not match.

    Meanwhile you can try using SSH aliases as a workaround - https://stackoverflow.com/questions/39413198/cannot-get-multiple-ssh-keys-to-work-with-bitbucket-using-aliases

    Once you have the following config, clone the repo using the alias git clone git@repo.opencad.io and open that in VS Code.

    Host repo.opencad.io
      HostName ssh.opencad.io
     ...
    

    Let us know if that helps.

  8. Phill Fernandes reporter

    That worked flawlessly. I did attempt to just mess with my original repos URLs in the git config but that didn't work.

    After a fresh clone using the alias it works now!

                "remotes": [
                    {
                        "name": "origin",
                        "url": "ssh://git@repo.opencad.io:7999/~pfernandes/opencad-app.git",
                        "host": "repo.opencad.io",
                        "matchingBitbucketSite": "repo.opencad.io"
                    }
    

    I don't have to leave VS code anymore to raise PRs! :D

  9. Log in to comment