You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Create a Dev Environment form, it allows you to use an existing Git repo, however it does not allow you to press the Continue button unless it deems that your Git URL is valid. Unfortunately, the Git URL validation is flawed since it requires that your Git URL contain at least one slash.
For example, the following Git URL is valid, however the Create a Dev Environment form does not consider it to be valid.
git@git.example.com:my-project.git
However, the form does consider the following Git URL to be valid.
git@git.example.com:my-username/my-project.git
Not all Git servers follow the GitHub convention of username/repo paths. My personal Git server does not follow this convention because it only contains my own projects, so there is no need for a username in the path.
Reproduce
Open Docker Desktop.
Select Dev Environments from the menu.
Ensure Existing Git repo is selected.
Enter a valid Git URL that does not contain a slash. (e.g. git@git.example.com:my-project.git)
Note that the Continue button is disabled.
Enter a valid Git URL that does contain a slash. (e.g. git@git.example.com:my-username/my-project.git)
Note that the Continue button is enabled.
Expected behavior
The Create a Dev Environment form should validate Git URLs correctly. Specifically, it should allow valid Git URLs that do not contain a slash.
Actually, the rabbit hole goes deeper. Technically git@git.example.com:my-project.git is not a Git URL. It's more like an scp source. However, git clone accepts it as a repository source.
The Create a Dev Environment form says that you should be able to provide an HTTPS or SSH URL, however when I do use a valid SSH URL (e.g. ssh://git@git.example.com/~/my-project.git), Docker Desktop just hangs during the Setup step.
Preparing to clone inside a volume
Installing credential helpers...
done
Cloning into '/com.docker.devenvironments.code'...
Granted, ssh://git@git.example.com/~/my-project.git does not point to an existing Git repo. I'm just using it to demonstrate the type of URL I'm using to access my personal Git server. In my tests, I'm using real sources that work with git clone.
Here's the types of strings I've provided to the Create a Dev Environment form, none of which work with the form, but they do work with git clone.
git@git.example.com:my-project.git (Does not enable the Continue button.)
git@git.example.com:~/my-project.git (Perpetually hangs during the Setup step.)
ssh://git@git.example.com/~/my-project.git (Perpetually hangs during the Setup step.)
g@g.example.com:my-project.git (Does not enable the Continue button.)
g@g.example.com:~/my-project.git (Resolves to the URL https://github.com/g/, which doesn't exist.)
ssh://g@g.example.com/~/my-project.git (Perpetually hangs during the Setup step.)
I have found no way to access the Git repos in my personal Git server via this form.
My best advice would be to stop trying to do stuff with the provided URL, and just pass it to git clone. Or, at the very least, stop assuming everyone is only pulling from GitHub.
Description
When using the Create a Dev Environment form, it allows you to use an existing Git repo, however it does not allow you to press the Continue button unless it deems that your Git URL is valid. Unfortunately, the Git URL validation is flawed since it requires that your Git URL contain at least one slash.
For example, the following Git URL is valid, however the Create a Dev Environment form does not consider it to be valid.
git@git.example.com:my-project.git
However, the form does consider the following Git URL to be valid.
git@git.example.com:my-username/my-project.git
Not all Git servers follow the GitHub convention of
username/repo
paths. My personal Git server does not follow this convention because it only contains my own projects, so there is no need for a username in the path.Reproduce
Expected behavior
The Create a Dev Environment form should validate Git URLs correctly. Specifically, it should allow valid Git URLs that do not contain a slash.
docker version
Client: Cloud integration: v1.0.35-desktop+001 Version: 24.0.5 API version: 1.43 Go version: go1.20.6 Git commit: ced0996 Built: Fri Jul 21 20:36:24 2023 OS/Arch: windows/amd64 Context: default Server: Docker Desktop 4.22.1 (118664) Engine: Version: 24.0.5 API version: 1.43 (minimum version 1.12) Go version: go1.20.6 Git commit: a61e2b4 Built: Fri Jul 21 20:35:45 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.21 GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc: Version: 1.1.7 GitCommit: v1.1.7-0-g860f061 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Diagnostics ID
F97CE84A-FE0C-4C8E-9AD8-DC238027E97A/20230911015842
Additional Info
git@git.example.com:my-project.git is a valid Git URL in syntax only. It does not actually point to an existing Git repo.
The text was updated successfully, but these errors were encountered: