Skip to content

Commit

Permalink
Merge pull request #1707 from cloudwego/release-v0.12.2
Browse files Browse the repository at this point in the history
chore: release v0.12.2
  • Loading branch information
DMwangnima authored Feb 18, 2025
2 parents d6f3824 + 89ff9cf commit a53a472
Show file tree
Hide file tree
Showing 85 changed files with 1,800 additions and 1,130 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: crate-ci/typos@v1.13.14

golangci-lint:
runs-on: [ self-hosted, X64 ]
runs-on: [ Linux, X64 ]
steps:
- uses: actions/checkout@v4
- name: Set up Go
Expand All @@ -34,3 +34,4 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
version: latest
only-new-issues: true
58 changes: 46 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on: [ push, pull_request ]

jobs:
unit-scenario-test:
runs-on: [ self-hosted, X64 ]
runs-on: [ Linux, X64 ]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
go-version: "1.23"
cache: false
- name: Scenario Tests
run: |
Expand All @@ -20,6 +20,11 @@ jobs:
cd kitex-tests
./run.sh ${{github.workspace}}
cd ${{github.workspace}}
- name: Upload coverage to Codecov # coverage generated by run.sh
uses: codecov/codecov-action@v5
with:
flags: integration


benchmark-test:
runs-on: ubuntu-latest
Expand All @@ -28,18 +33,32 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
go-version: "1.23"
- name: Benchmark
# we only use this CI to verify bench code works
# setting benchtime=100ms is saving our time...
run: go test -bench=. -benchmem -run=none ./... -benchtime=100ms

compatibility-test:
unit-test-x64:
strategy:
matrix:
go: [ "1.18", "1.19", "1.20", "1.21", "1.22", "1.23" ]
runs-on: [ Linux, X64 ]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false # don't use cache for self-hosted runners
- name: Unit Test
run: go test -race ./...

unit-test-arm:
strategy:
matrix:
go: [ "1.18", "1.19", "1.20", "1.21", "1.22", "1.23" ]
os: [ X64, ARM64 ]
runs-on: ${{ matrix.os }}
runs-on: [ ARM64 ] # It's OK under Linux or macOS
steps:
- uses: actions/checkout@v4
- name: Set up Go
Expand All @@ -57,7 +76,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
go-version: "1.23"
- name: Prepare
run: |
go install github.com/cloudwego/thriftgo@main
Expand All @@ -80,15 +99,30 @@ jobs:
bash ./codegen_run.sh
windows-test:
runs-on: windows-latest
env: # Fixes https://github.com/actions/setup-go/issues/240
GOMODCACHE: 'D:\go\pkg\mod'
GOCACHE: 'D:\go\go-build'
runs-on: [ Windows ]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
go-version: "1.23"
cache: false # don't use cache for self-hosted runners
- name: Windows compatibility test
run: go test -run=^$ ./...

codecov:
needs: [ unit-scenario-test, unit-test-x64, unit-test-arm ]
runs-on: [ Linux, X64 ]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
cache: false # don't use cache for self-hosted runners
- name: Run coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
flags: unit
44 changes: 17 additions & 27 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Options for analysis running.
run:
# include `vendor` `third_party` `testdata` `examples` `Godeps` `builtin`
skip-dirs-use-default: true
skip-dirs:
- kitex_gen
skip-files:
- ".*\\.mock\\.go$"
# output configuration options
output:
# Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
format: colored-line-number
# All available settings of specific linters.
timeout: 3m

linters: # https://golangci-lint.run/usage/linters/
disable-all: true
enable:
- gosimple
- govet
- ineffassign
- staticcheck
- unused
- unconvert
- goimports
- gofumpt

# Refer to https://golangci-lint.run/usage/linters
linters-settings:
gofumpt:
Expand All @@ -21,21 +24,8 @@ linters-settings:
# Put imports beginning with prefix after 3rd-party packages.
# It's a comma-separated list of prefixes.
local-prefixes: github.com/cloudwego/kitex
govet:
# Disable analyzers by name.
# Run `go tool vet help` to see all analyzers.
disable:
- stdmethods
linters:
enable:
- gofumpt
- goimports
- gofmt
disable:
- errcheck
- typecheck
- deadcode
- varcheck
- staticcheck

