mikestefanello / pagoda

Rapid, easy full-stack web development starter kit in Go
MIT License
1.46k stars 95 forks source link

Can't update Go and deps cleanly #45

Closed mips171 closed 9 months ago

mips171 commented 11 months ago

Setting project to go 1.21 then running go get -u all we encounter breakage with pegasus and mergo

Updating mergo was fixed with these commands:

go mod edit -replace "github.com/imdario/mergo=github.com/imdario/mergo@v0.3.16"
go get -u all
go mod tidy

But when running it make run there's a compile error in XiaoMi/pegasus:

go run cmd/web/main.go
# github.com/XiaoMi/pegasus-go-client/idl/cmd
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:42:15: not enough arguments in call to iprot.ReadStructBegin
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:47:35: not enough arguments in call to iprot.ReadFieldBegin
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:61:26: not enough arguments in call to iprot.Skip
        have (thrift.TType)
        want (context.Context, thrift.TType)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:71:26: not enough arguments in call to iprot.Skip
        have (thrift.TType)
        want (context.Context, thrift.TType)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:76:25: not enough arguments in call to iprot.Skip
        have (thrift.TType)
        want (context.Context, thrift.TType)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:80:13: not enough arguments in call to iprot.ReadFieldEnd
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:84:12: not enough arguments in call to iprot.ReadStructEnd
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:91:15: not enough arguments in call to iprot.ReadString
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:100:18: not enough arguments in call to iprot.ReadListBegin
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:108:16: not enough arguments in call to iprot.ReadString
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/cmd/cmd.go:108:16: too many errors
# github.com/XiaoMi/pegasus-go-client/idl/base
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/base/blob.go:18:15: not enough arguments in call to iprot.ReadBinary
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/base/blob.go:27:27: not enough arguments in call to oprot.WriteBinary
        have ([]byte)
        want (context.Context, []byte)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/base/error_code.go:105:18: not enough arguments in call to iprot.ReadString
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/base/error_code.go:110:27: not enough arguments in call to oprot.WriteString
        have (string)
        want (context.Context, string)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/base/gpid.go:18:12: not enough arguments in call to iprot.ReadI64
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/base/gpid.go:30:24: not enough arguments in call to oprot.WriteI64
        have (int64)
        want (context.Context, int64)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/base/rpc_address.go:26:18: not enough arguments in call to iprot.ReadI64
        have ()
        want (context.Context)
../../go/pkg/mod/github.com/!xiao!mi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5/idl/base/rpc_address.go:35:24: not enough arguments in call to oprot.WriteI64
        have (int64)
        want (context.Context, int64)
make: *** [run] Error 1

I tried linking XiaoMi/pegasus to the apache hosted version but that did not work. Maybe I did something wrong

file: go.mod

replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16
replace github.com/apache/incubator-pegasus/tree/master/go-client => github.com/XiaoMi/pegasus-go-client v0.0.0-20220519103347-ba0e68465cd5

go mod graph:

github.com/mikestefanello/pagoda github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5
github.com/mikestefanello/pagoda github.com/pegasus-kv/thrift@v0.14.1
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 github.com/BurntSushi/toml@v0.3.1
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 github.com/agiledragon/gomonkey@v2.0.2+incompatible
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 github.com/cenkalti/backoff/v4@v4.1.0
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 github.com/fortytw2/leaktest@v1.3.0
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 github.com/pegasus-kv/thrift@v0.13.0
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 github.com/sirupsen/logrus@v1.4.2
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 github.com/stretchr/testify@v1.4.0
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 golang.org/x/net@v0.0.0-20191105084925-a882066a44e0
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 golang.org/x/sys@v0.0.0-20191010194322-b09406accb47
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 gopkg.in/natefinch/lumberjack.v2@v2.0.0
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 gopkg.in/tomb.v2@v2.0.0-20161208151619-d5d1b5820637
github.com/XiaoMi/pegasus-go-client@v0.0.0-20220519103347-ba0e68465cd5 k8s.io/apimachinery@v0.0.0-20191123233150-4c4803ed55e3
github.com/eko/gocache/v2@v2.3.1 github.com/XiaoMi/pegasus-go-client@v0.0.0-20210427083443-f3b6b08bc4c2
github.com/eko/gocache/v2@v2.3.1 github.com/pegasus-kv/thrift@v0.13.0
mips171 commented 11 months ago

Ah I see, we need to update to the latest version of gocache (now on v4), then update the usage in services/cache.go. I don't have time to work on this at the moment

mikestefanello commented 11 months ago

Is this still happening for you? It seems to be working fine for me.

gedw99 commented 9 months ago

I reproduced the bug.

The problem is the ent install.

If you git clone, then generate, then run its fine. If you git clone, then install ent, then generate and run it fails.

gedw99 commented 9 months ago

@mikestefanello

https://github.com/mikestefanello/pagoda/pull/48 is the PR.

https://github.com/mikestefanello/pagoda/actions/runs/6863169331 requires you to approve it so CI can run and presume test...

mikestefanello commented 9 months ago

Merged. Thanks again.