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

Introduce instrumentation-specific Go modules #405

Merged
merged 16 commits into from
Jan 17, 2019

Conversation

axw
Copy link
Member

@axw axw commented Jan 4, 2019

This PR started out with me removing some vendored packages, which escalated when I realised that the go.mod we had was woefully incomplete. The simple change would have been to run "go mod tidy", adding all of the missing dependencies; that would meant adding all of the upstream packages for all of the instrumentation modules to the top-level go.mod. If you wanted to to instrument Gin, you would have been forced to pull down gRPC-Go, Echo, Beego, etc. Not ideal.

So instead, each instrumentation module/package is now its own Go module. We will version each module identically and they will move in lock-step to achieve the same versioning as we have today. This will be enforced by new tooling in scripts/genmod, which will be run in CI; the tool will also ensure that the module definitions are minimally complete.

This change must not be merged until we're ready to tag and release v1.2.0.

Closes #389

@axw axw force-pushed the tidy-dependencies branch 2 times, most recently from 7e29000 to b2d191f Compare January 4, 2019 07:00
@codecov-io
Copy link

codecov-io commented Jan 4, 2019

Codecov Report

Merging #405 into master will increase coverage by 2.18%.
The diff coverage is 85.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #405      +/-   ##
==========================================
+ Coverage   80.97%   83.15%   +2.18%     
==========================================
  Files         104      104              
  Lines        6396     6370      -26     
==========================================
+ Hits         5179     5297     +118     
+ Misses        932      787     -145     
- Partials      285      286       +1
Impacted Files Coverage Δ
module/apmsql/pq/parser.go 72.72% <ø> (ø) ⬆️
module/apmsql/utils.go 18.18% <ø> (ø) ⬆️
stacktrace/library.go 100% <ø> (ø) ⬆️
module/apmgorilla/context.go 94.44% <ø> (ø) ⬆️
module/apmot/internal/harness/api_checkers.go 85.93% <85.93%> (ø)
tracer.go 86.33% <0%> (+0.82%) ⬆️
transport/transporttest/recorder.go 82.19% <0%> (+5.47%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3a93b0...981178c. Read the comment docs.

@axw axw force-pushed the tidy-dependencies branch 2 times, most recently from f59a036 to 79eb9d0 Compare January 7, 2019 10:51
axw added 10 commits January 17, 2019 10:56
Remove test dependencies where unnecessary, e.g.
the use of apmhttp in apm and apmredigo for cheap
integration testing. Unfortunately test dependencies
leak into go.mod, so these dependencies will cause
more harm than good.
Vendor the opentracing-go test harness until a new
opentracing-go release has been made. This allows us
to use a semantic version in go.mod, rather than
pinning a specific commit.
Add a tool for updating/checking Go module
definitions. We ensure that the modules'
requirements are minimally complete, and
the minimum module versions are set to
the current agent version.
@axw axw force-pushed the tidy-dependencies branch 3 times, most recently from ddd70a3 to 305b284 Compare January 17, 2019 05:27
- elastic/go-sysinfo
- golang.org/x/sys
- howett.net/plist
We're now optimising for Go modules.
Users may vendor in their own projects.
Use bash, not sh.
Add a script that will create and push tags
to the upstream repo, for each module.
@axw axw merged commit cc1e77d into elastic:master Jan 17, 2019
@axw axw deleted the tidy-dependencies branch January 17, 2019 10:39
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.

Introduce instrumentation-specific Go modules (go.mod)
2 participants