Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitbucket Server fails when url = https://DOMAIN/stash/scm/PROJECT/REPO.git #901

Closed
jaklan opened this issue Nov 9, 2019 · 5 comments
Closed
Assignees
Labels
bug Something isn't working needs-verification Request for community verification
Milestone

Comments

@jaklan
Copy link

jaklan commented Nov 9, 2019

  • GitLens Version: 10.1.2
  • VSCode Version: 1.40.0
  • OS Version: MacOs Mojave (10.14.6)

Steps to Reproduce:

  1. Use Bitbucket Server with such a remote:
    https://DOMAIN/stash/scm/PROJECT/REPO.git
    The most important part is additional /stash in the URL.
  2. Function baseUrl() in bitbucket-server.ts fails, because this.path.startsWith('scm/') is not true and invoked this.splitPath() results in project = "stash" & repo = "scm/PROJECT/REPO".
  3. Such a behaviour also make it impossible to create a proper custom URL, because you also get wrong tokens: ${repoBase} = stash, ${repo} = stash/scm/PROJECT/REPO and ${repoPath} = scm/PROJECT/REPO. Due to that you're not able to reproduce https://DOMAIN/stash/projects/PROJECT/repos/REPO/browse in any way.

You can try to create a custom Bitbucket Server config and put /stash or /stash/ in the domain field, but it just doesn't work - config is not taken into account when running e.g. Open Repository on Remote, so I assume using slashes in the domain field is not possible.

Potential solution:

Just make it possible to set DOMAIN/stash in the domain field in a Remote configuration or change this.path.startsWith('scm/') line to be also true when any string occurs before scm (and change this.path.replace('scm/', '') similarly).

@meandmax
Copy link

Same problem here, would be nice to get this fixed :)

@robross0606
Copy link

robross0606 commented Nov 20, 2020

Same problem and then some. Seems like Bitbucket Server integration thoroughly botches most of the URL constructions. The only saving grace is that our Bitbucket server appears to at least do a little URL redirection. So if you use:
"repository": "https://bitbucket.server.name/${repo}"

You can at least get to the repository. But getting to anything specific below that doesn't appear to work.

@robross0606
Copy link

I recommend allowing configuration of the "base name" or "context path" similar to how Bitbucket itself is set up if you require a URL context. Even the Atlassian plugin for VSCode supports it this way:
scrnli_11_20_2020_6-53-20 PM

@eamodio eamodio added bug Something isn't working and removed potential-bug labels Feb 1, 2021
@eamodio eamodio self-assigned this Feb 1, 2021
@eamodio eamodio added this to the Soon™ milestone Feb 1, 2021
@eamodio eamodio closed this as completed in cf5a394 Feb 1, 2021
@eamodio eamodio added pending-release Resolved but not yet released to the stable edition needs-verification Request for community verification labels Feb 1, 2021
@eamodio
Copy link
Member

eamodio commented Feb 1, 2021

Can you please verify this fix in tomorrow's insiders edition?

You can install the insiders edition from here. Be sure to disable/uninstall the stable version of GitLens first.

@eamodio eamodio modified the milestones: Soon™, Shipped Feb 3, 2021
@eamodio eamodio removed the pending-release Resolved but not yet released to the stable edition label Feb 9, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs-verification Request for community verification
Projects
None yet
Development

No branches or pull requests

4 participants