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

x/vgo: not working with github enterprise path #25244

Closed
superfell opened this issue May 3, 2018 · 6 comments
Closed

x/vgo: not working with github enterprise path #25244

superfell opened this issue May 3, 2018 · 6 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@superfell
Copy link

Trying out vgo with a code base that uses packages hosted on an internal github enterprise server, access to do anything including git clone https:// or download tarballs from tags requires authentication [both companies i've seen using Github Enterprise have it configured this way].

vgo fails to fetch any package from this server, reporting
vgo get github.<corp.com> : unknown module github.<corp.com>/team/package: no go-import tags

There were multiple mentions of enterprise support in the vgo docs, i think this will need to include handling authentication for accessing packages.

What version of Go are you using (go version)?

go version go1.10.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/sfell/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/sfell/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0w/gq6532wd6l955415rv6b_trw395xz4/T/go-build358497285=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

ran vgo build on a file that contains an import path that references an internal github enterprise server.

What did you expect to see?

a correct error about needing authentication, hopefully with instructions on how to provide authentication credentials/tokens etc.

What did you see instead?

vgo get github.<corp.com> : unknown module github.<corp.com>/team/package: no go-import tags

@gopherbot gopherbot added this to the vgo milestone May 3, 2018
@ALTree
Copy link
Member

ALTree commented May 4, 2018

This looks like a dup of #24076, which in theory should be fixed.

Are you using the latest vgo?

@ALTree ALTree changed the title x/vgo how to manage credentials? x/vgo: how to manage credentials? May 4, 2018
@ALTree ALTree changed the title x/vgo: how to manage credentials? x/vgo: not working with github enterprise path May 4, 2018
@ALTree ALTree added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 4, 2018
@superfell
Copy link
Author

I installed vgo yesterday. 24076 looks related, but there's no mention of authentication that i noticed in that issue.

@superfell
Copy link
Author

superfell commented May 4, 2018

trying the request that i think vgo is making with curl shows that GHE is returning a redirect to the login UI, which is why there are no tags. If there's an easy way to determine the exact request vgo is making that results in the error, i can run that and post relevant info.

@ALTree ALTree added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels May 4, 2018
@patricksuo
Copy link

patricksuo commented Jun 15, 2018

@superfell
you can tell git to always use SSH instead of HTTPS
git config --global url.ssh://[email protected]/.insteadOf https://githubenterprise.com

@rsc
Copy link
Contributor

rsc commented Jun 29, 2018

This should be fixed if you update to latest vgo (go get -u golang.org/x/vgo), since vgo is now using the same connection logic as old "go get", and old "go get" now works transparently with the latest GitHub Enterprise release (thanks to GitHub for doing that).

@rsc rsc closed this as completed Jun 29, 2018
@coolaj86
Copy link

coolaj86 commented Sep 20, 2018

I see that this is marked as closed, but I've been unable to find an example of the solution.

I have private repos that will require API keys in deployment environments and I'm trying to figure out where I tell go.mod "when you see this import, construct this url with this token instead of whatever you would normally do".

So in the case of

go get awesome.io/go/sauce

The end result should be

git clone https://token:[email protected]/awesome/go-sauce.git

Can anyone give me an update on the best practice way to accomplish this? Something that doesn't require modifying an existing server would be preferred.

@golang golang locked and limited conversation to collaborators Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants