-
Notifications
You must be signed in to change notification settings - Fork 1k
dep init does not attempt to use ssh #1041
Comments
@shoenig thanks for trying I don't think we can solve this issue in
The issue you are facing is more of a support for private/enterprise patterns, which is being tracked in #286 . Hope this helps :) |
We have a private repository based on If |
@xgfone dep supports ssh, in the same way that go get does - as the non-default option that it falls back to when other things don't work. the necessity of specifying a user tends to make that tricky for pure import path inference. if you're running a go-get metadata server, though, it should work without problem. |
@sdboyer Yes, i found. But i need to add the suffix I feel that In // Github
{
prefix: "github.com/",
re: `^(?P<root>github\.com/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(/[\p{L}0-9_.\-]+)*$`,
vcs: "git",
repo: "https://{root}",
check: noVCSSuffix,
} it's very nice to reject the suffix For Now, how can I solve the dependency by the format At present, my [[constraint]]
name = "gitlab.example.com/username/project.git"
version = "v1.0.0" Then, |
// gitlab.example.com
{
prefix: "gitlab.example.com/",
re: `^(?P<root>gitlab\.example\.com/(?P<project>[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+))(/[\p{L}0-9_.\-]+)*$`,
vcs: "git",
repo: "ssh://[email protected]/{project}",
check: noVCSSuffix,
}, For Finally, it works. |
The suffix I think, in this case, |
I have found a solution from ibrasho. [[constraint]]
name = "gitlab.example.com/username/project"
source = "gitlab.example.com/username/project.git"
version = "v1.0.0" It works. It's not fairly perfect, but can have solved my problem. CHEERS! |
i'm glad you found something that ou feel is acceptable 😄 |
I do not feel this workaround is acceptable considering projects with vast numbers of transitive 3rd party dependencies. We want |
@shoenig i quite agree - having to add manually add
we do! see e.g. #286 #175. we've got folks working on a registry/intermediary server that should be able to address these sorts of woes, once and for all. arbitrary custom matching logic, such as that given in #1041 (comment), is not something we can support. if we were to add such support, then we create a situation where projects are resolvable only if everyone knows has the same custom matching logic. and there's no way to make that feature "internal, enterprise-only", which would mean we'd be voluntarily creating a situation where the public ecosystem can fragment itself. that's a non-starter, so we need to wait for registries. in the meantime, running a go get metadata proxy can do a lot. or using |
Following is the comment from : @xgfone : go get does not support the customized private repository. So in order to support our private repos, i added the code below, which is copied from Github, into vcsPaths: // gitlab.example.com Finally, it works. @xgfone : The above solution is not working for me.! BTW, I am also under the same problem which you faced. We are hosting our code base on gitlab (private repo). I am still seeing that dep is trying to fetch the source using https instead of ssh. Notes : I can be able to get the source using go get, but not using dep. |
I ran into the issue with a private github repo on a CentOS. I could fix it by adding the following to a
|
@balaji39mit I think that it's not recommended way to modify the Go tool source. It's only my first test to find one way to support |
@FQ400 thanks, your approach solved it for me |
@xgfone : Yeah, it worked. Thanks. |
@FQ400 Thanks! Here is a one liner for Git Enterprise users: git config --global url."git@github.yourEnterprise.com:".insteadOf "https://github.yourEnterprise.com/" |
What version of Go (
go version
) anddep
(git describe --tags
) are you using?What
dep
command did you run?What did you expect to see?
Complete success - we are configured to only clone via ssh. This is a hard requirement, and no https based workaround will work.
go dep
claims to be able to clone via ssh, but evidently did not attempt to do so.Other
Never mind the semantics of the name ("3rdparty") of the repo being cloned, it's just an unfortunate coincidence
The text was updated successfully, but these errors were encountered: