Skip to content

Commit

Permalink
Merge pull request #2616 from owncloud/go-micro-v4
Browse files Browse the repository at this point in the history
upgrade to go micro v4.1.0
  • Loading branch information
wkloucek authored Oct 18, 2021
2 parents c755365 + 2b145d7 commit 1494e69
Show file tree
Hide file tree
Showing 68 changed files with 349 additions and 2,118 deletions.
6 changes: 3 additions & 3 deletions .bingo/Variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ $(PROTOC_GEN_GO): $(BINGO_DIR)/protoc-gen-go.mod
@echo "(re)installing $(GOBIN)/protoc-gen-go-v1.27.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-go.mod -o=$(GOBIN)/protoc-gen-go-v1.27.1 "google.golang.org/protobuf/cmd/protoc-gen-go"

PROTOC_GEN_MICRO := $(GOBIN)/protoc-gen-micro-v3.0.0-20210924081004-8c39b1e1204d
PROTOC_GEN_MICRO := $(GOBIN)/protoc-gen-micro-v3.0.0-20211012122208-f63e46a7d1e9
$(PROTOC_GEN_MICRO): $(BINGO_DIR)/protoc-gen-micro.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-micro-v3.0.0-20210924081004-8c39b1e1204d"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-micro.mod -o=$(GOBIN)/protoc-gen-micro-v3.0.0-20210924081004-8c39b1e1204d "github.com/asim/go-micro/cmd/protoc-gen-micro/v3"
@echo "(re)installing $(GOBIN)/protoc-gen-micro-v3.0.0-20211012122208-f63e46a7d1e9"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-micro.mod -o=$(GOBIN)/protoc-gen-micro-v3.0.0-20211012122208-f63e46a7d1e9 "github.com/asim/go-micro/cmd/protoc-gen-micro/v3"

PROTOC_GEN_MICROWEB := $(GOBIN)/protoc-gen-microweb-v0.0.0-20210824101557-828409dbfbf9
$(PROTOC_GEN_MICROWEB): $(BINGO_DIR)/protoc-gen-microweb.mod
Expand Down
2 changes: 1 addition & 1 deletion .bingo/protoc-gen-micro.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT

go 1.17

require github.com/asim/go-micro/cmd/protoc-gen-micro/v3 v3.0.0-20210924081004-8c39b1e1204d
require github.com/asim/go-micro/cmd/protoc-gen-micro/v3 v3.0.0-20211012122208-f63e46a7d1e9
2 changes: 1 addition & 1 deletion .bingo/variables.env
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PROTOC_GEN_DOC="${GOBIN}/protoc-gen-doc-v1.5.0"

PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.27.1"

PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v3.0.0-20210924081004-8c39b1e1204d"
PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v3.0.0-20211012122208-f63e46a7d1e9"

PROTOC_GEN_MICROWEB="${GOBIN}/protoc-gen-microweb-v0.0.0-20210824101557-828409dbfbf9"

Expand Down
4 changes: 2 additions & 2 deletions .make/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ fmt:

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E golint -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME)
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E revive -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME)

.PHONY: ci-golangci-lint
ci-golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E golint -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME) --timeout 10m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E revive -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME) --timeout 10m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml

.PHONY: test
test:
Expand Down
37 changes: 27 additions & 10 deletions .make/protobuf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,76 @@ protoc-gen-openapiv2:
GO111MODULE=off go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2


.PHONY: protocolbuffers-protobuf
protocolbuffers-protobuf:
GO111MODULE=off go get -v github.com/protocolbuffers/protobuf || true

.PHONY: googleapis-protobuf
googleapis-protobuf:
GO111MODULE=off go get -v github.com/googleapis/googleapis || true

.PHONY: gen-deps
gen-deps: protoc-gen-openapiv2 protocolbuffers-protobuf googleapis-protobuf


.PHONY: $(PROTO_SRC)/${NAME}.pb.go
$(PROTO_SRC)/${NAME}.pb.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_GO)
$(PROTO_SRC)/${NAME}.pb.go: $(BUF) gen-deps $(PROTOC_GEN_GO)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/protocolbuffers/protobuf/src \
-I=$(GOPATH)/src/github.com/googleapis/googleapis \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-go=$(PROTOC_GEN_GO) \
--go_out=$(PROTO_SRC) \
--go_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto

.PHONY: $(PROTO_SRC)/${NAME}.pb.micro.go
$(PROTO_SRC)/${NAME}.pb.micro.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_MICRO)
$(PROTO_SRC)/${NAME}.pb.micro.go: $(BUF) gen-deps $(PROTOC_GEN_MICRO)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.micro.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/protocolbuffers/protobuf/src \
-I=$(GOPATH)/src/github.com/googleapis/googleapis \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-micro=$(PROTOC_GEN_MICRO) \
--micro_out=logtostderr=true:$(PROTO_SRC) \
--micro_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto

.PHONY: $(PROTO_SRC)/${NAME}.pb.web.go
$(PROTO_SRC)/${NAME}.pb.web.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_MICROWEB)
$(PROTO_SRC)/${NAME}.pb.web.go: $(BUF) gen-deps $(PROTOC_GEN_MICROWEB)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.web.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/protocolbuffers/protobuf/src \
-I=$(GOPATH)/src/github.com/googleapis/googleapis \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-microweb=$(PROTOC_GEN_MICROWEB) \
--microweb_out=logtostderr=true:$(PROTO_SRC) \
--microweb_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto

.PHONY: $(PROTO_SRC)/${NAME}.swagger.json
$(PROTO_SRC)/${NAME}.swagger.json: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_OPENAPIV2)
$(PROTO_SRC)/${NAME}.swagger.json: $(BUF) gen-deps $(PROTOC_GEN_OPENAPIV2)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.swagger.json"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/protocolbuffers/protobuf/src \
-I=$(GOPATH)/src/github.com/googleapis/googleapis \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-openapiv2=$(PROTOC_GEN_OPENAPIV2) \
--openapiv2_out=logtostderr=true:$(PROTO_SRC)/ \
$(PROTO_SRC)/${NAME}.proto

.PHONY: ../docs/extensions/${NAME}/grpc.md
../docs/extensions/${NAME}/grpc.md: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_DOC)
../docs/extensions/${NAME}/grpc.md: $(BUF) gen-deps $(PROTOC_GEN_DOC)
@echo "$(NAME): generating ../docs/extensions/${NAME}/grpc.md"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/protocolbuffers/protobuf/src \
-I=$(GOPATH)/src/github.com/googleapis/googleapis \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-doc=$(PROTOC_GEN_DOC) \
--doc_opt=./templates/GRPC.tmpl,grpc.md \
Expand Down
6 changes: 3 additions & 3 deletions accounts/pkg/assets/embed.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion accounts/pkg/command/rebuild_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"fmt"

"github.com/asim/go-micro/plugins/client/grpc/v3"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/owncloud/ocis/accounts/pkg/config"
index "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/urfave/cli/v2"
merrors "go-micro.dev/v4/errors"
)

// RebuildIndex rebuilds the entire configured index.
Expand Down
4 changes: 2 additions & 2 deletions accounts/pkg/proto/v0/accounts.mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package proto
import (
context "context"

client "github.com/asim/go-micro/v3/client"
empty "github.com/golang/protobuf/ptypes/empty"
client "go-micro.dev/v4/client"
empty "google.golang.org/protobuf/types/known/emptypb"
)

// MockAccountsService can be used to write tests
Expand Down
Loading

0 comments on commit 1494e69

Please sign in to comment.