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/tools/go/vcs: refresh from cmd/go #19362

Closed
nalbion opened this issue Mar 2, 2017 · 11 comments
Closed

x/tools/go/vcs: refresh from cmd/go #19362

nalbion opened this issue Mar 2, 2017 · 11 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@nalbion
Copy link

nalbion commented Mar 2, 2017

https://github.com/kardianos/govendor/issues/265 is due to golang.org/x/tools/go/vcs/http.go using http.DefaultClient.get(privateBitbucketUrl) without an Authorization header.

bitbucketVCS should extract the login and password from ~/.netrc

@josharian josharian changed the title golang.org/x/tools/go/vcs does not support private repos which require Authorization x/tools/go/vcs: support private repos which require Authorization Mar 2, 2017
@bradfitz bradfitz added FeatureRequest NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Mar 3, 2017
@bradfitz
Copy link
Contributor

bradfitz commented Mar 3, 2017

@rsc, opinions on this?

@rsc
Copy link
Contributor

rsc commented Mar 6, 2017

Reading .netrc seems a bit hacky.

@nalbion
Copy link
Author

nalbion commented Mar 7, 2017

How is that hacky if the user who created the .netrc file (%HOME%\_netrc in Windows) is running a process which needs to access one of those domains? ...as long as you don't post the contents to Twitter or something ;-)

Another (not even mutually exclusive) option would be to parse ~/.gitconfig:

[url "ssh://git@bitbucket.org/"]
        insteadOf = https://bitbucket.org/
[url "ssh://git@github.com/"]
        insteadOf = https://github.com/

@rsc
Copy link
Contributor

rsc commented Mar 7, 2017

It's hacky because it's not the go command's job to recreate the functionality of other tools. We're not reading .gitconfig and we're not reading .netrc, and that's good.

That said, I think the go command itself handles bitbucketVCS just fine - for an auth failure it falls back to invoking git/hg directly, which is the perfect way to respect .netrc without parsing .netrc - and the x/tools/go/vcs copy is just out of date. Perhaps it is enough for someone to refresh the x/tools copy.

@nalbion
Copy link
Author

nalbion commented Mar 7, 2017

... So govendor sync is calling the wrong X/tools function?

@rsc
Copy link
Contributor

rsc commented Mar 7, 2017

No, I think x/tools/go/vcs (which is a copy of code internal to the go command) is out of date and needs to be updated.

@nalbion
Copy link
Author

nalbion commented Mar 7, 2017

Perhaps the go command should vendor this library so that there is one version of this code to maintain?

@rsc
Copy link
Contributor

rsc commented Mar 8, 2017

There will always be two copies to maintain. The go command is the primary source here.

@gopherbot gopherbot added this to the Unreleased milestone Mar 21, 2017
@rsc rsc changed the title x/tools/go/vcs: support private repos which require Authorization x/tools/go/vcs: refresh from cmd/go Jun 5, 2017
@rsc
Copy link
Contributor

rsc commented Jun 5, 2017

This just needs to be refreshed from the cmd/go master.

@rsc rsc added NeedsFix The path to resolution is known, but the work has not been done. and removed FeatureRequest NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Jun 5, 2017
@mengzhuo
Copy link
Contributor

I think go get should respect .netrc file at least while fetching meta-data.
My company's code repos (derived from Gitlab) that only authorized user access any URL.

@dmitshur
Copy link
Contributor

This package has been deprecated in #57051 and won't receive further development, so closing this as not planned.

@dmitshur dmitshur closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2023
@golang golang locked and limited conversation to collaborators Jun 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants