Skip to content

Commit 73ef782

Browse files
authored
Merge pull request #1533 from cloudwego/release-v0.11.0
chore: release v0.11.0
2 parents d4e163a + 1d26ba8 commit 73ef782

File tree

246 files changed

+11746
-21861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

246 files changed

+11746
-21861
lines changed

.codecov.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/pr-check.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,15 @@ jobs:
1919
staticcheck:
2020
runs-on: [ self-hosted, X64 ]
2121
steps:
22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323
- name: Set up Go
24-
uses: actions/setup-go@v3
25-
with:
26-
go-version: 1.19
27-
28-
- uses: actions/cache@v3
24+
uses: actions/setup-go@v5
2925
with:
30-
path: ~/go/pkg/mod
31-
key: reviewdog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
32-
restore-keys: |
33-
reviewdog-${{ runner.os }}-go-
26+
go-version: stable
27+
# For self-hosted, the cache path is shared across projects
28+
# and it works well without the cache of github actions
29+
# Enable it if we're going to use Github only
30+
cache: false
3431

3532
- uses: reviewdog/action-staticcheck@v1
3633
with:
@@ -39,22 +36,26 @@ jobs:
3936
reporter: github-pr-review
4037
# Report all results.
4138
filter_mode: nofilter
42-
# Exit with 1 when it find at least one finding.
39+
# Exit with 1 when it finds at least one finding.
4340
fail_on_error: true
4441
# Set staticcheck flags
4542
staticcheck_flags: -checks=inherit,-SA1029
4643

4744
lint:
4845
runs-on: [ self-hosted, X64 ]
4946
steps:
50-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
5148
- name: Set up Go
52-
uses: actions/setup-go@v3
49+
uses: actions/setup-go@v5
5350
with:
54-
go-version: 1.19
51+
go-version: stable
52+
# for self-hosted, the cache path is shared across projects
53+
# and it works well without the cache of github actions
54+
# Enable it if we're going to use Github only
55+
cache: false
5556

5657
- name: Golangci Lint
5758
# https://golangci-lint.run/
58-
uses: golangci/golangci-lint-action@v3
59+
uses: golangci/golangci-lint-action@v6
5960
with:
6061
version: latest

