Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
packages/source-control-bitbucket, packages/shared
What happens
A project cloned from a self-hosted Bitbucket Server / Data Center instance cannot link or watch pull requests. Every call fails with:
This thread's project is on a host with no known pull request URL shape. Pass url.
The same happens with all three input shapes:
link_pull_request(url: "http://<host>:7990/projects/PROJ/repos/repo/pull-requests/178")→PullRequestUrlInvalidErrorlink_pull_request(host, repository, number)→PullRequestUrlUnavailableErrorlink_pull_request(repository, number)→PullRequestUrlUnavailableError
Reproduction
git remote add origin http://10.x.x.x:7990/scm/PROJ/repo.git— the standard Bitbucket Server HTTP clone URL (/scm/prefix, host is an IP or a hostname without abitbucketlabel).- Open the project in T3 Code and call
link_pull_requestwith the web URLhttp://10.x.x.x:7990/projects/PROJ/repos/repo/pull-requests/1. - Observe the error above.
watch_pull_requestfails the same way, so PR comments never wake the thread.
Root cause (0.1.10 bundle)
packages/source-control-bitbucket/src/shared/definition.ts:
recognizeRemote: ({ host, hostname }) =>
hostname === "bitbucket.org" || hostname.split(".").includes("bitbucket")
? { kind, name: hostname === "bitbucket.org" ? "Bitbucket" : "Bitbucket Self-Hosted", baseUrl: `https://${host}` }
: null- A Bitbucket Server host that is an IP (
10.x.x.x) or a hostname without abitbucketlabel is not recognized at all. The remote falls back togeneric, which defines nochangeRequestUrl/parseChangeRequestUrl, sochangeRequestHost()returnsnulland the toolkit raisesPullRequestUrlUnavailableError. - Even when the host does contain
bitbucket, the shared definition still assumes Bitbucket Cloud:CHANGE_REQUEST_PATH = /^\/([^/]+\/[^/]+)\/pull-requests\/(\d+)(?:\/|$)/(/{workspace}/{repo}/pull-requests/{id}), while Server uses/projects/{projectKey}/repos/{repoSlug}/pull-requests/{id}baseUrlis hard-coded tohttps://${host}, while Server instances are commonly plain HTTP on port 7990 and may be served under a context path (/bitbucket/...)
Bitbucket Server URLs for reference
- clone:
http://<host>:7990/scm/<PROJECT_KEY>/<repo_slug>.git - PR page:
http://<host>:7990/projects/<PROJECT_KEY>/repos/<repo_slug>/pull-requests/<id> - REST:
http://<host>:7990/rest/api/1.0/projects/<PROJECT_KEY>/repos/<repo_slug>/pull-requests/<id>
Expected
A Bitbucket Server / Data Center instance should be usable for PR linking, watching and actions, e.g.:
- provider detection that does not depend on a
bitbucketlabel in the hostname — an explicit "server base URL" setting is fine, since self-hosted instances cannot be inferred from the host; parseChangeRequestUrl/changeRequestUrlfor the/projects/.../repos/.../pull-requests/{id}shape with an optional context path and arbitrary scheme/port;- PR reads and actions through
/rest/api/1.0/...with a personal access token (state, comments, approve, merge).
Environment
- T3 Code 0.1.10 (macOS, beta)
- Bitbucket Server 7.x, HTTP, port 7990
Metadata
Metadata
Assignees
Labels
No labels
Activity
juliusmarminge commentedon Nov 18, 2026
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.