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

Add support for godep #77

Merged
merged 6 commits into from
Feb 18, 2016
Merged

Conversation

justenwalker
Copy link
Contributor

  • Conform to golang standard directory layout
  • Install godep in Dockerfile
  • Create initial Godeps workspace
  • Add update-deps make command

For #76

  - Install godep in Dockerfile
  - Add update-deps make command
  - Enable vendor experiment
@tgross
Copy link
Contributor

tgross commented Feb 16, 2016

I know you're coming back to this but we definitely don't want to have the vendored dependencies committed in this repo, so we should add that to the .gitignore.

@justenwalker
Copy link
Contributor Author

@tgross I can ignore that folder; however, the /vendor/ folder AFAIK should be included in in the repo.

In any case, godep restore would put all of the dependencies in the GOPATH, so the docker makefile will run - but it would break compatibility with go get or go install

@justenwalker
Copy link
Contributor Author

Alternatively, we could look into govendor instead

@tgross
Copy link
Contributor

tgross commented Feb 16, 2016

I can ignore that folder; however, the /vendor/ folder AFAIK should be included in in the repo.

Only if we're using git subtrees or submodules. Vendoring the dependencies to the appropriate file system location is an orthogonal concern to the source control for those dependencies. Embedding them within our code obscures provenance and also fills our project history with someone else's project.

@justenwalker
Copy link
Contributor Author

amended commit - TravisCI build failed due to a curl error - no clear way to ask it to try again.

@justenwalker
Copy link
Contributor Author

Only if we're using git subtrees or submodules. Vendoring the dependencies to the appropriate file system location is an orthogonal concern to the source control for those dependencies. Embedding them within our code obscures provenance and also fills our project history with someone else's project.

I agree - I hate vendoring in general. It seems like the way the go team wants you to treat /vendor is in ruby/rails sense. There is at least some dissent for this practice.

I've excluded it from this PR; However, in doing so we are deviating from the intended use.

mkdir -p "${ROOT}/src/github.com/coreos"
git clone https://github.com/coreos/etcd.git ${ROOT}/src/github.com/coreos/etcd
cd ${ROOT}/src/github.com/coreos/etcd && git checkout ${ETCD_REF}
update-deps: restore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I misunderstanding this or does this update all our dependencies to the current tip? Can we put a giant "OMG don't do this" warning on the top of this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe get a make restore at the top-level make too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could remove this completely, we could take manual steps to upgrade the library ourselves.

@tgross
Copy link
Contributor

tgross commented Feb 17, 2016

I'm seeing this in the Travis output:

godep: WARNING: Go version (go1.5) & $GO15VENDOREXPERIMENT=1 wants to enable the vendor experiment, but disabling because a Godep workspace (Godeps/_workspace) exists

I think we want to make sure that directory isn't there.

@tgross
Copy link
Contributor

tgross commented Feb 17, 2016

It seems like the way the go team wants you to treat /vendor is in ruby/rails sense

Ok, but they're profoundly wrong and I'm ok with taking a stance on that.

${CDWD} && go vet
${CDWD} && go fmt
golint ${ROOT}/src/containerbuddy
${CDWD} && go vet ${NO_VENDOR}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate artifact of how /vendor folder works. ./... path expansion cannot be used because it would recurse into the vendor folder. you have to explicitly exclude it

@tgross
Copy link
Contributor

tgross commented Feb 18, 2016

Ok, thanks for slogging thru this @justenwalker. LGTM and I'm going to merge it in and then cut a hopefully-finally RC.

tgross added a commit that referenced this pull request Feb 18, 2016
@tgross tgross merged commit 3062e5b into TritonDataCenter:master Feb 18, 2016
@justenwalker justenwalker deleted the godeps branch February 27, 2016 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants