Skip to content

Commit

Permalink
Merge pull request #1670 from owncloud/update-go-micro-v3
Browse files Browse the repository at this point in the history
Update go micro v3
  • Loading branch information
butonic authored Feb 22, 2021
2 parents 64dd0ba + 89b06de commit aea5058
Show file tree
Hide file tree
Showing 96 changed files with 4,145 additions and 1,119 deletions.
2 changes: 1 addition & 1 deletion accounts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ $(GOPATH)/bin/protoc-gen-go:
go get -v google.golang.org/protobuf/cmd/[email protected]

$(GOPATH)/bin/protoc-gen-micro:
GO111MODULE=on go get -v github.com/micro/protoc-gen-micro/v2
GO111MODULE=on go get -v github.com/asim/go-micro/cmd/protoc-gen-micro/v3

$(GOPATH)/bin/protoc-gen-microweb:
GO111MODULE=off go get -v github.com/owncloud/protoc-gen-microweb
Expand Down
19 changes: 9 additions & 10 deletions accounts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@ require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
contrib.go.opencensus.io/exporter/ocagent v0.6.0
contrib.go.opencensus.io/exporter/zipkin v0.1.1
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/asim/go-micro/plugins/client/grpc/v3 v3.0.0-20210217182006-0f0ace1a44a9
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/cs3org/go-cs3apis v0.0.0-20210209082852-35ace33082f5
github.com/cs3org/reva v1.6.0
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-chi/render v1.0.1
github.com/gofrs/uuid v3.3.0+incompatible
github.com/golang/protobuf v1.4.3
github.com/huandu/xstrings v1.3.2 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.2.0
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/mennanov/fieldmask-utils v0.3.3
github.com/micro/cli/v2 v2.1.2
github.com/micro/go-micro/v2 v2.9.1
github.com/micro/protoc-gen-micro/v2 v2.1.1 // indirect
github.com/mitchellh/copystructure v1.1.1 // indirect
github.com/oklog/run v1.1.0
github.com/olekukonko/tablewriter v0.0.4
github.com/openzipkin/zipkin-go v0.2.2
Expand All @@ -33,19 +31,20 @@ require (
github.com/stretchr/testify v1.7.0
go.opencensus.io v0.22.6
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/mod v0.4.1 // indirect
golang.org/x/net v0.0.0-20210119194325-5f4716e94777
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
golang.org/x/text v0.3.5 // indirect
google.golang.org/genproto v0.0.0-20200624020401-64a14ca9d1ad
google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea
google.golang.org/grpc v1.35.0
google.golang.org/protobuf v1.25.0
gopkg.in/yaml.v2 v2.4.0 // indirect
honnef.co/go/tools v0.1.1 // indirect
)

replace (
github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg
github.com/owncloud/ocis/settings => ../settings
google.golang.org/grpc => google.golang.org/grpc v1.26.0
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
// latest version compatible with etcd
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)
267 changes: 214 additions & 53 deletions accounts/go.sum

Large diffs are not rendered by default.

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

"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
Expand Down
7 changes: 4 additions & 3 deletions accounts/pkg/command/inspect_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package command

import (
"fmt"
"os"
"strconv"

"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
tw "github.com/olekukonko/tablewriter"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"os"
"strconv"
)

// InspectAccount command shows detailed information about a specific account.
Expand Down
7 changes: 4 additions & 3 deletions accounts/pkg/command/list_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package command

import (
"fmt"
"os"
"strconv"

"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
tw "github.com/olekukonko/tablewriter"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"os"
"strconv"
)

// ListAccounts command lists all accounts
Expand Down
4 changes: 2 additions & 2 deletions accounts/pkg/command/rebuild_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"fmt"

"github.com/asim/go-micro/plugins/client/grpc/v3"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/owncloud/ocis/accounts/pkg/config"
index "github.com/owncloud/ocis/accounts/pkg/proto/v0"
)
Expand Down
5 changes: 3 additions & 2 deletions accounts/pkg/command/remove_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package command

import (
"fmt"
"os"

"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"os"
)

// RemoveAccount command deletes an existing account.
Expand Down
3 changes: 2 additions & 1 deletion accounts/pkg/command/update_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package command
import (
"errors"
"fmt"

"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/micro/go-micro/v2/client/grpc"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
Expand Down
2 changes: 1 addition & 1 deletion 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 "github.com/micro/go-micro/v2/client"
)

// MockAccountsService can be used to write tests
Expand Down
6 changes: 3 additions & 3 deletions accounts/pkg/proto/v0/accounts.pb.micro.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions accounts/pkg/proto/v0/accounts.pb.micro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"path/filepath"
"testing"

