Skip to content

Commit

Permalink
Switch to Go 1.12 & replace dep by go mod (#868)
Browse files Browse the repository at this point in the history
* Switch to Go 1.11 & replace dep by go mod

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>

* Use Go 1.12

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>

* Add a few lines about go mod in CONTRIBUTING.md

Shamelessly copied from https://github.com/prometheus/prometheus/blob/master/CONTRIBUTING.md#dependency-management

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>

* feat: add a vendoring check

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>

* fix: specify the need for git & bzr to be installed

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>

* Remove unneeded go mod vendor

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>

* Fix formatting

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>

* Check that git and bzr are present

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>

* Add bzr download link

Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
  • Loading branch information
sylr authored and domgreen committed Mar 7, 2019
1 parent 5c899a0 commit b4d233e
Show file tree
Hide file tree
Showing 24 changed files with 675 additions and 1,867 deletions.
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ jobs:
test:
docker:
# Available from https://hub.docker.com/r/circleci/golang/
- image: circleci/golang:1.10
- image: circleci/golang:1.12
working_directory: /go/src/github.com/improbable-eng/thanos
environment:
GO111MODULE: 'on'
steps:
- checkout
- setup_remote_docker:
Expand All @@ -19,7 +21,7 @@ jobs:
echo $GOOGLE_APPLICATION_CREDENTIALS_CONTENT > /go/src/github.com/improbable-eng/thanos/circleci-gcs-creds.json
echo "Awesome! GCS integration tests are enabled."
fi
- run: make deps DEPARGS="-v"
- run: make check-go-mod
- run: make errcheck
- run: make check-docs
- run: make format
Expand Down
2 changes: 1 addition & 1 deletion .errcheck_excludes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(github.com/improbable-eng/thanos/vendor/github.com/go-kit/kit/log.Logger).Log
(github.com/go-kit/kit/log.Logger).Log
fmt.Fprintln
fmt.Fprint
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/prometheus
/thanos
vendor/
.dep-finished
/.vendor-new

# Ignore minikube setup working dirs.
kube/bin
Expand Down
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,27 @@ CI runs GCS and inmem tests only for now. Not having these variables will produc
7. You may merge the Pull Request in once you have the sign-off of at least one developers with write access, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.
8. If you feel like your PR waits too long for a review, feel free to ping [`#thanos-dev`](https://join.slack.com/t/improbable-eng/shared_invite/enQtMzQ1ODcyMzQ5MjM4LWY5ZWZmNGM2ODc5MmViNmQ3ZTA3ZTY3NzQwOTBlMTkzZmIxZTIxODk0OWU3YjZhNWVlNDU3MDlkZGViZjhkMjc) channel on our slack for review!

## Dependency management

The Thanos 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, git and [bzr](http://wiki.bazaar.canonical.com/Download) installed.

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:

```bash
make go-mod-tidy
git add go.mod go.sum
git commit
```

You have to commit the changes to `go.mod` and `go.sum` before submitting the pull request.
2 changes: 1 addition & 1 deletion Dockerfile.multi-stage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.11-alpine3.9 as builder
FROM golang:1.12-alpine3.9 as builder

ADD . $GOPATH/src/github.com/improbable-eng/thanos
WORKDIR $GOPATH/src/github.com/improbable-eng/thanos
Expand Down
Loading

0 comments on commit b4d233e

Please sign in to comment.