Bitbucket server: unable to find a remote
My codebucket configuration looks like this:
"codebucket.bitbucketServerHosts": [{
"gitHost": "http://username@jira.generaldigital.com:7990"
}],
"codebucket.issueTrackers": [{
"host": "http://jira.generaldigital.com:8080",
"projectKeys": [
"NMSX"
],
"type": "jira"
}]
And my output from git remote -v:
origin http://username@jira.generaldigital.com:7990/scm/sdx/main.git (fetch)
origin http://username@jira.generaldigital.com:7990/scm/sdx/main.git (push)
I've omitted my username, but for reference our server simultaneously requires authentication and does not support https. For some reason, I can't get your extension to find our remote.
Comments (8)
-
-
repo owner @sonicbhoc what's the error message you get? Does it fail to open the PR or does it fail to find the remote?
@JakubPawlinski sorry, I must have missed the notification for you comment on issue
#2. What's the output ofgit remote -v
in your case? Does it matchstash.company.com:7990
? -
from VScode when trying to"BitBucket: Open Pull Request" I'm getting "
Unable to find a remote matching: bitbucket.org | http://stash.company.com:7990
from git remote -v
origin https://jakub.pawlinski@stash.company.com/scm/team/project.git (fetch) origin https://jakub.pawlinski@stash.company.com/scm/team/project.git (push)
-
Getting the same issue with BitBucket server.
-
tried to review changes done in https://bitbucket.org/pstreule/codebucket/commits/30f59d741728efb95a4bfe59367a11a15f7dd133?at=master but nothing stands out. Will see if I can debug it
-
I had to change the regular expression so that it worked for Bitbucket Server, it couldn't match any of the hosts it evaluated - no idea if this causes an issue with the bitbucket.org lookup.
public async findRemoteHost(): Promise<Host> { const remotes = await this.getRemoteList(); const hosts = bitbucketHosts(); for (const host of hosts) { const pattern = new RegExp(`(\\w+)\\s+(?:http(s)?)[:]\\/{2}(?:([\\w\\._]+)@)?(${escapeStringRegexp(host.gitHost)})\\/([\\w._]+(?:\\/[\\w._]+)+)(?:\\.git)(?:\\s+\\((.+)\\))?`); for (const remote of remotes) { const matches = pattern.exec(remote); if (matches) { const config: HostConfig = { name: matches[4], gitHost: host.gitHost, webHost: host.webHost, repo: matches[5] }; switch (host.type) { case 'bitbucket': return new BitbucketHost(config); case 'bitbucket-server': return new BitbucketServerHost(config); default: throw new CodeBucketError(`Unknown host type: ${host.type}`); } } } } const candidates = hosts.map(host => host.gitHost).join(' | '); throw new CodeBucketError(`Unable to find a remote matching: ${candidates}`); }
-
tried to apply your fix ,but failed :( my settings are:
"codebucket.bitbucketServerHosts": [{ "webHost": "https://stash.company.com", "gitHost": "http://stash.company.com:7990" }],
I'm pretty new to .js so it maybe my fault entirely. hope @pstreule can act on this
-
repo owner Apologies for my inactivity here, I did not have much spare time lately. I'll take a closer look on the weekend and hope to push a fix then.
- Log in to comment
thats what I said in https://bitbucket.org/pstreule/codebucket/issues/2/add-support-for-bitbucket-server but guess it needs new issue