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: migrate to modules #672

Merged
merged 5 commits into from
Jun 5, 2020
Merged

all: migrate to modules #672

merged 5 commits into from
Jun 5, 2020

Conversation

gbbr
Copy link
Contributor

@gbbr gbbr commented Jun 3, 2020

One big module, no requirements besides msgp. This allows the importing module to have the final word with import versions just like in the previous "no module" world.

CI now uses workflows. Seems to take around 3.5 minutes.

@gbbr gbbr added this to the Unplanned milestone Jun 3, 2020
@gbbr gbbr force-pushed the gbbr/mod branch 10 times, most recently from cebbf36 to f906abc Compare June 3, 2020 11:29
@gbbr gbbr force-pushed the gbbr/mod branch 4 times, most recently from 6ba924a to 3b801c1 Compare June 3, 2020 12:00
@gbbr gbbr changed the title Migrate to modules. all: migrate to modules Jun 3, 2020
@gbbr gbbr force-pushed the gbbr/mod branch 3 times, most recently from a8236dc to 38ad1dd Compare June 3, 2020 13:55
Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

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

This looks really good. Very excited to get this in.

.circleci/config.yml Outdated Show resolved Hide resolved
ddtrace/Gopkg.toml Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
@gbbr gbbr force-pushed the gbbr/mod branch 7 times, most recently from a18cae3 to ca4e130 Compare June 4, 2020 07:20
@gbbr gbbr force-pushed the gbbr/mod branch 3 times, most recently from 24cb7c3 to 38115e9 Compare June 4, 2020 11:28
@gbbr gbbr marked this pull request as ready for review June 4, 2020 14:12
go.mod Outdated
github.com/DataDog/datadog-go v3.7.1+incompatible
github.com/philhofer/fwd v1.0.0 // indirect
github.com/tinylib/msgp v1.1.2
github.com/zenazn/goji v1.0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want goji here?

Copy link
Contributor Author

@gbbr gbbr Jun 4, 2020

Choose a reason for hiding this comment

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

It was an accident. There should be only one entry in this file: tinylib/msgp

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 think this is going to be weird. It requires doing:

git update-index --assume-unchanged ./go.mod 

Because the file exists in the repo :|

knusbaum
knusbaum previously approved these changes Jun 4, 2020
Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

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

Fantastic. 🥳
LGTM

@knusbaum knusbaum modified the milestones: Unplanned, 1.25.0 Jun 4, 2020
environment:
GO111MODULE: "on"
GOPATH: "/home/circleci/go"
working_directory: /home/circleci/go/src/gopkg.in/DataDog/dd-trace-go.v1
Copy link
Contributor

@roopakv roopakv Jun 4, 2020

Choose a reason for hiding this comment

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

lets not have the module downloaded within gopath?

if a module has go.mod it should work from outside and that will be a good test for us to do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that might be better.

Copy link
Contributor

@roopakv roopakv left a comment

Choose a reason for hiding this comment

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

looks pretty good overall. have some suggestions :)

command: |
go run checkcopyright.go

- run:
name: Check gofmt
name: gofmt
Copy link
Contributor

Choose a reason for hiding this comment

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

on a step before this let us restore cache of go modules and and we can save below. this will make each run a lot faster

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haven't figured out how to do that. Not sure how to get a good checksum. Tried to use go.sum but it's not reliable or I need to somehow update it. Ideas welcome.

.circleci/config.yml Show resolved Hide resolved
Comment on lines 52 to 56
docker:
- image: circleci/golang:1.13
environment:
GO111MODULE: "on"
GOPATH: "/home/circleci/go"
Copy link
Contributor

Choose a reason for hiding this comment

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

lets move all docker to one executor and use there.

we have building on go1.12 and testing on go1.13. Might be better to have them all on the same version

Copy link
Contributor

Choose a reason for hiding this comment

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

oh nvm i saw the conversation re different golang versions.

Still think listing the executors on top might be cool: https://circleci.com/docs/2.0/configuration-reference/#executors-requires-version-21

Copy link
Contributor

Choose a reason for hiding this comment

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

Some of the contrib packages require go1.13 (k8s.io/client-go), but we would prefer to test at least the tracer (ddtrace/tracer) with the minimum supported version - go1.12

Copy link
Contributor

Choose a reason for hiding this comment

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

@knusbaum makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry @roopakv, somehow your second message didn't show up when I was responding. I only saw the first comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be something to look into if it saves CI time and wasted resources. It's easy to get go1.12 using go get golang.org/dl/go1.12 just for the build. The base executor image could have both.

Copy link
Contributor Author

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Thanks for the input @roopakv. I tried to apply some of it. Since the main goal of this PR was to switch to modules we'll go ahead and merge it and are happy to make more CI changes or improvements in follow up PRs.

The executor idea sounded interesting, we have quite a couple of jobs now using the same image go1.13, we should consider that.

This is the workflow:

Screenshot 2020-06-05 at 10 40 42

environment:
GO111MODULE: "on"
GOPATH: "/home/circleci/go"
working_directory: /home/circleci/go/src/gopkg.in/DataDog/dd-trace-go.v1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that might be better.

.circleci/config.yml Show resolved Hide resolved
command: |
go run checkcopyright.go

- run:
name: Check gofmt
name: gofmt
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haven't figured out how to do that. Not sure how to get a good checksum. Tried to use go.sum but it's not reliable or I need to somehow update it. Ideas welcome.

@gbbr
Copy link
Contributor Author

gbbr commented Jun 5, 2020

The last CI run was 2m51s. I see on v1 the times used to be 6-8m, so this should be good.

Copy link
Contributor

@cgilmour cgilmour left a comment

Choose a reason for hiding this comment

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

Re-approving based on original approval.

@gbbr gbbr merged commit ee88309 into v1 Jun 5, 2020
@gbbr gbbr deleted the gbbr/mod branch June 5, 2020 07:57
@gbbr gbbr linked an issue Jun 5, 2020 that may be closed by this pull request
mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this pull request Dec 22, 2020
Migrate to go modules. The `go.mod` file is not committed into the repository and contains entries for dependencies exclusively needed by the repository and none of the integrations. This is so because we want the importing program to have the final word in deciding versions. As a side-effect, we were forced to update the import path of what was formerly `gopkg.in/Shopify/sarama.v1` to `github.com/Shopify/sarama`. For more details, please see: IBM/sarama#1510

Additionally, CI change were introduced which reduce time by about 50%.
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.

proposal: add support for go modules
4 participants