Skip to content

Commit

Permalink
replace dep with go modules (#16017)
Browse files Browse the repository at this point in the history
- guide shamelessly stolen from prometheus/prometheus
- updates local interface of oauth exchange
- updates local impl of hclogger
- bump jaeger client version

closes #16088
  • Loading branch information
bergquist authored Apr 16, 2019
1 parent d6b48ee commit 68f5ddf
Show file tree
Hide file tree
Showing 944 changed files with 195,337 additions and 150,989 deletions.
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,31 @@ Closes #12864
```

If the pull request needs changes before its merged the new commits should be rebased into one commit before its merged.

## Backend dependency management

The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater installed.

All dependencies are vendored in the `vendor/` directory.

To add or update a new dependency, use the `go get` command:

```bash
# Pick the latest tagged release.
go get example.com/some/module/pkg

# Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z
```

Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory:


```bash
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
GO111MODULE=on go mod tidy

GO111MODULE=on go mod vendor
```

You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ deps: deps-js

build-go:
@echo "build go files"
go run build.go build
GO111MODULE=on go run build.go build

build-server:
@echo "build server"
go run build.go build-server
GO111MODULE=on go run build.go build-server

build-cli:
@echo "build in CI environment"
go run build.go build-cli
GO111MODULE=on go run build.go build-cli

build-js:
@echo "build frontend"
Expand All @@ -32,7 +32,7 @@ build: build-go build-js
build-docker-dev:
@echo "build development container"
@echo "\033[92mInfo:\033[0m the frontend code is expected to be built already."
go run build.go -goos linux -pkg-arch amd64 ${OPT} build pkg-archive latest
GO111MODULE=on go run build.go -goos linux -pkg-arch amd64 ${OPT} build pkg-archive latest
cp dist/grafana-latest.linux-x64.tar.gz packaging/docker
cd packaging/docker && docker build --tag grafana/grafana:dev .

Expand All @@ -46,7 +46,7 @@ lint-go:

test-go:
@echo "test backend"
go test -v ./pkg/...
GO111MODULE=on go test -v ./pkg/...

test-js:
@echo "test frontend"
Expand Down
1 change: 0 additions & 1 deletion build.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ func gruntBuildArg(task string) []string {
}

func setup() {
runPrint("go", "get", "-v", "github.com/golang/dep")
runPrint("go", "install", "-v", "./pkg/cmd/grafana-server")
}

Expand Down
82 changes: 82 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
module github.com/grafana/grafana

go 1.12

require (
github.com/BurntSushi/toml v0.3.1
github.com/Unknwon/com v0.0.0-20190214221849-2d12a219ccaf
github.com/VividCortex/mysqlerr v0.0.0-20170204212430-6c6b55f8796f
github.com/aws/aws-sdk-go v1.18.5
github.com/benbjohnson/clock v0.0.0-20161215174838-7dc76406b6d3
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect
github.com/codegangsta/cli v1.20.0
github.com/davecgh/go-spew v1.1.1
github.com/denisenkom/go-mssqldb v0.0.0-20190315220205-a8ed825ac853
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 // indirect
github.com/facebookgo/inject v0.0.0-20180706035515-f23751cae28b
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
github.com/facebookgo/structtag v0.0.0-20150214074306-217e25fb9691 // indirect
github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 // indirect
github.com/fatih/color v1.7.0
github.com/go-macaron/binding v0.0.0-20170611065819-ac54ee249c27
github.com/go-macaron/gzip v0.0.0-20160222043647-cad1c6580a07
github.com/go-macaron/inject v0.0.0-20160627170012-d8a0b8677191 // indirect
github.com/go-macaron/session v0.0.0-20190131233854-0a0a789bf193
github.com/go-sql-driver/mysql v1.4.1
github.com/go-stack/stack v1.8.0
github.com/go-xorm/core v0.6.2
github.com/go-xorm/xorm v0.7.1
github.com/google/go-cmp v0.2.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190411002643-bd77b112433e // indirect
github.com/gorilla/websocket v1.4.0
github.com/gosimple/slug v1.4.2
github.com/grafana/grafana-plugin-model v0.0.0-20180518082423-84176c64269d
github.com/hashicorp/go-hclog v0.8.0
github.com/hashicorp/go-plugin v0.0.0-20190220160451-3f118e8ee104
github.com/hashicorp/go-version v1.1.0
github.com/inconshreveable/log15 v0.0.0-20180818164646-67afb5ed74ec
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/klauspost/compress v1.4.1 // indirect
github.com/klauspost/cpuid v1.2.0 // indirect
github.com/lib/pq v1.0.0
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.7
github.com/mattn/go-sqlite3 v1.10.0
github.com/onsi/ginkgo v1.8.0 // indirect
github.com/onsi/gomega v1.5.0 // indirect
github.com/opentracing/opentracing-go v1.1.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.9.2
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
github.com/prometheus/common v0.2.0
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/smartystreets/assertions v0.0.0-20190401211740-f487f9de1cd3 // indirect
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
github.com/uber-go/atomic v1.3.2 // indirect
github.com/uber/jaeger-client-go v2.16.0+incompatible
github.com/uber/jaeger-lib v2.0.0+incompatible // indirect
github.com/yudai/gojsondiff v1.0.0
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
go.uber.org/atomic v1.3.2 // indirect
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a // indirect
golang.org/x/net v0.0.0-20190415100556-4a65cf94b679
golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
golang.org/x/sys v0.0.0-20190415081028-16da32be82c5 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/bufio.v1 v1.0.0-20140618132640-567b2bfa514e // indirect
gopkg.in/ini.v1 v1.42.0
gopkg.in/ldap.v3 v3.0.2
gopkg.in/macaron.v1 v1.3.2
gopkg.in/mail.v2 v2.3.1
gopkg.in/redis.v2 v2.3.2
gopkg.in/square/go-jose.v2 v2.3.0
gopkg.in/yaml.v2 v2.2.2
)
Loading

0 comments on commit 68f5ddf

Please sign in to comment.