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

all: update to use Go modules #811

Merged
merged 2 commits into from
Dec 21, 2020
Merged

all: update to use Go modules #811

merged 2 commits into from
Dec 21, 2020

Conversation

andybons-stripe
Copy link
Contributor

@andybons-stripe andybons-stripe commented Dec 18, 2020

Summary

This change updates Veneur to use Go modules.

Steps taken:

  • Checked out repo
  • Ran go mod init github.com/stripe/veneur, which copied the dependency info from Gopkg.lock
  • Ran go test ./... as a simple sanity check and was informed that vendoring was inconsistent, so I ran go mod vendor
  • Got error about hashicorp/consul:
    github.com/stripe/veneur imports
    github.com/hashicorp/consul/api: ambiguous import: found package github.com/hashicorp/consul/api in multiple modules:
    github.com/hashicorp/consul v0.9.0 (/Users/andybons/go/pkg/mod/github.com/hashicorp/[email protected]/api)
    github.com/hashicorp/consul/api v1.1.0 (/Users/andybons/go/pkg/mod/github.com/hashicorp/consul/[email protected])
    
  • Added replace directive replace github.com/hashicorp/consul => github.com/hashicorp/consul v1.5.1 outlined in this issue
  • Re-ran go mod vendor; completed without issue this time
  • Adapted Dockerfile to use modules, ran into gogo protobuf issues, so I pointed protoc to look in $GOPATH/pkg/mod instead of $GOPATH/src for its dependency on gogo.proto. Updated tdigest.proto to import from the updated spot.
  • Updated stringer usage in generate.go to use a relative path since it was unable to find the type definitions otherwise (it’s unclear why stringer was pinned to a revision but gojson was not)
  • Updated Dockerfile to use Go 1.15 and use LABEL instead of MAINTAINER since MAINTAINER is deprecated
  • Updated CircleCI config.yml to reflect changes made to Dockerfile
  • Ran go mod tidy at one point
  • Docker build completes without issue. CircleCI tests complete without issue. 🥳

Motivation

dep is no longer maintained, and modules are the officially supported dependency management solution for Go. This allows the project to use the latest tooling and unblocks some other efforts as well.

Test plan

All tests should pass.

Rollout/monitoring/revert plan

There should be no changes to rollout. Safe to revert only if commit is recent enough that it won’t break future changes to dependencies. Please cc @ChimeraCoder and @andybons-stripe if you do.

@andybons-stripe
Copy link
Contributor Author

andybons-stripe commented Dec 18, 2020

I was able to build the Docker image locally. Next step is to update CircleCI tests.

Edit: okey doke CircleCI is passing woohoo.

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