.github/workflows/tests.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ jobs:
66
unit-scenario-test:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
9+
- uses: actions/checkout@v4
1010
- name: Set up Go
11-
uses: actions/setup-go@v3
11+
uses: actions/setup-go@v5
1212
with:
13-
go-version: '1.20'
14-
- name: Unit Test
15-
run: go test -gcflags=-l -race -covermode=atomic -coverprofile=coverage.txt ./...
13+
go-version: '1.21'
1614
- name: Scenario Tests
1715
run: |
1816
cd ..
@@ -21,43 +19,44 @@ jobs:
2119
cd kitex-tests
2220
./run.sh ${{github.workspace}}
2321
cd ${{github.workspace}}
24-
- name: Codecov
25-
run: bash <(curl -s https://codecov.io/bash)
2622
2723
benchmark-test:
2824
runs-on: ubuntu-latest
2925
steps:
30-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
3127
- name: Set up Go
32-
uses: actions/setup-go@v3
28+
uses: actions/setup-go@v5
3329
with:
34-
go-version: '1.18'
30+
go-version: stable
3531
- name: Benchmark
36-
run: go test -gcflags='all=-N -l' -bench=. -benchmem -run=none ./...
32+
# we only use this CI to verify bench code works
33+
# setting benchtime=100ms is saving our time...
34+
run: go test -bench=. -benchmem -run=none ./... -benchtime=100ms
3735

3836
compatibility-test:
3937
strategy:
4038
matrix:
41-
go: [ 1.17, 1.18, 1.19.12, 1.20.7, 1.21, 1.22 ]
39+
go: [ "1.18", "1.19", "1.20", "1.21", "1.22", "1.23" ]
4240
os: [ X64, ARM64 ]
4341
runs-on: ${{ matrix.os }}
4442
steps:
45-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4644
- name: Set up Go
47-
uses: actions/setup-go@v3
45+
uses: actions/setup-go@v5
4846
with:
4947
go-version: ${{ matrix.go }}
48+
cache: false # don't use cache for self-hosted runners
5049
- name: Unit Test
51-
run: go test -gcflags=-l -race -covermode=atomic ./...
50+
run: go test -race -covermode=atomic ./...
5251

5352
codegen-test:
5453
runs-on: ubuntu-latest
5554
steps:
56-
- uses: actions/checkout@v3
55+
- uses: actions/checkout@v4
5756
- name: Set up Go
58-
uses: actions/setup-go@v3
57+
uses: actions/setup-go@v5
5958
with:
60-
go-version: '1.19'
59+
go-version: stable
6160
- name: Prepare
6261
run: |
6362
go install github.com/cloudwego/thriftgo@main
@@ -81,10 +80,10 @@ jobs:
8180
windows-test:
8281
runs-on: windows-latest
8382
steps:
84-
- uses: actions/checkout@v3
83+
- uses: actions/checkout@v4
8584
- name: Set up Go
86-
uses: actions/setup-go@v3
85+
uses: actions/setup-go@v5
8786
with:
88-
go-version: "1.20"
87+
go-version: stable
8988
- name: Windows compatibility test
9089
run: go test -run=^$ ./...

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ tool/cmd/kitex/kitex
5252
base1.go
5353
dump.txt
5454
base2.go
55+
56+
# Go workspace file
57+
go.work
58+
go.work.sum

.licenserc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ header:
2323
- pkg/remote/trans/nphttp2/grpc/http2_server.go
2424
- pkg/remote/trans/nphttp2/grpc/http_util.go
2525
- pkg/remote/trans/nphttp2/grpc/keepalive.go
26+
- pkg/remote/trans/nphttp2/grpc/keepalive_test.go
2627
- pkg/remote/trans/nphttp2/grpc/transport.go
28+
- pkg/remote/trans/nphttp2/grpc/transport_test.go
2729
- pkg/remote/trans/nphttp2/metadata/metadata.go
2830
- pkg/remote/trans/nphttp2/status/status.go
2931
- pkg/remote/codec/protobuf/error.pb.go

CREDITS

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ English | [中文](README_cn.md)
1010
[![ClosedIssue](https://img.shields.io/github/issues-closed/cloudwego/kitex)](https://github.com/cloudwego/kitex/issues?q=is%3Aissue+is%3Aclosed)
1111
![Stars](https://img.shields.io/github/stars/cloudwego/kitex)
1212
![Forks](https://img.shields.io/github/forks/cloudwego/kitex)
13-
[![Slack](https://img.shields.io/badge/slack-join_chat-success.svg?logo=slack)](https://cloudwego.slack.com/join/shared_invite/zt-tmcbzewn-UjXMF3ZQsPhl7W3tEDZboA)
1413

15-
Kitex [kaɪt'eks] is a **high-performance** and **strong-extensibility** Golang RPC framework that helps developers build microservices. If the performance and extensibility are the main concerns when you develop microservices, Kitex can be a good choice.
14+
Kitex [kaɪt'eks] is a **high-performance** and **strong-extensibility** Go RPC framework that helps developers build microservices. If the performance and extensibility are the main concerns when you develop microservices, Kitex can be a good choice.
1615

1716
## Basic Features
1817

@@ -114,7 +113,7 @@ Kitex is distributed under the [Apache License, version 2.0](https://github.com/
114113
115114
- How to become a member: [COMMUNITY MEMBERSHIP](https://github.com/cloudwego/community/blob/main/COMMUNITY_MEMBERSHIP.md)
116115
- Issues: [Issues](https://github.com/cloudwego/kitex/issues)
117-
- Slack: Join our CloudWeGo community [Slack Channel](https://join.slack.com/t/cloudwego/shared_invite/zt-tmcbzewn-UjXMF3ZQsPhl7W3tEDZboA).
116+
- Discord: Join community with [Discord Channel](https://discord.gg/jceZSE7DsW).
118117
- Lark: Scan the QR code below with [Lark](https://www.larksuite.com/zh_cn/download) to join our CloudWeGo/kitex user group.
119118

120119
![LarkGroup](images/lark_group.png)

README_cn.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
[![ClosedIssue](https://img.shields.io/github/issues-closed/cloudwego/kitex)](https://github.com/cloudwego/kitex/issues?q=is%3Aissue+is%3Aclosed)
1111
![Stars](https://img.shields.io/github/stars/cloudwego/kitex)
1212
![Forks](https://img.shields.io/github/forks/cloudwego/kitex)
13-
[![Slack](https://img.shields.io/badge/slack-join_chat-success.svg?logo=slack)](https://cloudwego.slack.com/join/shared_invite/zt-tmcbzewn-UjXMF3ZQsPhl7W3tEDZboA)
1413

15-
Kitex[kaɪt'eks] 字节跳动内部的 Golang 微服务 RPC 框架,具有**高性能****强可扩展**的特点,在字节内部已广泛使用。如今越来越多的微服务选择使用 Golang,如果对微服务性能有要求,又希望定制扩展融入自己的治理体系,Kitex 会是一个不错的选择。
14+
Kitex[kaɪt'eks] 字节跳动内部的 Go 微服务 RPC 框架,具有**高性能****强可扩展**的特点,在字节内部已广泛使用。如今越来越多的微服务选择使用 Go,如果对微服务性能有要求,又希望定制扩展融入自己的治理体系,Kitex 会是一个不错的选择。
1615

1716
## 框架特点
1817

@@ -112,7 +111,7 @@ Kitex 基于[Apache License 2.0](LICENSE) 许可证,其依赖的三方组件
112111
113112
- 如何成为 member: [COMMUNITY MEMBERSHIP](https://github.com/cloudwego/community/blob/main/COMMUNITY_MEMBERSHIP.md)
114113
- Issues: [Issues](https://github.com/cloudwego/kitex/issues)
115-
- Slack: 加入我们的 [Slack 频道](https://join.slack.com/t/cloudwego/shared_invite/zt-tmcbzewn-UjXMF3ZQsPhl7W3tEDZboA)
114+
- Discord: 加入我们的 [Discord 频道](https://discord.gg/jceZSE7DsW)
116115
- 飞书用户群([注册飞书](https://www.feishu.cn/)后扫码进群)
117116

118117
![LarkGroup](images/lark_group_cn.png)

client/callopt/options.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,28 @@ func WithTag(key, val string) Option {
182182
}
183183

184184
// WithRetryPolicy sets the retry policy for a RPC call.
185-
// Build retry.Policy with retry.BuildFailurePolicy or retry.BuildBackupRequest instead of building retry.Policy directly.
185+
// Build retry.Policy with retry.BuildFailurePolicy or retry.BuildBackupRequest or retry.BuildMixedPolicy
186+
// instead of building retry.Policy directly.
187+
//
186188
// Demos are provided below:
187189
//
188-
// demo1. call with failure retry policy, default retry error is Timeout
189-
// `resp, err := cli.Mock(ctx, req, callopt.WithRetryPolicy(retry.BuildFailurePolicy(retry.NewFailurePolicy())))`
190-
// demo2. call with backup request policy
191-
// `bp := retry.NewBackupPolicy(10)
192-
// bp.WithMaxRetryTimes(1)
193-
// resp, err := cli.Mock(ctx, req, callopt.WithRetryPolicy(retry.BuildBackupRequest(bp)))`
190+
// demo1. call with failure retry policy, default retry error is Timeout
191+
// `resp, err := cli.Mock(ctx, req, callopt.WithRetryPolicy(retry.BuildFailurePolicy(retry.NewFailurePolicy())))`
192+
// demo2. call with backup request policy
193+
// `bp := retry.NewBackupPolicy(10)
194+
// `bp.WithMaxRetryTimes(1)`
195+
// `resp, err := cli.Mock(ctx, req, callopt.WithRetryPolicy(retry.BuildBackupRequest(bp)))`
196+
// demo2. call with miexed request policy
197+
// `bp := retry.BuildMixedPolicy(10)
198+
// `resp, err := cli.Mock(ctx, req, callopt.WithRetryPolicy(retry.BuildMixedPolicy(retry.NewMixedPolicy(10))))`
194199
func WithRetryPolicy(p retry.Policy) Option {
195200
return Option{f: func(o *CallOptions, di *strings.Builder) {
196201
if !p.Enable {
197202
return
198203
}
199-
if p.Type == retry.BackupType {
204+
if p.Type == retry.MixedType {
205+
di.WriteString("WithMixedRetry")
206+
} else if p.Type == retry.BackupType {
200207
di.WriteString("WithBackupRequest")
201208
} else {
202209
di.WriteString("WithFailureRetry")

client/callopt/options_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ func TestApply(t *testing.T) {
100100
test.Assert(t, co.RetryPolicy.Enable)
101101
test.Assert(t, co.RetryPolicy.FailurePolicy != nil)
102102

103+
// WithRetryPolicy
104+
option = WithRetryPolicy(retry.BuildMixedPolicy(retry.NewMixedPolicy(10)))
105+
_, co = Apply([]Option{option}, rpcConfig, remoteInfo, client.NewConfigLocks(), http.NewDefaultResolver())
106+
test.Assert(t, co.RetryPolicy.Enable)
107+
test.Assert(t, co.RetryPolicy.MixedPolicy != nil)
108+
109+
// WithRetryPolicy
110+
option = WithRetryPolicy(retry.BuildBackupRequest(retry.NewBackupPolicy(10)))
111+
_, co = Apply([]Option{option}, rpcConfig, remoteInfo, client.NewConfigLocks(), http.NewDefaultResolver())
112+
test.Assert(t, co.RetryPolicy.Enable)
113+
test.Assert(t, co.RetryPolicy.BackupPolicy != nil)
114+
103115
// WithRetryPolicy pass empty struct
104116
option = WithRetryPolicy(retry.Policy{})
105117
_, co = Apply([]Option{option}, rpcConfig, remoteInfo, client.NewConfigLocks(), http.NewDefaultResolver())

0 commit comments

Comments
 (0)