-
Notifications
You must be signed in to change notification settings - Fork 499
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: change package manager from dep to go mod #1542
Conversation
After sanity checking
I'll get these adjusted before this is merged in, the diff here should change very little. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Minor issues and questions.
Remove `.travis.yml` and support for testing this repository on Travis CI. Simplify the CI files we need to manage and maintain. @bartekn pointed out in #1542 (comment) that we don't use TravisCI anymore and we shouldn't keep it around and expect it to be kept up to date. For contributors who fork the repository and have TravisCI installed as an application in their GitHub account TravisCI also runs in addition to CircleCI because this file is present, which is distracting given it's not the build system we're relying on.
Including the changes in unmerged PRs #1685 #1688 and comparing vendor directories using the pattern below, the vendored dependencies appear essentially same. Capturing commands and output below as a reference if I want to reattempt it.
Modules is definitely more aggressive at pruning packages and files that aren't required, so it isn't surprising we'd have some files not being included. I don't yet fully understand why the above shows packages not being included when they're in the I think the above is still okay for the following reasons:
This test I documented above is just to compare vendor directories and we shouldn't plan to use the vendor directory. |
Remove use of `dep` and update version of Go to Go 1.13. The `stellar/go` repo was changed in stellar/go#1542 to use the build-in Go Modules instead of Dep for dependency management. The standard `go` commands can now be relied on for downloading and installing dependencies without any need to run any additional commands like we had to with Dep. Go 1.13 is the latest version of Go and we should use it for these tests since the repository no longer supports Go 1.10.
PR Checklist
PR Structure
otherwise).
services/friendbot
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
Summary
Converts the mono repo from using the
dep
package manager to using the go mod that has become the standard dependency manager in recent releases of Go.Goal and scope
Make the monorepo more accessible to Go developers using standard Go tooling. Modules will be enabled by default in Go 1.13, and were enabled by default when not using a GOPATH in Go 1.11+.
Close #1634
Summary of changes
go.mod
file that contains the same dependencies and dependency versions/hashes/sources.go.sum
which is the smallest set of hashes required to validate that the dependencies at those versions remain consistent.go.list
which is a way for us to visibly see when our dependencies change. Note: This is not a standard file, but is something we can use to validate reproducibility until thego mod
commands provide something similar.go.*
files are out of date.dep
files,Gopkg.toml
andGopkg.lock
. (This will occur just before merging.)Follow ups after merging
Known limitations & issues
This change bumps our minimum supported version of Go to 1.11.4. Versions prior to that version contained a bug when Modules are in use that prevented the importing of some packages. There are more details about the issue here: golang/go#30446 (comment).
What shouldn't be reviewed
It is unlikely going to be possible for you to review the
go.mod
,go.sum
, andgo.list
files. The first two were auto-generated bygo mod init
andgo mod tidy
, and by a dozen subsequentgo get
commands to tell Go to use specific versions for specific libraries. The third is a capture of the output ofgo list -m all
which lists all the dependencies of the project.I used a tool I wrote yesterday deplockgomoddiff to compare our
Gopkg.lock
with the output ofgo list -m all
.go list -m all
is the recommended command mentioned here for validating dependencies when migrating to Modules to ensure we have alignment. The recommendation is to manually compare the output of that command with the dependencies we expected, but due to our large number of repositories it was impractical to do manually, hence the tool.