"github.com/asim/go-micro/v3/client"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/golang/protobuf/ptypes/empty"
"github.com/micro/go-micro/v2/client"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/owncloud/ocis/accounts/pkg/command"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
Expand Down
11 changes: 11 additions & 0 deletions accounts/pkg/proto/v0/accounts.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
"url": "https://github.com/owncloud/ocis/blob/master/LICENSE"
}
},
"tags": [
{
"name": "AccountsService"
},
{
"name": "GroupsService"
},
{
"name": "IndexService"
}
],
"schemes": [
"http",
"https"
Expand Down
10 changes: 3 additions & 7 deletions accounts/pkg/server/http/server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package http

import (
"github.com/asim/go-micro/v3"
"github.com/go-chi/chi"
"github.com/owncloud/ocis/accounts/pkg/assets"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
Expand Down Expand Up @@ -60,13 +61,8 @@ func Server(opts ...Option) http.Service {
proto.RegisterGroupsServiceWeb(r, handler)
})

service.Handle(
"/",
mux,
)
micro.RegisterHandler(service.Server(), mux)

if err := service.Init(); err != nil {
panic(err)
}
service.Init()
return service
}
9 changes: 5 additions & 4 deletions accounts/pkg/service/v0/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ import (
"crypto/sha256"
"encoding/hex"
"fmt"
"github.com/owncloud/ocis/ocis-pkg/sync"
"golang.org/x/crypto/bcrypt"
"path"
"regexp"
"strconv"
"time"

"github.com/owncloud/ocis/ocis-pkg/sync"
"golang.org/x/crypto/bcrypt"

"github.com/owncloud/ocis/ocis-pkg/log"

merrors "github.com/asim/go-micro/v3/errors"
"github.com/asim/go-micro/v3/metadata"
"github.com/gofrs/uuid"
p "github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/empty"
fieldmask_utils "github.com/mennanov/fieldmask-utils"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/micro/go-micro/v2/metadata"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/accounts/pkg/storage"
"github.com/owncloud/ocis/ocis-pkg/middleware"
Expand Down
6 changes: 3 additions & 3 deletions accounts/pkg/service/v0/accounts_permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"testing"
"time"

"github.com/asim/go-micro/v3/client"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/asim/go-micro/v3/metadata"
"github.com/golang/protobuf/ptypes/empty"
"github.com/micro/go-micro/v2/client"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/micro/go-micro/v2/metadata"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
olog "github.com/owncloud/ocis/ocis-pkg/log"
Expand Down
2 changes: 1 addition & 1 deletion accounts/pkg/service/v0/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"path"
"strconv"

merrors "github.com/asim/go-micro/v3/errors"
"github.com/gofrs/uuid"
p "github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/empty"
merrors "github.com/micro/go-micro/v2/errors"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/accounts/pkg/storage"
)
Expand Down
9 changes: 9 additions & 0 deletions changelog/unreleased/update-go-micro-to-0f0ace1a.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Enhancement: Update go-micro to v3.5.1-0.20210217182006-0f0ace1a44a9

- We updated from go micro v2 (v2.9.1) go-micro v3 (v3.5.1 edge).
- oCIS runtime is now aware of `MICRO_LOG_LEVEL` and is set to `error` by default. This decision was made because ownCloud, as framework builders, want to log everything oCIS related and hide everything unrelated by default. It can be re-enabled by setting it to a log level other than `error`. i.e: `MICRO_LOG_LEVEL=info`.
- Updated `protoc-gen-micro` to the [latest version](https://github.com/asim/go-micro/tree/master/cmd/protoc-gen-micro).
- We're using Prometheus wrappers from go-micro.

https://github.com/owncloud/ocis/pull/1670
https://github.com/asim/go-micro/pull/2126
8 changes: 6 additions & 2 deletions glauth/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ require (
contrib.go.opencensus.io/exporter/zipkin v0.1.2
github.com/GeertJohan/yubigo v0.0.0-20190917122436-175bc097e60e
github.com/UnnoTed/fileb0x v1.1.4
github.com/asim/go-micro/v3 v3.5.1-0.20210217182006-0f0ace1a44a9
github.com/glauth/glauth v1.1.3-0.20201110124627-fd3ac7e4bbdc
github.com/go-logr/logr v0.1.0
github.com/micro/cli/v2 v2.1.2
github.com/micro/go-micro/v2 v2.9.1
github.com/nmcclain/asn1-ber v0.0.0-20170104154839-2661553a0484
github.com/nmcclain/ldap v0.0.0-20191021200707-3b3b69a7e9e3
github.com/oklog/run v1.1.0
Expand All @@ -28,5 +28,9 @@ require (
replace (
github.com/owncloud/ocis/accounts => ../accounts
github.com/owncloud/ocis/ocis-pkg => ../ocis-pkg
google.golang.org/grpc => google.golang.org/grpc v1.26.0
// taken from https://github.com/asim/go-micro/blob/master/plugins/registry/etcd/go.mod#L14-L16
go.etcd.io/etcd/api/v3 => go.etcd.io/etcd/api/v3 v3.0.0-20210204162551-dae29bb719dd
go.etcd.io/etcd/pkg/v3 => go.etcd.io/etcd/pkg/v3 v3.0.0-20210204162551-dae29bb719dd
// latest version compatible with etcd
google.golang.org/grpc => google.golang.org/grpc v1.29.1
)
Loading

0 comments on commit aea5058

Please sign in to comment.