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

Remove deprecated outputs datadog and kafka #2081

Merged
merged 2 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions cmd/outputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package cmd

import (
"errors"
"fmt"
"sort"
"strings"
Expand All @@ -36,8 +37,6 @@ import (
"go.k6.io/k6/output/influxdb"
"go.k6.io/k6/output/json"
"go.k6.io/k6/output/statsd"

"github.com/k6io/xk6-output-kafka/pkg/kafka"
)

// TODO: move this to an output sub-module after we get rid of the old collectors?
Expand All @@ -48,16 +47,13 @@ func getAllOutputConstructors() (map[string]func(output.Params) (output.Output,
"cloud": cloud.New,
"influxdb": influxdb.New,
"kafka": func(params output.Params) (output.Output, error) {
params.Logger.Warn("The kafka output is deprecated, and will be removed in a future k6 version. " +
"Please use the new xk6 kafka output extension instead. " +
"It can be found at https://github.com/k6io/xk6-output-kafka.")
return kafka.New(params)
return nil, errors.New("the kafka output was deprecated in k6 v0.32.0 and removed in k6 v0.34.0, " +
"please use the new xk6 kafka output extension instead - https://github.com/k6io/xk6-output-kafka")
},
"statsd": statsd.New,
"datadog": func(params output.Params) (output.Output, error) {
params.Logger.Warn("The datadog output is deprecated, and will be removed in a future k6 version. " +
"Please use the statsd output with env variable K6_STATSD_ENABLE_TAGS=true instead.")
return statsd.NewDatadog(params)
return nil, errors.New("the datadog output was deprecated in k6 v0.32.0 and removed in k6 v0.34.0, " +
"please use the statsd output with env. variable K6_STATSD_ENABLE_TAGS=true instead")
},
"csv": csv.New,
}
Expand Down
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ require (
github.com/andybalholm/brotli v1.0.2
github.com/dop251/goja v0.0.0-20210427212725-462d53687b0d
github.com/fatih/color v1.11.0
github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have additions to go.mod when we're removing a dependency? 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This now specifies the version that was required by the removed dependency.
As go always get the lowest possible version, when you remove a dependency that was requiring the highest possible version it will now require something different, which is likely not what you want, so it needs to now require that specific version in go.mod in order for the dependency version to not change

Copy link
Member

Choose a reason for hiding this comment

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

So right now (and probably before), the versions of these indirect dependencies the k6 vendors are not the ones that were required by the actual direct dependencies' go.mod files, right? If so, it's probably not a big deal, but we should probably clean this up now or when we update the direct dependencies of k6? We don't have a good reason for the current state, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the versions of the inderect dependencies were probably all added as case like
The general case I think is, we have:

k6 -> A -> C(v1.2.0)
k6 -> B -> C(v1.3.0)

we dropped dependency B, and if this isn't added we will now get C v1.2.0 as that is the highest version required.

So go mod adds an indirect dependency to C v1.3.0, so we don't change the version of something we didn't intend to.
If at a later point we update A and it requires C v1.4.0 it will be that version that will be used, and from my quick test it will also remove the indirect dependency in go.mod(as it's no longer changing what versions we will get).
If we drop A (in this case that would be api2go ;) ) we will probably also drop the indirect dependencies as well.

So we can clean whenever and change the dependency version, which seems like a way to get something broken. Or just when updating/dropping dependency it will fix itself

Copy link
Contributor Author

Choose a reason for hiding this comment

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

example: do go get google.golang.org/grpc and see how it drops the indirect dependency on xerrors

github.com/golang/protobuf v1.4.2
github.com/google/go-cmp v0.5.1 // indirect
github.com/gorilla/websocket v1.4.2
github.com/influxdata/influxdb1-client v0.0.0-20190402204710-8ff2fc3824fc
github.com/jhump/protoreflect v1.8.2
github.com/k6io/xk6-output-kafka v0.2.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/klauspost/compress v1.12.2
github.com/kubernetes/helm v2.9.0+incompatible
Expand All @@ -25,6 +26,7 @@ require (
github.com/mccutchen/go-httpbin v1.1.2-0.20190116014521-c5cb2f4802fa
github.com/mitchellh/mapstructure v1.1.2
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d
github.com/onsi/ginkgo v1.14.0 // indirect
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c
github.com/pmezard/go-difflib v1.0.0
github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e
Expand All @@ -37,9 +39,13 @@ require (
github.com/tidwall/pretty v1.1.0
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
golang.org/x/net v0.0.0-20210428185458-6f5299370f2b
golang.org/x/sys v0.0.0-20201204225414-ed752295db88 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20200903010400-9bfcb5116336 // indirect
google.golang.org/grpc v1.37.1
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12
gopkg.in/guregu/null.v2 v2.1.2 // indirect
gopkg.in/guregu/null.v3 v3.3.0
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
)
83 changes: 0 additions & 83 deletions go.sum

Large diffs are not rendered by default.

120 changes: 0 additions & 120 deletions output/statsd/datadog.go

This file was deleted.

79 changes: 0 additions & 79 deletions output/statsd/datadog_test.go

This file was deleted.

26 changes: 0 additions & 26 deletions vendor/github.com/Shopify/sarama/.gitignore

This file was deleted.

Loading