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/cmd/go-contrib-init: does not exit if git-codereview install fails #21040

Closed
theckman opened this issue Jul 16, 2017 · 3 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@theckman
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

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

go version go1.8.3 darwin/amd64

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

GOARCH="amd64"
GOHOSTARCH="amd64"
GOOS="darwin"
GOHOSTOS="darwin"

What did you do?

I tried to run the go-contrib-init command while my Go environment was in a half-setup state. I did this by simply unsetting GOROOT in my shell, and then executing the command.

What did you expect to see?

I expected the command to exit, indicating that it failed to install git-codereview.

What did you see instead?

Error running go get golang.org/x/review/git-codereview: exit status 1
Installed git-codereview (ran `go get golang.org/x/review/git-codereview`)
All good. Happy hacking!
Remember to squash your revised commits and preserve the magic Change-Id lines.
Next steps: https://golang.org/doc/contribute.html#commit_changes

We are checking the error returned by running that command, but we don't seem to exit if we fail to install the git-codereview package. Instead we print the error indicating it failed, but then continue operating as-if that didn't happen (including a log line indicating it succeeded):

@theckman
Copy link
Contributor Author

I believe this issue can be fixed by adjusting this to use log.Fatalf() instead of log.Printf(): https://github.com/golang/tools/blob/d78e5d2552f0118165e0525719c6ab6b9eaebc4e/cmd/go-contrib-init/contrib.go#L266

If this fix seems appropriate, I'd be happy to try and make this my first contribution to Go/Go tools.

@bradfitz bradfitz changed the title go-contrib-init does not exit if git-codereview install fails x/tools/cmd/go-contrib-init: does not exit if git-codereview install fails Jul 16, 2017
@gopherbot gopherbot added this to the Unreleased milestone Jul 16, 2017
@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 16, 2017
@bradfitz
Copy link
Contributor

Sounds good. Go for it.

@gopherbot
Copy link

CL https://golang.org/cl/49151 mentions this issue.

@golang golang locked and limited conversation to collaborators Jul 17, 2018
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

3 participants