issues:
exclude-use-default: true
exclude-dirs:
- kitex_gen
4 changes: 3 additions & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ func (kc *kClient) initStreamMiddlewares(ctx context.Context) {

func richMWsWithBuilder(ctx context.Context, mwBs []endpoint.MiddlewareBuilder) (mws []endpoint.Middleware) {
for i := range mwBs {
mws = append(mws, mwBs[i](ctx))
if mw := mwBs[i](ctx); mw != nil {
mws = append(mws, mw)
}
}
return
}
Expand Down
19 changes: 9 additions & 10 deletions client/genericclient/generic_stream_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ func StreamingServiceInfo(g generic.Generic) *serviceinfo.ServiceInfo {
}

func newClientStreamingServiceInfo(g generic.Generic) *serviceinfo.ServiceInfo {
readerWriter := g.MessageReaderWriter()
if readerWriter == nil {
if g.PayloadCodec() != nil {
// TODO: support grpc binary generic
panic("binary generic streaming is not supported")
}
Expand All @@ -37,12 +36,12 @@ func newClientStreamingServiceInfo(g generic.Generic) *serviceinfo.ServiceInfo {
nil,
func() interface{} {
args := &generic.Args{}
args.SetCodec(readerWriter)
args.SetCodec(g.MessageReaderWriter())
return args
},
func() interface{} {
result := &generic.Result{}
result.SetCodec(readerWriter)
result.SetCodec(g.MessageReaderWriter())
return result
},
false,
Expand All @@ -52,12 +51,12 @@ func newClientStreamingServiceInfo(g generic.Generic) *serviceinfo.ServiceInfo {
nil,
func() interface{} {
args := &generic.Args{}
args.SetCodec(readerWriter)
args.SetCodec(g.MessageReaderWriter())
return args
},
func() interface{} {
result := &generic.Result{}
result.SetCodec(readerWriter)
result.SetCodec(g.MessageReaderWriter())
return result
},
false,
Expand All @@ -67,12 +66,12 @@ func newClientStreamingServiceInfo(g generic.Generic) *serviceinfo.ServiceInfo {
nil,
func() interface{} {
args := &generic.Args{}
args.SetCodec(readerWriter)
args.SetCodec(g.MessageReaderWriter())
return args
},
func() interface{} {
result := &generic.Result{}
result.SetCodec(readerWriter)
result.SetCodec(g.MessageReaderWriter())
return result
},
false,
Expand All @@ -82,12 +81,12 @@ func newClientStreamingServiceInfo(g generic.Generic) *serviceinfo.ServiceInfo {
nil,
func() interface{} {
args := &generic.Args{}
args.SetCodec(readerWriter)
args.SetCodec(g.MessageReaderWriter())
return args
},
func() interface{} {
result := &generic.Result{}
result.SetCodec(readerWriter)
result.SetCodec(g.MessageReaderWriter())
return result
},
false,
Expand Down
2 changes: 2 additions & 0 deletions client/service_inline.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* limitations under the License.
*/

// Service inline is a service deployment form of ByteDance's internal applications.
// Different Kitex services are merged together during the compilation period through the tool chain, and this capability is not yet opensource.
package client

import (
Expand Down
13 changes: 6 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ go 1.18

require (
github.com/bytedance/gopkg v0.1.1
github.com/bytedance/sonic v1.12.5
github.com/bytedance/sonic v1.12.7
github.com/cloudwego/configmanager v0.2.2
github.com/cloudwego/dynamicgo v0.4.7-0.20241220085612-55704ea4ca8f
github.com/cloudwego/dynamicgo v0.5.2
github.com/cloudwego/fastpb v0.0.5
github.com/cloudwego/frugal v0.2.3
github.com/cloudwego/gopkg v0.1.3
github.com/cloudwego/localsession v0.1.1
github.com/cloudwego/gopkg v0.1.4-0.20241217093255-8980b14172b7
github.com/cloudwego/localsession v0.1.2
github.com/cloudwego/netpoll v0.6.5
github.com/cloudwego/runtimex v0.1.0
github.com/cloudwego/runtimex v0.1.1
github.com/cloudwego/thriftgo v0.3.18
github.com/golang/mock v1.6.0
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8
Expand All @@ -29,7 +29,7 @@ require (
)

require (
github.com/bytedance/sonic/loader v0.2.0 // indirect
github.com/bytedance/sonic/loader v0.2.2 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
Expand All @@ -39,7 +39,6 @@ require (
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
Expand Down
27 changes: 12 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/bytedance/gopkg v0.0.0-20230728082804-614d0af6619b/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ=
github.com/bytedance/gopkg v0.1.0/go.mod h1:FtQG3YbQG9L/91pbKSw787yBQPutC+457AvDW77fgUQ=
github.com/bytedance/gopkg v0.1.1 h1:3azzgSkiaw79u24a+w9arfH8OfnQQ4MHUt9lJFREEaE=
github.com/bytedance/gopkg v0.1.1/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
github.com/bytedance/sonic v1.12.5 h1:hoZxY8uW+mT+OpkcUWw4k0fDINtOcVavEsGfzwzFU/w=
github.com/bytedance/sonic v1.12.5/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk=
github.com/bytedance/sonic v1.12.7 h1:CQU8pxOy9HToxhndH0Kx/S1qU/CuS9GnKYrGioDcU1Q=
github.com/bytedance/sonic v1.12.7/go.mod h1:tnbal4mxOMju17EGfknm2XyYcpyCnIROYOEYuemj13I=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM=
github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/bytedance/sonic/loader v0.2.2 h1:jxAJuN9fOot/cyz5Q6dUuMJF5OqQ6+5GfA8FjjQ0R4o=
github.com/bytedance/sonic/loader v0.2.2/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y=
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
github.com/cloudwego/configmanager v0.2.2 h1:sVrJB8gWYTlPV2OS3wcgJSO9F2/9Zbkmcm1Z7jempOU=
github.com/cloudwego/configmanager v0.2.2/go.mod h1:ppiyU+5TPLonE8qMVi/pFQk2eL3Q4P7d4hbiNJn6jwI=
github.com/cloudwego/dynamicgo v0.4.7-0.20241220085612-55704ea4ca8f h1:IERXjxDg3Pbatb5z/dR8Qr8XUA1FpDVa73BnwbeQ76U=
github.com/cloudwego/dynamicgo v0.4.7-0.20241220085612-55704ea4ca8f/go.mod h1:DknfxjIMuGvXow409bS/AWycXONdc02HECBL0qpNqTY=
github.com/cloudwego/dynamicgo v0.5.2 h1:hw4AUvaQP49TOI6hqIhyDd4N1nbaKTH3vOOgiaEftyU=
github.com/cloudwego/dynamicgo v0.5.2/go.mod h1:DknfxjIMuGvXow409bS/AWycXONdc02HECBL0qpNqTY=
github.com/cloudwego/fastpb v0.0.5 h1:vYnBPsfbAtU5TVz5+f9UTlmSCixG9F9vRwaqE0mZPZU=
github.com/cloudwego/fastpb v0.0.5/go.mod h1:Bho7aAKBUtT9RPD2cNVkTdx4yQumfSv3If7wYnm1izk=
github.com/cloudwego/frugal v0.2.3 h1:t1hhhAi8lXcx7Ncs4PR1pSZ90vlDU1cy5K2btDMFpoA=
github.com/cloudwego/frugal v0.2.3/go.mod h1:nC1U47gswLRiaxv6dybrhZvsDGCfQP9RGiiWC73CnoI=
github.com/cloudwego/gopkg v0.1.3 h1:y9VA5Zn5yqd1+QBV9aB0Zxy56JlAS7x4ZUoED/vJdxA=
github.com/cloudwego/gopkg v0.1.3/go.mod h1:FQuXsRWRsSqJLsMVd5SYzp8/Z1y5gXKnVvRrWUOsCMI=
github.com/cloudwego/gopkg v0.1.4-0.20241217093255-8980b14172b7 h1:RmKES3lXoM62rUVEEy0teTsPYNBtFpqSN1lYBw4v82g=
github.com/cloudwego/gopkg v0.1.4-0.20241217093255-8980b14172b7/go.mod h1:FQuXsRWRsSqJLsMVd5SYzp8/Z1y5gXKnVvRrWUOsCMI=
github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
github.com/cloudwego/localsession v0.1.1 h1:tbK7laDVrYfFDXoBXo4uCGMAxU4qmz2dDm8d4BGBnDo=
github.com/cloudwego/localsession v0.1.1/go.mod h1:kiJxmvAcy4PLgKtEnPS5AXed3xCiXcs7Z+KBHP72Wv8=
github.com/cloudwego/localsession v0.1.2 h1:RBmeLDO5sKr4ujd8iBp5LTMmuVKLdu88jjIneq/fEZ8=
github.com/cloudwego/localsession v0.1.2/go.mod h1:J4uams2YT/2d4t7OI6A7NF7EcG8OlHJsOX2LdPbqoyc=
github.com/cloudwego/netpoll v0.6.5 h1:6E/BWhSzQoyLg9Kx/4xiMdIIpovzwBtXvuqSqaTUzDQ=
github.com/cloudwego/netpoll v0.6.5/go.mod h1:BtM+GjKTdwKoC8IOzD08/+8eEn2gYoiNLipFca6BVXQ=
github.com/cloudwego/runtimex v0.1.0 h1:HG+WxWoj5/CDChDZ7D99ROwvSMkuNXAqt6hnhTTZDiI=
github.com/cloudwego/runtimex v0.1.0/go.mod h1:23vL/HGV0W8nSCHbe084AgEBdDV4rvXenEUMnUNvUd8=
github.com/cloudwego/runtimex v0.1.1 h1:lheZjFOyKpsq8TsGGfmX9/4O7F0TKpWmB8on83k7GE8=
github.com/cloudwego/runtimex v0.1.1/go.mod h1:23vL/HGV0W8nSCHbe084AgEBdDV4rvXenEUMnUNvUd8=
github.com/cloudwego/thriftgo v0.3.18 h1:gnr1vz7G3RbwwCK9AMKHZf63VYGa7ene6WbI9VrBJSw=
github.com/cloudwego/thriftgo v0.3.18/go.mod h1:AdLEJJVGW/ZJYvkkYAZf5SaJH+pA3OyC801WSwqcBwI=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
Expand Down Expand Up @@ -95,8 +94,6 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5 h1:uiS4zKYKJVj5F3ID+5iylfKPsEQmBEOucSD9Vgmn0i0=
github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5/go.mod h1:I8AX+yW//L8Hshx6+a1m3bYkwXkpsVjA2795vP4f4oQ=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso=
Expand Down
Loading

0 comments on commit a53a472

Please sign in to comment.