Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

[PoC] migrate to go module, alternative #33

Closed
wants to merge 3 commits into from
Closed
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
664 changes: 0 additions & 664 deletions Gopkg.lock

This file was deleted.

77 changes: 0 additions & 77 deletions Gopkg.toml

This file was deleted.

6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
export GO111MODULE=off
export REPOSITORY=flyteidl
include boilerplate/lyft/golang_test_targets/Makefile

Expand All @@ -9,17 +8,16 @@ update_boilerplate:

.PHONY: generate
generate: # generate protos, mocks and pflags
dep ensure -vendor-only
go mod download
./generate_protos.sh
./generate_mocks.sh
go generate ./...

.PHONY: test
test: # ensures generate_protos script has been run
make install
which pflags || (cd boilerplate/lyft/golang_support_tools && go install github.com/lyft/flytestdlib/cli/pflags && cd -)
git diff
go get github.com/lyft/flytestdlib/cli/pflags
dep ensure -vendor-only
./generate_mocks.sh
go generate ./...
DELTA_CHECK=true ./generate_protos.sh
Expand Down
12 changes: 12 additions & 0 deletions boilerplate/lyft/golang_support_tools/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/lyft/flyteidl

go 1.13

require (
github.com/golangci/golangci-lint v1.22.2
github.com/lyft/flytestdlib v0.2.31
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5

)

replace github.com/vektra/mockery => github.com/enghabu/mockery v0.0.0-20191009061720-9d0c8670c2f0
554 changes: 554 additions & 0 deletions boilerplate/lyft/golang_support_tools/go.sum

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions boilerplate/lyft/golang_support_tools/tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// +build tools

package tools

import (
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/lyft/flytestdlib/cli/pflags"
_ "github.com/vektra/mockery/cmd/mockery"
)
6 changes: 3 additions & 3 deletions boilerplate/lyft/golang_test_targets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ DEP_SHA=1f7c19e5f52f49ffb9f956f64c010be14683468b

.PHONY: lint
lint: #lints the package for common code smells
which golangci-lint || GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint
# install outside of current module, workaround https://github.com/golang/go/issues/30515
which golangci-lint || (cd boilerplate/lyft/golang_support_tools && go install github.com/golangci/golangci-lint/cmd/golangci-lint && cd -)
golangci-lint run --exclude deprecated

# If code is failing goimports linter, this will fix.
Expand All @@ -18,8 +19,7 @@ goimports:

.PHONY: install
install: #download dependencies (including test deps) for the package
which dep || (curl "https://raw.githubusercontent.com/golang/dep/${DEP_SHA}/install.sh" | sh)
dep ensure
go mod download

.PHONY: test_unit
test_unit:
Expand Down
4 changes: 2 additions & 2 deletions boilerplate/lyft/golang_test_targets/Readme.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Golang Test Targets
~~~~~~~~~~~~~~~~~~~

Provides an ``install`` make target that uses ``dep`` install golang dependencies.
Provides an ``install`` make target that uses ``go mod`` install golang dependencies.

Provides a ``lint`` make target that uses golangci to lint your code.

Expand All @@ -17,7 +17,7 @@ Provides a ``test_benchmark`` target for benchmark tests.

Add ``lyft/golang_test_targets`` to your ``boilerplate/update.cfg`` file.

Make sure you're using ``dep`` for dependency management.
Make sure you're using ``go mod`` for dependency management.

Provide a ``.golangci`` configuration (the lint target requires it).

Expand Down
3 changes: 2 additions & 1 deletion generate_mocks.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
set -e
set -x
which mockery || (go install github.com/lyft/flyteidl/vendor/github.com/vektra/mockery/cmd/mockery)

which mockery || (cd boilerplate/lyft/golang_support_tools && go install github.com/vektra/mockery/cmd/mockery && cd -)

mockery -dir=gen/pb-go/flyteidl/service/ -name=AdminServiceClient -output=clients/go/admin/mocks
mockery -dir=gen/pb-go/flyteidl/datacatalog/ -name=ArtifactsClient -output=clients/go/datacatalog/mocks
29 changes: 29 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module github.com/lyft/flyteidl

go 1.13

require (
github.com/antihax/optional v1.0.0
github.com/coreos/go-oidc v2.1.0+incompatible
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/protobuf v1.3.2
github.com/grpc-ecosystem/go-grpc-middleware v1.1.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway v1.11.3
github.com/influxdata/influxdb v1.7.9
github.com/lyft/flytestdlib v0.2.31
github.com/mitchellh/mapstructure v1.1.2
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.4.0
golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271 // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sys v0.0.0-20191028164358-195ce5e7f934 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0
google.golang.org/genproto v0.0.0-20191028173616-919d9bdd9fe6
google.golang.org/grpc v1.24.0
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/square/go-jose.v2 v2.4.1 // indirect
k8s.io/api v0.0.0-20191025225708-5524a3672fbb
k8s.io/client-go v0.0.0-20191016111102-bec269661e48 // indirect
)
Loading