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

[WIP] Upgrade weaveworks/common and lower Sirupsen/logrus #2881

Closed
wants to merge 10 commits into from

Conversation

marccarre
Copy link
Contributor

@marccarre marccarre commented Oct 8, 2017

As discussed on Slack, this PR:

I am admittedly not happy with this PR, as there are few hacks involved (mainly because Go's vendoring/dependencies management currently s*cks):

  1. mixing gvt and dep for dependencies management in various projects seems to lead to the needs for hacks like f5b6937, see also this explanation -- proper resolution might be to manage scope's dependencies with dep,
  2. some other dependencies still had references to Sirupsen/logrus, which is addressed in a hacky way in 76807eb -- proper resolution would be to lowercase logrus for these dependencies upstream and, then update to releases having the change,
  3. upgrading to latest to weaveworks/common led to the need to upgrade to latest context (for Context) and golang.org/x/net/context (for ctxhttp),

but at least:

  • we can build successfully with latest dependencies and sirupsen/logrus,
  • details of all steps followed and commands ran are in the commit messages, so the upgrade is reproducible.

Reviewers: given how large the diff is for this PR, you may want to pay closer attention to the commit messages, which explain what has been done, how, and for most commits, why.

```
$ gvt delete github.com/Sirupsen/logrus
```
```
$ gvt fetch -tag v1.0.3 github.com/sirupsen/logrus
2017/10/08 XX:XX:XX Fetching: github.com/sirupsen/logrus
2017/10/08 XX:XX:XX · Skipping (existing): golang.org/x/sys/unix
2017/10/08 XX:XX:Xx · Skipping (existing): golang.org/x/crypto/ssh/terminal
```
```
$ gvt fetch -tag v1.1.0 github.com/weaveworks/promrus
2017/10/08 XX:XX:XX Fetching: github.com/weaveworks/promrus
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/julienschmidt/httprouter
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/go-kit/kit/log
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/go-stack/stack
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/go-logfmt/logfmt
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: github.com/kr/logfmt
2017/10/08 XX:XX:XX · Skipping (existing): gopkg.in/yaml.v2
2017/10/08 XX:XX:XX · Fetching recursive dependency: gopkg.in/alecthomas/kingpin.v2
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/alecthomas/units
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/alecthomas/template
2017/10/08 XX:XX:XX · Skipping (existing): golang.org/x/net/context/ctxhttp
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/stretchr/objx
2017/10/08 XX:XX:XX · Skipping (existing): golang.org/x/net/context
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/pkg/errors
```
```
$ gvt delete github.com/weaveworks/common
$ gvt fetch -revision 15746cbb5831e70c58d520634b09393b7c3cfd56 github.com/weaveworks/common
2017/10/08 XX:XX:XX Fetching: github.com/weaveworks/common
2017/10/08 XX:XX:XX · Skipping (existing): github.com/sirupsen/logrus
2017/10/08 XX:XX:XX · Skipping (existing): github.com/golang/protobuf/proto
2017/10/08 XX:XX:XX · Skipping (existing): github.com/mgutz/ansi
2017/10/08 XX:XX:XX · Skipping (existing): golang.org/x/net/context
2017/10/08 XX:XX:XX · Skipping (existing): github.com/opentracing/opentracing-go/ext
2017/10/08 XX:XX:XX · Skipping (existing): github.com/golang/protobuf/ptypes/empty
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/opentracing-contrib/go-stdlib/nethttp
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go/ext
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go/log
2017/10/08 XX:XX:XX · Skipping (existing): github.com/aws/aws-sdk-go/aws/credentials
2017/10/08 XX:XX:XX · Skipping (existing): github.com/weaveworks/promrus
2017/10/08 XX:XX:XX · Skipping (existing): github.com/golang/protobuf/ptypes
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go/ext
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/metadata
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/codes
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/status
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go/log
2017/10/08 XX:XX:XX ·· Skipping (existing): golang.org/x/net/context
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc
2017/10/08 XX:XX:XX · Skipping (existing): golang.org/x/tools/cover
2017/10/08 XX:XX:XX · Skipping (existing): github.com/aws/aws-sdk-go/aws
2017/10/08 XX:XX:XX · Skipping (existing): github.com/armon/go-socks5
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/weaveworks-experiments/loki/pkg/client
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/apache/thrift/lib/go/thrift
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/opentracing/opentracing-go
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/golang.org/x/net/context
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/openzipkin/zipkin-go-opentracing
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/gogo/protobuf/proto
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/Shopify/sarama
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/eapache/queue
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/eapache/go-xerial-snappy
2017/10/08 XX:XX:XX ····· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/golang/snappy
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/pierrec/lz4
2017/10/08 XX:XX:XX ····· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/pierrec/xxHash/xxHash32
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/eapache/go-resiliency/breaker
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/klauspost/crc32
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/davecgh/go-spew/spew
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/rcrowley/go-metrics
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/go-logfmt/logfmt
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/weaveworks-experiments/loki/vendor/github.com/kr/logfmt
2017/10/08 XX:XX:XX · Skipping (existing): google.golang.org/grpc/metadata
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/mwitkow/go-grpc-middleware
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/grpclog
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: go.uber.org/zap/zapcore
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: go.uber.org/zap/internal/exit
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: go.uber.org/multierr
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: go.uber.org/atomic
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: go.uber.org/zap/internal/color
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: go.uber.org/zap/buffer
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: go.uber.org/zap/internal/bufferpool
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/metadata
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/grpc-ecosystem/go-grpc-middleware/testing/testproto
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/golang/protobuf/proto
2017/10/08 XX:XX:XX ··· Skipping (existing): golang.org/x/net/context
2017/10/08 XX:XX:XX ··· Skipping (existing): google.golang.org/grpc
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go/log
2017/10/08 XX:XX:XX ·· Skipping (existing): golang.org/x/net/context
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/sirupsen/logrus
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/golang/protobuf/jsonpb
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/golang/protobuf/proto
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/golang/protobuf/ptypes/any
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/golang/protobuf/ptypes/struct
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/golang/protobuf/ptypes/duration
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/golang/protobuf/ptypes/timestamp
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/golang/protobuf/ptypes/wrappers
2017/10/08 XX:XX:XX ·· Skipping (existing): golang.org/x/net/trace
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/credentials
2017/10/08 XX:XX:XX ·· Fetching recursive dependency: github.com/grpc-ecosystem/go-grpc-middleware/logging
2017/10/08 XX:XX:XX ··· Skipping (existing): google.golang.org/grpc/grpclog
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: go.uber.org/zap
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/sirupsen/logrus
2017/10/08 XX:XX:XX ··· Skipping (existing): google.golang.org/grpc/codes
2017/10/08 XX:XX:XX ··· Fetching recursive dependency: github.com/grpc-ecosystem/go-grpc-middleware/tags
2017/10/08 XX:XX:XX ···· Skipping (existing): google.golang.org/grpc/peer
2017/10/08 XX:XX:XX ···· Fetching recursive dependency: github.com/grpc-ecosystem/go-grpc-middleware
2017/10/08 XX:XX:XX ····· Skipping (existing): github.com/opentracing/opentracing-go/log
2017/10/08 XX:XX:XX ····· Skipping (existing): golang.org/x/net/context
2017/10/08 XX:XX:XX ····· Skipping (existing): google.golang.org/grpc
2017/10/08 XX:XX:XX ····· Skipping (existing): github.com/golang/protobuf/proto
2017/10/08 XX:XX:XX ····· Skipping (existing): google.golang.org/grpc/metadata
2017/10/08 XX:XX:XX ····· Fetching recursive dependency: github.com/stretchr/testify/suite
2017/10/08 XX:XX:XX ······ Skipping (existing): github.com/stretchr/testify/assert
2017/10/08 XX:XX:XX ······ Fetching recursive dependency: github.com/stretchr/testify/require
2017/10/08 XX:XX:XX ······· Skipping (existing): github.com/stretchr/testify/assert
2017/10/08 XX:XX:XX ····· Skipping (existing): github.com/opentracing/opentracing-go
2017/10/08 XX:XX:XX ····· Skipping (existing): github.com/sirupsen/logrus
2017/10/08 XX:XX:XX ····· Fetching recursive dependency: github.com/gogo/protobuf/gogoproto
2017/10/08 XX:XX:XX ······ Fetching recursive dependency: github.com/gogo/protobuf/proto
2017/10/08 XX:XX:XX ······· Fetching recursive dependency: github.com/gogo/protobuf/types
2017/10/08 XX:XX:XX ········ Fetching recursive dependency: github.com/gogo/protobuf/sortkeys
2017/10/08 XX:XX:XX ······ Fetching recursive dependency: github.com/gogo/protobuf/protoc-gen-gogo/descriptor
2017/10/08 XX:XX:XX ····· Skipping (existing): google.golang.org/grpc/codes
2017/10/08 XX:XX:XX ····· Skipping (existing): github.com/opentracing/opentracing-go/ext
2017/10/08 XX:XX:XX ····· Skipping (existing): google.golang.org/grpc/grpclog
2017/10/08 XX:XX:XX ····· Skipping (existing): google.golang.org/grpc/peer
2017/10/08 XX:XX:XX ····· Skipping (existing): golang.org/x/net/trace
2017/10/08 XX:XX:XX ····· Skipping (existing): google.golang.org/grpc/credentials
2017/10/08 XX:XX:XX ···· Skipping (existing): golang.org/x/net/context
2017/10/08 XX:XX:XX ···· Skipping (existing): google.golang.org/grpc
2017/10/08 XX:XX:XX ··· Skipping (existing): github.com/golang/protobuf/proto
2017/10/08 XX:XX:XX ··· Skipping (existing): golang.org/x/net/context
2017/10/08 XX:XX:XX ··· Skipping (existing): google.golang.org/grpc
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/opentracing/opentracing-go/ext
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/golang/protobuf/proto
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/codes
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/peer
2017/10/08 XX:XX:XX · Skipping (existing): github.com/davecgh/go-spew/spew
2017/10/08 XX:XX:XX · Skipping (existing): google.golang.org/grpc/status
2017/10/08 XX:XX:XX · Skipping (existing): google.golang.org/grpc
2017/10/08 XX:XX:XX · Skipping (existing): github.com/golang/protobuf/ptypes/any
2017/10/08 XX:XX:XX · Skipping (existing): github.com/opentracing/opentracing-go
2017/10/08 XX:XX:XX · Skipping (existing): github.com/prometheus/client_golang/prometheus
2017/10/08 XX:XX:XX · Fetching recursive dependency: google.golang.org/genproto/googleapis/rpc/status
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/golang/protobuf/proto
2017/10/08 XX:XX:XX ·· Skipping (existing): github.com/golang/protobuf/ptypes/any
2017/10/08 XX:XX:XX · Skipping (existing): github.com/pmezard/go-difflib/difflib
2017/10/08 XX:XX:XX · Fetching recursive dependency: github.com/sercand/kuberesolver
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/naming
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc/grpclog
2017/10/08 XX:XX:XX ·· Skipping (existing): google.golang.org/grpc
2017/10/08 XX:XX:XX · Skipping (existing): github.com/gorilla/mux
```
Fix:
```
report/marshal.go:14:2: cannot find package "github.com/Sirupsen/logrus" in any of:
    /go/src/github.com/weaveworks/scope/vendor/github.com/Sirupsen/logrus (vendor tree)
    /usr/local/go/src/github.com/Sirupsen/logrus (from $GOROOT)
    /go/src/github.com/Sirupsen/logrus (from $GOPATH)
```
via:
```
$ git grep -l Sirupsen | grep -v vendor | xargs sed -i 's:github.com/Sirupsen/logrus:github.com/sirupsen/logrus:g'
$ gofmt -s -w app
$ gofmt -s -w common
$ gofmt -s -w probe
$ gofmt -s -w prog
$ gofmt -s -w tools
```
Fix:
```
vendor/github.com/docker/docker/pkg/archive/archive.go:20:2: cannot find package "github.com/Sirupsen/logrus" in any of:
    /go/src/github.com/weaveworks/scope/vendor/github.com/Sirupsen/logrus (vendor tree)
    /usr/local/go/src/github.com/Sirupsen/logrus (from $GOROOT)
    /go/src/github.com/Sirupsen/logrus (from $GOPATH)
```
via:
```
$ git grep -l Sirupsen | xargs sed -i 's:github.com/Sirupsen/logrus:github.com/sirupsen/logrus:g'
```
```
$ gvt delete github.com/weaveworks/billing-client
$ gvt fetch -revision be0d55e547b147ea1817f037cab9458bf7fc7850 github.com/weaveworks/billing-client
2017/10/08 XX:XX:XX Fetching: github.com/weaveworks/billing-client
2017/10/08 XX:XX:XX · Skipping (existing): github.com/sirupsen/logrus
2017/10/08 XX:XX:XX · Skipping (existing): github.com/prometheus/client_golang/prometheus
2017/10/08 XX:XX:XX · Skipping (existing): github.com/fluent/fluent-logger-golang/fluent
2017/10/08 XX:XX:XX · Skipping (existing): github.com/weaveworks/common/instrument
```
```
$ gvt delete golang.org/x/net/context
$ gvt fetch golang.org/x/net/context
2017/10/08 XX:XX:XX Fetching: golang.org/x/net/context
$ git grep -l "golang.org/x/net/context" | grep -v vendor | xargs sed -i 's:golang.org/x/net/context:context:g'
$ git grep -l "context/ctxhttp" | grep -v vendor | xargs sed -i 's:context/ctxhttp:golang.org/x/net/context/ctxhttp:g'
$ gofmt -s -w app
$ gofmt -s -w common
$ gofmt -s -w probe
$ gofmt -s -w prog
$ gofmt -s -w tools
```

This fixes errors like:
```
app/multitenant/aws_collector.go:222: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogram
app/multitenant/aws_collector.go:439: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogram
app/multitenant/memcache_client.go:155: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogramStatus
app/multitenant/memcache_client.go:210: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogramStatus
app/multitenant/s3_client.go:74: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogram
app/multitenant/s3_client.go:91: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogram
app/multitenant/sqs_control_router.go:99: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogram
app/multitenant/sqs_control_router.go:133: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogram
app/multitenant/sqs_control_router.go:163: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogram
app/multitenant/sqs_control_router.go:199: cannot use func literal (type func("github.com/weaveworks/scope/vendor/golang.org/x/net/context".Context) error) as type func("context".Context) error in argument to instrument.TimeRequestHistogram
app/multitenant/sqs_control_router.go:199: too many errors
```
```
$ rm -fr vendor/github.com/weaveworks/promrus/vendor/github.com/sirupsen
```

This fixes build errors like:
```
vendor/github.com/weaveworks/common/logging/logging.go:35: cannot use hook (type *promrus.PrometheusHook) as type "github.com/weaveworks/scope/vendor/github.com/sirupsen/logrus".Hook in argument to "github.com/weaveworks/scope/vendor/github.com/sirupsen/logrus".AddHook:
    *promrus.PrometheusHook does not implement "github.com/weaveworks/scope/vendor/github.com/sirupsen/logrus".Hook (wrong type for Fire method)
        have Fire(*"github.com/weaveworks/scope/vendor/github.com/weaveworks/promrus/vendor/github.com/sirupsen/logrus".Entry) error
        want Fire(*"github.com/weaveworks/scope/vendor/github.com/sirupsen/logrus".Entry) error
```
@marccarre marccarre requested review from 2opremio and bboreham October 8, 2017 18:07
@marccarre marccarre force-pushed the update-common-lower-sirupsen branch from 377f7f8 to 87879ee Compare October 10, 2017 17:28
```
$ gvt delete github.com/weaveworks/common
$ gvt fetch -revision 41542d6238573fc99d2fd89e8df6618586974c7e github.com/weaveworks/common
2017/10/10 XX:XX:XX Fetching: github.com/weaveworks/common
2017/10/10 XX:XX:XX · Skipping (existing): github.com/golang/protobuf/ptypes
2017/10/10 XX:XX:XX · Skipping (existing): golang.org/x/net/context
2017/10/10 XX:XX:XX · Skipping (existing): github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc
2017/10/10 XX:XX:XX · Skipping (existing): github.com/opentracing/opentracing-go
2017/10/10 XX:XX:XX · Skipping (existing): github.com/sirupsen/logrus
2017/10/10 XX:XX:XX · Skipping (existing): github.com/weaveworks/promrus
2017/10/10 XX:XX:XX · Skipping (existing): github.com/davecgh/go-spew/spew
2017/10/10 XX:XX:XX · Skipping (existing): github.com/pmezard/go-difflib/difflib
2017/10/10 XX:XX:XX · Skipping (existing): google.golang.org/grpc/status
2017/10/10 XX:XX:XX · Skipping (existing): google.golang.org/grpc/metadata
2017/10/10 XX:XX:XX · Skipping (existing): github.com/armon/go-socks5
2017/10/10 XX:XX:XX · Skipping (existing): google.golang.org/genproto/googleapis/rpc/status
2017/10/10 XX:XX:XX · Skipping (existing): github.com/mgutz/ansi
2017/10/10 XX:XX:XX · Skipping (existing): github.com/mwitkow/go-grpc-middleware
2017/10/10 XX:XX:XX · Skipping (existing): github.com/sercand/kuberesolver
2017/10/10 XX:XX:XX · Skipping (existing): github.com/golang/protobuf/ptypes/empty
2017/10/10 XX:XX:XX · Skipping (existing): golang.org/x/tools/cover
2017/10/10 XX:XX:XX · Skipping (existing): github.com/opentracing-contrib/go-stdlib/nethttp
2017/10/10 XX:XX:XX · Skipping (existing): github.com/aws/aws-sdk-go/aws
2017/10/10 XX:XX:XX · Skipping (existing): github.com/aws/aws-sdk-go/aws/credentials
2017/10/10 XX:XX:XX · Skipping (existing): github.com/prometheus/client_golang/prometheus
2017/10/10 XX:XX:XX · Skipping (existing): github.com/golang/protobuf/ptypes/any
2017/10/10 XX:XX:XX · Skipping (existing): github.com/weaveworks-experiments/loki/pkg/client
2017/10/10 XX:XX:XX · Skipping (existing): google.golang.org/grpc
2017/10/10 XX:XX:XX · Skipping (existing): github.com/gorilla/mux
2017/10/10 XX:XX:XX · Skipping (existing): github.com/golang/protobuf/proto
2017/10/10 XX:XX:XX · Skipping (existing): github.com/opentracing/opentracing-go/ext
$ gvt delete github.com/weaveworks/promrus
$ gvt fetch -tag v1.2.0 github.com/weaveworks/promrus
2017/10/10 XX:XX:XX Fetching: github.com/weaveworks/promrus
2017/10/10 XX:XX:XX · Skipping (existing): gopkg.in/alecthomas/kingpin.v2
2017/10/10 XX:XX:XX · Skipping (existing): golang.org/x/net/context
2017/10/10 XX:XX:XX · Skipping (existing): github.com/julienschmidt/httprouter
2017/10/10 XX:XX:XX · Skipping (existing): golang.org/x/net/context/ctxhttp
2017/10/10 XX:XX:XX · Skipping (existing): github.com/go-kit/kit/log
2017/10/10 XX:XX:XX · Skipping (existing): github.com/go-kit/kit/log/level
2017/10/10 XX:XX:XX · Skipping (existing): github.com/pkg/errors
2017/10/10 XX:XX:XX · Skipping (existing): github.com/stretchr/objx
2017/10/10 XX:XX:XX · Skipping (existing): gopkg.in/yaml.v2
$ rm -fr vendor/github.com/weaveworks/promrus/vendor/github.com/sirupsen
```
@marccarre marccarre force-pushed the update-common-lower-sirupsen branch from 87879ee to d8dc538 Compare October 10, 2017 17:32
@rade
Copy link
Member

rade commented Oct 18, 2017

What is happening with this? It's the kind of PR that surely is prone to bitrot, so we ought to get it reviewed and merged quickly.

@bboreham
Copy link
Collaborator

I really don't like editing the vendor'd dependencies as in 76807eb

The rest of it looks pretty good.

@marccarre
Copy link
Contributor Author

Agreed, I really dislike this too. Having another look at this, it seems the latest versions of:

use sirupsen instead of Sirupsen.
I'll see if we can upgrade easily.

@bboreham
Copy link
Collaborator

Of the ones edited:

@2opremio
Copy link
Contributor

2opremio commented Oct 18, 2017

I really don't like editing the vendor'd dependencies as in 76807eb

There's also f5b6937 which manually removes the sirupsen/logrus vendored in promrus ... but I don't have a better solution. It's basically a manual implementation of what's proposed at Masterminds/glide#303

Otherwise it LGTM.

@marccarre
Copy link
Contributor Author

I'm trying to set up dep so that dependencies management becomes (hopefully) easier to manage and more standardised across Weaveworks projects.
I'll see how that goes, but dep init still had not returned after ~4 hours yesterday 😅.

@marccarre
Copy link
Contributor Author

Still no success with dep yesterday. I'll try a cleaner approach with gvt, i.e. use the latest versions of:

@marccarre
Copy link
Contributor Author

marccarre commented Oct 20, 2017

Next blocker: github.com/fsouza/go-dockerclient still uses docker and not moby.
This causes issues when trying a cleaner approach with gvt:

vendor/github.com/docker/docker/pkg/archive/archive.go:19:2: cannot find package "github.com/docker/docker/pkg/fileutils" in any of:
	/go/src/github.com/weaveworks/scope/vendor/github.com/docker/docker/vendor/github.com/docker/docker/pkg/fileutils (vendor tree)
	/go/src/github.com/weaveworks/scope/vendor/github.com/docker/docker/pkg/fileutils
	/usr/local/go/src/github.com/docker/docker/pkg/fileutils (from $GOROOT)
	/go/src/github.com/docker/docker/pkg/fileutils (from $GOPATH)
vendor/github.com/fsouza/go-dockerclient/client.go:35:2: cannot find package "github.com/docker/docker/pkg/stdcopy" in any of:
	/go/src/github.com/weaveworks/scope/vendor/github.com/docker/docker/pkg/stdcopy (vendor tree)
	/usr/local/go/src/github.com/docker/docker/pkg/stdcopy (from $GOROOT)
	/go/src/github.com/docker/docker/pkg/stdcopy (from $GOPATH)

Branch: lower-sirupsen-clean-approach-with-gvt

@rade rade changed the title Upgrade weaveworks/common and lower Sirupsen/logrus [WIP] Upgrade weaveworks/common and lower Sirupsen/logrus Oct 30, 2017
@marccarre marccarre closed this Feb 8, 2018
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.

4 participants