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

SSH submodule not rendered as link due to different hostname between HTTP and SSH URL

      Steps to reproduce

      1. Setup an apache server with the URL http://apache.server.com/stash (Apache located in different server)
      2. Set Base URL in Stash as http://apache.server.com/stash
      3. Set SSH base URL in Stash as ssh://localhost:7999
      4. Add SSH submodule ssh://git@localhost:7999/tst/test.git into another repository http://apache.server.com/stash/projects/TST/repos/test2/browse
        (The SSH submodule folder is not rendered as a link)
      5. Change Base URL in Stash to be http://localhost:7990/stash
        (The SSH submodule folder in test2 repository is rendered as a link http://apache.server.com/stash/projects/TST/repos/test/browse)

          Form Name

            [BSERV-4607] SSH submodule not rendered as link due to different hostname between HTTP and SSH URL

            Ah I just realized that the initial issue talks about setting an SSH Base URL that is different than the web base URL. That is an interesting one - we might be able to fix that. As a workaround, you can still use relative links if that fits your use case.

            Adam Ahmed (Inactive) added a comment - Ah I just realized that the initial issue talks about setting an SSH Base URL that is different than the web base URL. That is an interesting one - we might be able to fix that. As a workaround, you can still use relative links if that fits your use case.

            Adam Ahmed (Inactive) added a comment - - edited

            It's worth noting that Submodules don't typically provide anything but a URL to the Git repository. This URL isn't accessible to web browsers, so showing it as a real browser link will probably also frustrate people ("why did you trick me into clicking a link that just gives me errors?!"). Also worth noting that the Git URL is available on hover of the contentId of the submodule - so you can access it from the web if you really want to (though it's arguably a bit hidden).

            We check the submodule URLs, and if they are relative to the current repository or look like they are on the current BBS instance (absolute URL matches the Base URL), then we can generate the browser-accessible URL for the repo and render a link. We could potentially support URLs to applinked BBS instances, or make an attempt to ping the URL and see if the response can be attributed to a well-known host, or special-case urls to bitbucket.org or github.com (UPDATE: actually we already do this!), but the cost/benefit ratio seems high for that. We'll most likely focus instead on shipping other features that'll benefit a greater number of customers.

            If you change your base URL and use an absolute URL for the submodule, BBS doesn't know that the URL points back to itself (and actually, that URL will be wrong now - it won't work in a Git client either).

            I'm going to make some minor changes to improve the title on the submodule when it's unlinked, but I'm not sure there's much more we'll do. If you have specific input, please let me know ASAP while I'm looking at this.

            Cheers,
            Adam

            Adam Ahmed (Inactive) added a comment - - edited It's worth noting that Submodules don't typically provide anything but a URL to the Git repository. This URL isn't accessible to web browsers, so showing it as a real browser link will probably also frustrate people ("why did you trick me into clicking a link that just gives me errors?!"). Also worth noting that the Git URL is available on hover of the contentId of the submodule - so you can access it from the web if you really want to (though it's arguably a bit hidden). We check the submodule URLs, and if they are relative to the current repository or look like they are on the current BBS instance (absolute URL matches the Base URL), then we can generate the browser-accessible URL for the repo and render a link. We could potentially support URLs to applinked BBS instances, or make an attempt to ping the URL and see if the response can be attributed to a well-known host, or special-case urls to bitbucket.org or github.com (UPDATE: actually we already do this!), but the cost/benefit ratio seems high for that. We'll most likely focus instead on shipping other features that'll benefit a greater number of customers. If you change your base URL and use an absolute URL for the submodule, BBS doesn't know that the URL points back to itself (and actually, that URL will be wrong now - it won't work in a Git client either). I'm going to make some minor changes to improve the title on the submodule when it's unlinked, but I'm not sure there's much more we'll do. If you have specific input, please let me know ASAP while I'm looking at this. Cheers, Adam

            +1, this would be helpful for us as well.

            Justin Martin added a comment - +1, this would be helpful for us as well.

            This bug means that sub-modules aren't ideally presented and make sub-modules unusable from a UI perspective. Therefore would be good to get this fixed if possible.

            Richard Bywater added a comment - This bug means that sub-modules aren't ideally presented and make sub-modules unusable from a UI perspective. Therefore would be good to get this fixed if possible.

              aahmed Adam Ahmed (Inactive)
              klfoong Foong (Inactive)
              Affected customers:
              0 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: