-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Moving outputs/transport => common/transport #16734
Conversation
27b366f
to
2ea71ee
Compare
2ea71ee
to
67c6fbb
Compare
Looks like we need to rebase. This is an API breaking change, as a many things got moved that other code (also community code) might rely upon. Please add a developers changelog. Would be nice to include some 'Developer Change' section in the PR description giving some instructions on what needs to be done to adapt existing code to the changes. ping @elastic/apm-server |
67c6fbb
to
6c1831a
Compare
Done!
Added in b80a8f5cc3714fd60ee59444c536c4a33a54366b.
Done, PR description updated.
I created elastic/apm-server#3416 as well. |
585ac4a
to
b679601
Compare
@urso This is ready for re-review, when you get a chance. Thanks! |
9f7a152
to
f3df370
Compare
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
I like the line count changes :)
@urso Just want to clarify something — even though this is a developer breaking change, we want to backport this to |
TBH, tough call :) One option for 7.x is to add 'compatbility' with existing code by introducing aliases (this use case is exactly why aliases have been introduced in go in the first place). |
Okay, sounds good. I will setup a backport PR (once this PR is merged) but amend it to include aliases from the old => new exported symbols. |
f3df370
to
7cd61b7
Compare
Jenkins CI failures are unrelated (they are also seen on |
* Moving outputs/transport => common/transport (#16734) * Moving outputs/transport => common/transport * Removing outputs/tls.go * Pass config object by value (not pointer) * Fixing formatting of imports * Adding developer CHANGELOG entries * Fixing formatting of imports * Running go mod tidy * Moving MakeDialer into transport * Running go mod tidy * Remove breaking changes entry from developer CHANGELOG * Bring back old packages for backwards compat * Adding back libbeat/outputs/tls.go * Fixing up libbeat/outputs/transport/tls.go * Restoring MakeDialer to original place * Missed an arg * Restoring *Config params to old code
What does this PR do?
transport
package fromlibbeat/outputs/transport
tolibbeat/common/transport
.outputs/tls.go
and updates all it's usages.*Config
parameters (pass-by-pointer) withConfig
parameters (pass-by-value) in functions/methods wherever safe.Why is it important?
The code in this package is used in places other than outputs.
Developer Docs
This PR introduces breaking changes to the API provided by libbeat.
libbeat/outputs/transport
, in most cases you must now importlibbeat/common/transport
instead.libbeat/outputs/transport
orlibbeat/outputs
for using any TLS-related symbols, you must now importlibbeat/common/transport/tlscommon
instead.libbeat/outputs/transport.MakeDialer
with a*Config
object as the first argument, you must now calllibbeat/common/transport.MakeDialer
with aConfig
object as the first argument instead.libbeat/outputs/transport.NewClient
with a*Config
object as the first argument, you must now calllibbeat/common/transport.NewClient
with aConfig
object as the first argument instead.libbeat/outputs/transport.NewClientWithDialer
with a*Config
object as the second argument, you must now calllibbeat/common/transport.NewClientWithDialer
with aConfig
object as the second argument instead.libbeat/outputs/transport.Dial
with a*Config
object as the first argument, you must now calllibbeat/common/transport.Dial
with aConfig
object as the first argument instead.Checklist
[ ] I have commented my code, particularly in hard-to-understand areas[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature worksRelated issues