Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update go micro v3 #1670

Merged
merged 33 commits into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
88f670b
initial commit
refs Feb 16, 2021
83851ca
return micro.Service()
butonic Feb 16, 2021
005f47d
update accounts, settings, storage-metadata and ocis-pkg to use asim …
refs Feb 17, 2021
af33d62
update glauth to use go-micro v3
refs Feb 17, 2021
9b9f470
update graph to use go-micro v3
refs Feb 17, 2021
656d034
update graph-explorer to use go-micro v3
refs Feb 17, 2021
f851b91
update idp to use go-micro v3
refs Feb 17, 2021
b167dc8
update ocs + store to use go-micro v3
refs Feb 17, 2021
75c3b7d
update store to use go-micro v3
refs Feb 17, 2021
a1d5e34
update proxy to use go-micro v3
refs Feb 17, 2021
b4115bb
update settings to use go-micro v3
refs Feb 17, 2021
d19cc34
update settings to use go-micro v3
refs Feb 17, 2021
6644f5b
update thumbnails to use go-micro v3
refs Feb 17, 2021
54c4331
update web to use go-micro v3
refs Feb 17, 2021
7e505fb
remove any micro v2 occurences from the project
refs Feb 17, 2021
072d070
wip
refs Feb 17, 2021
448bdde
use http replace
refs Feb 17, 2021
b89deea
remove redundant transport
refs Feb 17, 2021
603dad3
bring back etcd registry
butonic Feb 17, 2021
588ac4a
get rid of http server option.Hander
butonic Feb 17, 2021
57aec02
tidy everything
butonic Feb 17, 2021
63416c3
update proto-gen-micro, regenerate protobuf, mod tidy all
butonic Feb 17, 2021
34a9fb2
remove unneeded getTranstport
butonic Feb 17, 2021
c293955
rebase and tidy
butonic Feb 18, 2021
2ece67f
changelog
butonic Feb 18, 2021
8d3562d
add missing files
butonic Feb 18, 2021
13f6def
use upstream prometheus logger
butonic Feb 18, 2021
11ed5e4
same order of options in grpc and http service
butonic Feb 18, 2021
d9f4a4c
always pass in a client
butonic Feb 18, 2021
1daad02
set MICRO_LOG_LEVEL to error if not defined
refs Feb 18, 2021
7736d26
update readme
refs Feb 18, 2021
d458593
reuse the default client
butonic Feb 18, 2021
89b06de
use ocis grpc client for thumbnails
butonic Feb 18, 2021
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
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